SRL Archive - OSR Help

What is wrong with this?


Wreck

2012-06-10 14:28:24

From my AIOPowerChopper script (Link in sig).
9/10 times this works perfectly but then the other 1/10 times it just hovers over the items one by one then exits the loop because of fs and then repeats this over and over until it eventually starts to find the uptext again, im 99% sure its the uptext (LogUpText := ['ow lo', 'low log'];) but I just cant see what is wrong with it.

procedure DropLogs(var Obj: Tree);
var
TPA: TPointArray;
P: TPoint;
LogDTM, i, fs: Integer;
begin
LogDTM := DTMFromString(Obj.LogDTM);
FindDTMs(LogDTM, TPA, MIX1, MIY1, MIX2, MIY2);
if (Length(TPA) < 1) then
begin
FreeDTM(LogDTM);
Exit;
end;

RAaSTPAEx(TPA, 10, 10);
For i := 0 To High(TPA) Do
begin
if (fs >= 4) then
begin
fs := 0;
FreeDTM(LogDTM);
Exit;
end;
MMouse(TPA[i].x, TPA[i].y, 5, 5);
if WaitUpTextMulti(Obj.LogUpText, 350 + Random(150)) then
begin
GetMousePos(P.x, P.y);
Mouse(P.x, P.y, 0, 0, mouse_Right);
if WaitOptionMulti(Obj.LogOption, 350 + Random(150)) then
begin
ChooseOptionMulti(Obj.LogOption);
end;
end else
IncEx(fs, 1);
end;

FreeDTM(LogDTM);
end;

EtherFreak

2012-06-10 15:05:19

Sometimes the uptext can be hard to make out, due to it not standing out. This can be because of too similar colors within the uptext. I also found that I had issues with spaces sometimes. you might try adding a "llow" as an option and see if this helps. Remember that botting by color is not a perfect science.

Runaway

2012-06-10 15:20:15

As EtherFreak said, try breaking the uptext up into smaller pieces and remove spaces if possible. If you find you're still having occasional uptext issues even after doing that, you can try rotating the screen a little if the uptext isn't found.

Also:


if WaitOptionMulti(Obj.LogOption, 350 + Random(150)) then
begin
ChooseOptionMulti(Obj.LogOption);
end;

// WaitOptionMulti is ChooseOptionMulti, except with the wait included. You can just use:

WaitOptionMulti(Obj.LogOption, 350 + Random(150));

// To get the same effect.

Wreck

2012-06-10 15:47:37

From: Runaway
As EtherFreak said, try breaking the uptext up into smaller pieces and remove spaces if possible. If you find you're still having occasional uptext issues even after doing that, you can try rotating the screen a little if the uptext isn't found.

Also:


if WaitOptionMulti(Obj.LogOption, 350 + Random(150)) then
begin
ChooseOptionMulti(Obj.LogOption);
end;

// WaitOptionMulti is ChooseOptionMulti, except with the wait included. You can just use:

WaitOptionMulti(Obj.LogOption, 350 + Random(150));

// To get the same effect.


Thanks!