SRL Archive - SRL Archives

My Pin Inputter


TOB

2006-12-09 09:59:28

[PHP]{*******************************************************************************
procedure ClickCurrentPos(ranX, ranY: Integer; Left: Boolean);
by: TOB
Description: Clicks where current mouse position is with a little randomness
*******************************************************************************}
procedure ClickCurrentPos(ranX, ranY: Integer; Left: Boolean);
var
negRanX, negRanY: Integer;
begin
GetMousePos(x, y);
if(ranX > 0) then
negRanX:= Random(ranX) + 1;
if(ranY > 0) then
negRanY:= Random(ranY) + 1;
Mouse(x, y, ranX - negRanX, ranY - negRanY, Left);
end;


{*******************************************************************************
function InPin2(pin: String): Boolean;
by: TOB
Description: Puts in bank pin. Results True if BankScreen is open
*******************************************************************************}
function InPin2(pin: String): Boolean;
var
iNumber: Integer;
begin
if(FindText(x, y, 'First', Upchars, 175, 80, 212, 100)) then
begin
Wait(200 + random(200));
if(not(ClickText2(Pin[1], UpChars, 1, 1, 512, 336, True))) then ClickCurrentPos(5, 5, True);
Wait(500 + Random(500));
repeat
Wait(100);
if(not(LoggedIn)) then Exit;
until(FindText(x, y, 'Now', Upchars, 168, 80, 200, 100));
Wait(200 + random(200));
if(not(ClickText2(Pin[2], UpChars, 1, 1, 512, 336, True))) then ClickCurrentPos(5, 5, True);
Wait(500 + Random(500));
repeat
Wait(100);
if(not(LoggedIn)) then Exit;
until(FindText(x, y, 'Time', Upchars, 180, 80, 212, 100));
Wait(200 + random(200));
if(not(ClickText2(Pin[3], UpChars, 1, 1, 512, 336, True))) then ClickCurrentPos(5, 5, True);
Wait(500 + Random(500));
repeat
Wait(100);
if(not(LoggedIn)) then Exit;
until(FindText(x, y, 'Finally', Upchars, 175, 80, 222, 100));
Wait(200 + random(200));
if(not(ClickText2(Pin[4], UpChars, 1, 1, 512, 336, True))) then ClickCurrentPos(5, 5, True);
Wait(500 + Random(500));
repeat
Wait(100);
until BankScreen or not loggedin;
end;
if(BankScreen) then Result:= True;
end;[/PHP]

IronTeapot

2006-12-09 11:44:39

Very nice, Very nice indeed… I was going to rewrite the inpin function so that it just moved the mouse off the red blocks to the nearest dark background color instead of moving to beneath the chest each time. Your function pretty much eliminates that extra mouse movement. Although now that I'm looking at it… where does it say to find and click a number if the mouse isn't currently hiding it? Or is that the clicktext2 part, where it will still look and click for it, but if it cant, then it will click on the hidden number. Humm… nice. :)

TOB

2006-12-09 13:04:23

Ya ClickText2 will execute it if it is possible even within the if statement.