The changes I made were :
-I changed WalkToShop to
Simba Code:
Result := WalkToTile(Tile(3274, 3181), 2, 0);
Wait(250 + Random(100));
-WaitTextTPA needed a break after MouseBox because it was continuing with the while loop even after clicking the box and that was slowing the buying process down a lot. Also added a small wait before the break to account for lag/update speed.
Simba Code:
function WaitTextTPA: Boolean;
var
T: Integer;
begin
T := GetSystemTime;
while (TimeFromMark(T) < 5000) do
if (not SimilarColors(GetColor(207, 368), 128, 10)) then
Wait(50 + Random(55))
else
begin
Result := True;
Wait(150 + Random(50));
MouseBox(230, 430, 290, 435, 1);
Wait(200 + Random(100));
Break;
end;
end;
- Reduced the wait in HandleSeller to this
Simba Code:
if (WaitFunc(@R_ClickToContinue, 250 + Random(500), 5000)) then
begin
Inc(Players[CP].Integers[PV_BOUGHT]);
Wait(200 + Random(50));
end;
to slightly speed up the buying process some more.
-I reduced the randomness used for clicking the seller in FindSeller because I found that it often misclicked around him and although I guess this was for antiban purposes, I thought it was a little overkill.
-Changed the WaitPerLoop timing used in WaitFunc in HandleSeller to
in order to increase speed of buying a small amount.
-Changed the Result of HandleSeller to
Simba Code:
Result := (not(R_ItemIDExists(Coins, 995)))
or ((GetItemStackSizeAt(Coins.Slot) > 1) and (InvFull));
in order to deal with accidental withdrawl of extra coins and used reflection to check for coins in the inventory so that I could use GetItemStackSizeAt.
-Added this wait after withdrawing coins from the bank and before exiting the HandleBank procedure.
Edit: I actually increased this to (350 + Random(100))
This accounts for lag/update speed of the coins actually appearing in the inventory, and it reduces the chances of the script withdrawing the coins twice because it doesn't detect them the first time.
Those are all the changes I made and it's now running at about 678 kebabs per hour, and it's running with fewer mistakes. I'll post a progress report when I give it a good long run.
Edit: Progress Report!
Progress Report:
<!---
<! EvilChicken!'s Kebab Buyer v0.3
<!---
<! Total runtime: 49 Minutes and 10 Seconds
<! Players active: 1 out of 1
<! Total amount of kebabs bought: 585
<! -> Kebabs bought per hour: 713
<!---
<! ## | Nick | A | Kebabs: | Status: | Rand:
<! 0 | airb | T | 585 | |
<!---
Working great What's particularly fantastic about this script is that it is the perfect thing to make money with on a brand new character with no skills/stats. Just kill some goblins for about 150 gp, and then start this up.