SRL Archive - OSR Help

[LRC] Banking problem


Hydrogen

2012-04-08 02:13:00

I don't know TOO much about scripting but im attempting to learn.

i've found the script i need to bank @ living rock caverns.. except i don't know how to use Color, Tolerance, and ColorToleranceSpeed and what not.. :\ lol.

function OpenDepositBox : Boolean;
var
X, Y, T:integer;
begin
result := false;
If(not(LoggedIn)) then exit;
begin
if FindObjTPA(x, y, 739167, 10, -1, 30, 30, 200, ['deposit']) then
begin
GetMousePos(X, Y);
Mouse(x, y, 0, 0, mouse_left);
Result := True;
T :=0;
repeat
Inc(T);
Wait(500+random(500));
until (DepositScreen) or (T>=30);
end else
Writeln('Could not find the deposit box');
end;
end;

Much help would be appreciated. <3

m34tcode

2012-04-08 02:40:27

FindObjTPA you general want to stay away from. Same with all the other findobj functions. I find them very innacurate because they dont wait long enough on each pont, so if it finds a match, it will actually click on the next point, screwing up your script. This is from running it on a laggy computer though lol.

Replace below with ClickMouse2(mouse_Left); It saves you a line, and is clearer to someone who reads.
GetMousePos(X, Y);
Mouse(x, y, 0, 0, mouse_left);
Use a for to do loop here ;].
repeat
Inc(T);
Wait(500+random(500));
until (DepositScreen) or (T>=30);
Example of a for loop:

[LEFT]for T := 0 to 30 do
if not DepositScreen then
wait(RandomRange(150,300));
else
break;
[/LEFT]


On to color tolerance.

The 4 modes (4th is very uncommonly used) are

distance by box,
distance by sphere
hue saturation lightness (extremely accurate, but slightly slower)
and this last i forget the acronym, but it represents how humans see.

A veeery good tut on color tolerance:
http://villavu.com/forum/showthread.php?t=74908

A tutorial on TPA finding:
http://villavu.com/forum/showthread.php?t=21786

The AIO pointer tutorial, that will point you to the answer to many of lifes questions:
http://villavu.com/forum/showthread.php?t=76632

Keep trying dude, learning to script reeeally pays off =]]

Hydrogen

2012-04-08 11:32:25

thanks alot dude this helped alot, im gonna check out thoes tuts asap :)

m34tcode

2012-04-08 11:40:13

Please do. Youll learn alot =]

I did ;]

punkd

2012-04-08 19:35:24

Tutorial island would really help you out with any questions. If you don't understand something or are stuck after reading the tut, post in the help>Scripting help section and we'll be more than happy to help you out =D