Skip to content
Browse files

Doc: Updated doc to resolve the Skills.simba change

Animating: Updated ANIM_IDLE
Objects: Fixed an issue where it would still left click even if it was set to RightClickOnly
Objects: Updated fishing spot colors, works a lot better now
Common: Updated header
Common: AutoInvFull will now relocate to every point (except original) before waiting
Fishing: Sped up WaitWhileFishing + improved SMART debugging
Mining: Improved SMART debugging
  • Loading branch information...
1 parent 0f54184 commit a062d03bec408a6e1f635124d3ecb08126d7a664 @cohenadair committed
Showing with 48 additions and 42 deletions.
  1. +2 −2 Doc/Makefile
  2. +1 −1 Doc/sphinx/index.rst
  3. +2 −2 MSI/Core/Animating.simba
  4. +13 −13 MSI/Core/Objects.simba
  5. +15 −10 MSI/Skills/Common.simba
  6. +13 −12 MSI/Skills/Fishing.simba
  7. +2 −2 MSI/Skills/Mining.simba
View
4 Doc/Makefile
@@ -4,9 +4,9 @@ runme = RunMe
core = Animating Antiban Banking Debug Extras Globals Items Locations \
Mainloop Manipulation Materials Objects Obstacles Reports Scripts \
- Setup Skills Track Walking
+ Setup Track Walking
-skills = Cooking Fishing Magic Mining Money_Making Woodcutting
+skills = Common Cooking Fishing Magic Mining Money_Making Woodcutting
all:
View
2 Doc/sphinx/index.rst
@@ -28,7 +28,6 @@ Contents:
Reports.rst
Scripts.rst
Setup.rst
- Skills.rst
Track.rst
Walking.rst
Woodcutting.rst
@@ -37,6 +36,7 @@ Contents:
Fishing.rst
Cooking.rst
Money_Making.rst
+ Common.rst
Indices and tables
View
4 MSI/Core/Animating.simba
@@ -45,7 +45,7 @@ begin
begin
Name := 'Player Idle';
MinPixelShift := 0;
- MaxPixelShift := 60;
+ MaxPixelShift := 40;
PixelBox := IntToBox(PLBX1, PLBY1, PLBX2, PLBY2);
Interval := 25;
MaxTime := 125;
@@ -136,7 +136,7 @@ begin
begin
avg := averagePixelShift(pixelBox, interval, maxTime);
result := inRange(avg, minPixelShift, maxPixelShift);
- //MSI_SubDebug('Average pixel shift: ' + intToStr(avg));
+ MSI_SubDebug('Average pixel shift: ' + intToStr(avg));
if (result) then
MSI_SubDebug('Player animation: ' + anim.name);
View
26 MSI/Core/Objects.simba
@@ -716,14 +716,14 @@ begin
//same color info for all spots
with result do
begin
- Colors := [11050135];
+ Colors := [12168614];
Tol := 8;
- Hue := 0.26;
- Sat := 0.62;
+ Hue := 0.28;
+ Sat := 0.71;
FindAllColors := False;
W := 40;
H := 40;
- Accuracy := 5;
+ Accuracy := 10;
SearchArea := MSBox;
ExcludeSelf := True;
WaitToMove := True;
@@ -1286,11 +1286,6 @@ begin
if (obj.searchArea.x2 > MSX2) then obj.searchArea.x2 := MSX2;
if (obj.searchArea.y2 > MSY2) then obj.searchArea.y2 := MSY2;
- {$IFDEF SMART}
- if (MSI_Settings[SETUP_DEBUG_SMART]) then
- SMART_DrawBoxMS(true, obj.searchArea, clYellow);
- {$ENDIF}
-
if (findColorsTolerance(TPA,
obj.colors[0],
obj.searchArea.x1,
@@ -1299,6 +1294,14 @@ begin
obj.searchArea.y2,
obj.tol)) then
begin
+ {$IFDEF SMART}
+ if (MSI_Settings[SETUP_DEBUG_SMART]) then
+ begin
+ SMART_DrawDotsEx(true, TPA, clRed);
+ SMART_DrawBoxMS(false, obj.searchArea, clYellow);
+ end;
+ {$ENDIF}
+
ATPA := TPAtoATPAEx(TPA, obj.w, obj.h);
sortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
if (length(ATPA) > 0) then
@@ -1441,10 +1444,7 @@ begin
mouse(obj.x, obj.y, 0, 0, false);
result := waitOptionMulti(obj.options, randomRange(150, 200));
end;
- end;
-
- // left click
- if (not result) then
+ end else
if (action = moLeft) then
begin
if (obj.multiClick) then
View
25 MSI/Skills/Common.simba
@@ -1,12 +1,11 @@
(*
-Skills
+Common
======
-The Skills file holds any routines that are used for multiple skills and that
-don't fit into any other include file.
+The Common file holds any routines that are used for more than one skill.
-The source for Skills.simba can be found
-`here <https://github.com/SRL/MSI/raw/master/MSI/Core/Skills.simba>`_.
+The source for Common.simba can be found
+`here <https://github.com/SRL/MSI/raw/master/MSI/Core/Common.simba>`_.
*)
@@ -137,7 +136,7 @@ Example:
*)
function MSI_AutoInvFull(auto: function(objs: TIntegerArray): boolean): boolean;
var
- t, waitTime, tTime, maxTime: Integer;
+ t, waitTime, tTime, maxTime, timesRelocated: integer;
tObjects, newObjects: TIntegerArray;
begin
if (not loggedIn) then
@@ -199,11 +198,17 @@ begin
else
makeCompass(randomRange(195, 215));
- if (MSI_Relocate(MSI_Players[CurrentPlayer].Location)) then
+ if (MSI_Relocate(Location)) then
begin
- tTime := RandomRange(60000, 120000); // Random 1-2 minutes
- MSI_SubDebug('Waiting ' + IntToStr(tTime) + ' ms before relocating again');
- MarkTime(waitTime);
+ inc(timesRelocated);
+
+ if (timesRelocated <> (length(MSI_Locations[Location].Tiles) - 1)) then
+ begin
+ tTime := RandomRange(60000, 120000); // Random 1-2 minutes
+ MSI_SubDebug('Waiting ' + IntToStr(tTime) + ' ms before relocating again');
+ MarkTime(waitTime);
+ end;
+
MSI_NotBoxes := [];
Break;
end else
View
25 MSI/Skills/Fishing.simba
@@ -207,7 +207,7 @@ Example:
*)
function MSI_WaitWhileFishing(fishSpot: TMSObject): boolean;
var
- i, h, x, y, CTS, animTries, colorTries, oldInvCount, waitTime, invTimer: integer;
+ i, h, x, y, CTS, animTries, oldInvCount, waitTime, invTimer: integer;
idle: TAnimation;
arr: TPointArray;
ATPA: T2DPointArray;
@@ -224,11 +224,6 @@ begin
MSI_AddHeader('MSI_WaitWhileFishing');
fishSpot.searchArea := MSI_MakeBox(point(fishSpot.x, fishSpot.y), fishSpot.w, fishSpot.h);
- {$IFDEF SMART}
- if (MSI_Settings[SETUP_DEBUG_SMART]) then
- SMART_DrawBoxEx(true, fishSpot.searchArea, clBlue);
- {$ENDIF}
-
idle := MSI_GetAnimation(ANIM_IDLE);
waitTime := (getSystemTime + (60000 * 3));
oldInvCount := invCount;
@@ -282,14 +277,20 @@ begin
arr := mergeATPA(ATPA);
+ {$IFDEF SMART}
+ if (MSI_Settings[SETUP_DEBUG_SMART]) then
+ begin
+ SMART_DrawBoxEx(true, fishSpot.searchArea, clBlue);
+ SMART_DrawDotsEx(false, arr, clRed);
+ end;
+ {$ENDIF}
+
if (length(arr) < fishSpot.accuracy) then
begin
- MSI_Debug('Colours found < Accuracy');
- inc(colorTries);
- end else begin
+ MSI_Debug('Fishing spot not found');
+ break;
+ end else
MSI_Debug('Fishing spot found');
- colorTries := 0;
- end;
MSI_AntiBan(randomRange(0, 3000), ANTI_BAN_CHANCE);
@@ -329,7 +330,7 @@ begin
end;
wait(randomRange(300, 700));
- until((not loggedIn) or (animTries >= 10) or (colorTries > 5));
+ until((not loggedIn) or (animTries >= 10));
MSI_CloseHeader('MSI_WaitWhileFishing: ' + boolToStr(result));
View
4 MSI/Skills/Mining.simba
@@ -138,8 +138,8 @@ begin
arr := mergeATPA(ATPA);
{$IFDEF SMART}
- if (MSI_Settings[SETUP_DEBUG_SMART]) then
- SMART_DrawDotsEx(false, arr, clYellow);
+ if (MSI_Settings[SETUP_DEBUG_SMART]) then
+ SMART_DrawDotsEx(false, arr, clYellow);
{$ENDIF}
if (length(arr) < rock.accuracy) then

0 comments on commit a062d03

Please sign in to comment.
Something went wrong with that request. Please try again.