SRL Archive - FAQ

OCR problem


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:
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

Wizzup?

2012-01-16 06:52:28

Are you using SRL 5?

Shatterhand

2012-01-16 07:10:07

yes i am.

Wizzup?

2012-01-16 07:24:49

As for your problem, I don't have time to look at it now, but perhaps someone else can. Few answers:

From: hunt3rx3
Edit: I also dont get it why we have to use 'ithdraw' instead of 'withdraw'. Some one please explain me.


'Withdraw' should work instead of 'ithdraw', but the OCR is not 100% right all the time, so it's safer to only pick a part of the word. (That does not occur elsewhere)

From: hunt3rx3

Edit2: Just noticed the SRL Withdraw function randomly choose between withdraw-18 and withdraw-x type 18 enter methods. :D


That's good I suppose.

bg5

2012-01-16 08:21:56

From: hunt3rx3

The SRL Withdraw function types the X all the times, so thats not so humanic.


Check:

http://villavu.com/forum/showthread.php?t=72454

Shatterhand

2012-01-16 16:36:08

Thanks for the answers! :)