Cazax
2009-02-04 15:00:31
I have seen scripts are calling randoms in a wrong way:
That's wrong, if you get an unsolvable random or it couldn't solve a random, FindNormalRandoms will logout. So, if you call it inside a loop for example:
Procedure CheckRandoms;
Begin
FindNormalRandoms;
End;That's wrong, if you get an unsolvable random or it couldn't solve a random, FindNormalRandoms will logout. So, if you call it inside a loop for example:
Repeat
CheckRandoms;
If FindTree(X, Y) Then
Begin
Mouse(X, Y, 5, 5, True);
.................. It would logout and start searching for a tree. How to call it:Repeat
If FindNormalRandoms Then
If Not LoggedIn Then
Exit;
If FindTree(X, Y) Then
Begin
Mouse(X, Y, 5, 5, True);
..............That's why FindNormalRandoms is a function, not a procedure. You could adapt it to check fights too. example:Function Randoms: Boolean;
Begin
Result := FindNormalRandoms;
If FindFight Then
Begin
...
Result := True;
End;
End;
......
If Randoms Then
Begin
Writeln('Found random/fighting random!');
If Not LoggedIn Then
Exit;
End;Thank you for reading :)From: tarajunky
Just be sure you don't do this in your main loop, or it will accidentally terminate your script. Sometimes instead of exit; you need to use break;