SRL Archive - OSR Help

-script doesent do anything-


rj

2011-10-15 23:56:51

so i made a theiving bot for a private server called pkpassage. it is suposed to click on the table 10 times click the npc sell the cake then return to the square. when i run the script my mouse does not move at all. here is the code:(idc if its stolen its nothing specail):
//auto theiver by thehatered(rjj95)
program Autotheiver;
Var x,y: Integer;
Procedure findtable;
begin;
wait(800)
FindColorTolerance (x,y,5231294,185,134,208,173,12);
wait(2200)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(3000)
end;
begin
//find NPC
wait(1000)
FindColorTolerance (x,y,3689566,166,195,194,213,12);
wait(500)
ClickMouse(x, y, Mouse_Left);
wait(1200)
end.
begin
Procedure findcake;
wait(1000)
FindColorTolerance (x,y,207164,607,211,635,240,12);
wait(500)
ClickMouse(x, y, Mouse_Right);
wait(1200)
end;
begin
Procedure sellcake;
wait(1000)
FindColorTolerance (x,y,2070783,550,295,608,311,50);
wait(700)
ClickMouse(x, y, Mouse_Left);
wait(900)
end;
begin
Procedure closeout;
wait(1000)
FindColorTolerance (x,y,3358280,419,24,501,52,50);
wait(700)
end;
begin
Procedure findsquare;
wait(1000)
FindColorTolerance (x,y,942420,288,115,321,151,50);
wait(700)
end.

Harry

2011-10-16 08:05:47

To clickMouse you must moveMouse first, even though clickMouse has coords in it. It's weird :p Also I suggest adding writeLns, such as:
if findcolortol(..) then
begin
writeln('found color!');
movemouse etc...
end else
writeln('did not find color!');
Will make debugging your problems a lot easier.

rj

2011-10-16 11:04:39

ok ty ill post if i have anymore trouble

rj

2011-10-16 11:12:20

//auto theiver by thehatered(rjj95)
program Autotheiver;
Var x,y: Integer;
Procedure findtable;
begin;
wait(800)
FindColorTolerance (x,y,5231294,185,134,208,173,12);
wait(2200)
if FindColorTolerance(x,y,5231294,185,134,208,173,12) then
begin
writeln('found color!');
wait(500)
movemouse(x, y)
wait(500)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(1700)
ClickMouse(x, y, Mouse_Left)
wait(3000)
end;

begin
//find NPC
wait(1000)
FindColorTolerance (x,y,3689566,166,195,194,213,12);
wait(500)
ClickMouse(x, y, Mouse_Left);
wait(1200)
end;
begin
// Procedure findcake;
wait(1000)
FindColorTolerance (x,y,207164,607,211,635,240,12);
wait(500)
ClickMouse(x, y, Mouse_Right);
wait(1200)
end;
begin
// Procedure sellcake;
wait(1000)
FindColorTolerance (x,y,2070783,550,295,608,311,50);
wait(700)
ClickMouse(x, y, Mouse_Left);
wait(900)
end;
begin
// Procedure closeout;
wait(1000)
FindColorTolerance (x,y,3358280,419,24,501,52,50);
wait(700)
end;
begin
// Procedure findsquare;
wait(1000)
FindColorTolerance (x,y,942420,288,115,321,151,50);
wait(700)
end.
well i added that in but i cant run it i keep getting errors:
[Error] (71:5): Identifier expected at line 70
Compiling failed.

Flight

2011-10-16 11:15:19

Give me a few minutes and I'll clean this up for ya.

rj

2011-10-16 11:21:33

ty.
im mainly just trying to get my mouse to click a color.

Flight

2011-10-16 11:36:19

Try this out bud. Obviously I cannot test it but compiles just fine and it's much cleaner. I made things as simple as I could, but if you get lost somewhere or you get errors just let me know and I'll help.


//auto theiver by thehatered(rjj95)
program Autotheiver;

Procedure LootCakes;
Var
X,Y,I: Integer;
begin
wait(800);

if FindColorTolerance(X,Y,5231294,185,134,208,173,12) then
begin

wait(500);
movemouse(x, y);
wait(500);

for i := 0 to High(9) do //This means repeat the code below 9 times
begin
ClickMouse(x, y, Mouse_Left);
wait(1700);
end;

//Now that we've done that 9 times, let's continue the script
wait(3000);

end else
writeln('Failed to find color (table color)');
end;

Procedure SellCakes;
Var
X,Y: Integer;
begin

//find NPC
wait(1000);
if FindColorTolerance(x,y,3689566,166,195,194,213,12) then
begin
wait(500);
ClickMouse(x, y, Mouse_Left);
wait(1200);
end else
writeln('Failed to find color (find NPC)');

//find cake
if FindColorTolerance(x,y,207164,607,211,635,240,12) then
begin
wait(500);
ClickMouse(x, y, Mouse_Left);
wait(1200);
end else
writeln('Failed to find color (find cake)');

//sell cake
if FindColorTolerance(x,y,2070783,550,295,608,311,50) then
begin
wait(500);
ClickMouse(x, y, Mouse_Left);
wait(1200);
end else
writeln('Failed to find color (sell cake)');

//close out
if FindColorTolerance(x,y,3358280,419,24,501,52,50) then
begin
wait(500);
ClickMouse(x, y, Mouse_Left);
wait(1200);
end else
writeln('Failed to find color (close out)');

//find square
if FindColorTolerance(x,y,942420,288,115,321,151,50) then
begin
wait(500);
ClickMouse(x, y, Mouse_Left);
wait(1200);
end else
writeln('Failed to find color (find square)');

end;

begin
LootCakes;
SellCakes;
end.

rj

2011-10-16 11:39:24

ok thanks ill try it out

rj

2011-10-16 11:47:31

ty so much but theres a small problem. the bot clicks on the cakes and only clicks on the cakes. the script wont move on to click the npc and sell them

Flight

2011-10-16 11:51:45

I'm afraid I'll need some more info before I can help beyond that. Try putting in some more debugging (like how I did) and let me know where exactly you're having your problems. It might just be a matter of wrong colors or too much tolerance so it's finding colors you don't want to find.

rj

2011-10-16 11:56:50

it does the first procedure until the script is stopped ill try adding less tolerence and see what happens

rj

2011-10-16 12:01:37

script still loops on the first procedure

—
ive got to go for now ill be on later not sure when thanks for the help guys.