SRL Archive - OSR Help

Repeat if find help needed


mika

2012-09-13 21:28:43

So im trying to make a bot for LOL and im trying to have a function that repeats untill it finds the accept button when it pops up using a DTM.
What am i doing wrong?

 Function AcceptGame;
var
ACCEPT, x, y : Integer;
begin
ACCEPT :=DTMFromString('m1gAAAHic42JgYKhjYmAIAOIcIO4C4pVAvBGIZzJB5OKAOBiItYFqbYDYEQlrArEsEMsAsRwQ6wLxMkc2Bh8mRoYKZgaGVEYGhlggbgaKbwbi01wMDKuAdC4D8YCRSIwAAFXHDIM=');
repeat
if FINDDTM(ACCEPT, X, Y, 1, 1, 731, 80) then
begin
Result:= False;
Mouse(X, Y, 6, 6,true);
Wait(311 + Random(157))
Result:= True;
FreeDTM(ACCEPT);
Exit;
end
Until Result:= True;
end;

Footy

2012-09-13 21:32:37

Just do this

Repeat
Wait(randomrange(100, 500));
Until(finddtm(blahblahblah));
Then all ur actions here.

P1ng

2012-09-13 21:40:22

function AcceptGame: Boolean;
var
ACCEPT, x, y, T : Integer;
begin
ACCEPT := DTMFromString('m1gAAAHic42JgYKhjYmAIAOIcIO4C4pVAvBGIZzJB5OKAOBiItYFqbYDYEQlrArEsEMsAsRwQ6wLxMkc2Bh8mRoYKZgaGVEYGhlggbgaKbwbi01wMDKuAdC4D8YCRSIwAAFXHDIM=');
MarkTime(T);
repeat
Result := FINDDTM(ACCEPT, X, Y, 1, 1, 731, 80);

if Result then
begin
Mouse(X, Y, 6, 6,true);
Wait(311 + Random(157))
Break;
end;
until((Result) or (TimeFromMark(T) > 10000));
FreeDTM(ACCEPT);
end;

Tidied the function up, added a timer failsafe and fixed a little bit of logic

Le Jingle

2012-09-13 22:18:23

WaitFindDTM ??

mika

2012-09-13 22:36:25

thanks ping but its not finding it when it pops up i even made a new dtm

riwu

2012-09-13 22:43:05

I think simba cannot grab the image on LOL. Try GetColor(x,y) and see if it returns a color.

Also for the above code, if you are going to break if result is true, then there is no point checking result after the until again.
Just use the FindDTM boolean, no need to make it a function.

x[Warrior]x3500

2012-09-13 23:26:28

ok i have edited this message with like 5 updates XD im just gunna rewrite it.

i ran pings code and it worked well. found it and clicked it easily. nothing wrong. make sure you are selecting the client. idk what else could go wrong.