Shatterhand
2012-01-16 06:51:57
Hey everyone!
I started scripting some days ago, and im getting better and better at it. :)
But I have a problem now. I wrote an own function for withdrawing X item from a bank. The SRL Withdraw function types the X all the times, so thats not so humanic. For my function, I have to type X once myself before running the script.
The problem is, the OCR doesnt really find the Withdraw-18 text.
Here is my code:
Help me please. :)
Edit: I also dont get it why we have to use 'ithdraw' instead of 'withdraw'. Some one please explain me.
Edit2: Just noticed the SRL Withdraw function randomly choose between withdraw-18 and withdraw-x type 18 enter methods. :D
I started scripting some days ago, and im getting better and better at it. :)
But I have a problem now. I wrote an own function for withdrawing X item from a bank. The SRL Withdraw function types the X all the times, so thats not so humanic. For my function, I have to type X once myself before running the script.
The problem is, the OCR doesnt really find the Withdraw-18 text.
Here is my code:
procedure Withdraw18(Col, Row : Integer);
var
BBox: TBox;
X, Y: Integer;
done : Boolean;
begin
done:=False;
FixBank;
BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
GetMousePos(X, Y);
repeat
PointInBox(Point(X, Y), BBox);
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, mouse_move);
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, mouse_right);
Wait(RandomRange(500,700));
if WaitOption('ithdraw-18', 300) then done:=True;
until done
end; I tried using Both WaitOption and WaitOptionMulti functions, but the bot keeps right clicking on the item, and finds the text hardly.Help me please. :)
Edit: I also dont get it why we have to use 'ithdraw' instead of 'withdraw'. Some one please explain me.
Edit2: Just noticed the SRL Withdraw function randomly choose between withdraw-18 and withdraw-x type 18 enter methods. :D