SRL Archive - Help

help with coding


devilgnome

2012-06-02 16:23:36

this is my first simba script, but idk whats wrong, it starts and says its playing, but nothing happens, and is there a way to use smart client for another internet browser game?

program autofighterpro;

procedure initiate;
Begin;
MoveMouse(939, 540);
ClickMouse(939, 540, 1);
Wait(10000)
end;

procedure attack;
Begin;
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(3000);
ClickMouse(657, 496, 1);
end;

begin;
ClickMouse(680, 500, 1);
Wait(5000);
ClickMouse(969, 625, 1);
repeat
autofighterpro;
end.

YoHoJo

2012-06-02 16:26:54

Umm….
Did you write this?

All it does is do a bunch of coordinate clicks, with absolutely no randomness at all, and it will definitely get you banned.

It won't even work right, it just clicks same spots over and over, it doesn't even properly find a monster or anything….

You're better of writing your own, or using Narcles.

devilgnome

2012-06-02 16:27:38

its just a click based browser game im playin, with no ban rate lol

YoHoJo

2012-06-02 16:33:11

I just saw name autofighterpro and assumed it was for rs.

Well.
Did you drag your crosshairs onto the game before getting all of those coordinates?
Also again drag your corsshairs onto the game before clicking play.

devilgnome

2012-06-02 16:40:08

hmm i dragged the crosshair and now im getting this error:


[Error] (46:3): Unknown identifier 'autofighterpro' at line 45
Compiling failed.

kevin33

2012-06-02 16:41:44

Thats the name of the program, you dont need to state it in the main loop.

devilgnome

2012-06-02 16:43:09

alright i fixed that, now i got one last error :p

[Error] (46:1): Identifier expected at line 45
Compiling failed.

YoHoJo

2012-06-02 16:44:57

In mainloop changed AutoFighterPro to attack (it was name of program, you wanted name of procedure)

Removed ; after the very last begin.

Put until(false) after the Attack (you need to tell repeat how long to repeat for).

Put a . after the last end.

program autofighterpro;

procedure initiate;
Begin;
MoveMouse(939, 540);
ClickMouse(939, 540, 1);
Wait(10000)
end;

procedure attack;
Begin;
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(3000);
ClickMouse(657, 496, 1);
end;

begin
ClickMouse(680, 500, 1);
Wait(5000);
ClickMouse(969, 625, 1);
repeat
attack;
Until(False)
end.

devilgnome

2012-06-02 16:49:03

well i think its working, except i guess i got a few mouse positions wrong ;p , wat a good way to get mouse positions? im using a script in ecplise for it , but apparently its not good :p

YoHoJo

2012-06-02 16:50:00

Whaaa?
There is a color picker/dropper tool in simba. (Near play button etc)
Click that once, then click where you want coordinates of, then it will return the X, Y, and color at that point.

devilgnome

2012-06-02 17:05:04

alright i cleaned up the script a bit, edited the coords, but when i click start, it doesnt do anything :x and how can i make it repeat the script until i turn it off?

program autofighterpro;

procedure initiate;
Begin;
MoveMouse(645, 455);
ClickMouse(645, 455, 1);
Wait(10000)
end;

procedure attack;
Begin;
MoveMouse(379, 236);
ClickMouse(379, 236, 1);
Wait(3000);
ClickMouse(514, 241, 1);
Wait(10000)
ClickMouse(116, 292, 1);
Wait(1000);
repeat
attack;
Until(False)
Wait(3000);
ClickMouse(405, 420, 1);
Wait(3000);
ClickMouse(405, 420, 1);
end;

begin
ClickMouse(409, 423, 1);
Wait(5000);
ClickMouse(691, 548, 1);
end.

YoHoJo

2012-06-02 17:07:47

You dont have the attack procedure in your main loop (at bottom).
Also you need to put repeat Until(false) to repeat forever.

YoHoJo

2012-06-02 17:08:03

You dont have the attack procedure in your main loop (at bottom).
Also you need to put repeat Until(false) to repeat forever.

kevin33

2012-06-02 17:10:46

It wont do anything unless you choose the client picker (green crosshair beside colour picker) and drag it to the window with the game. You also need to call the attack procedure in your main loop if you want it to do the procedure. As for repeat, call it in your main loop as Repeat until false; then it should repeat until turned off or an error occurs or whatever.

^Yoho the :ninja: accidental double poster :)

devilgnome

2012-06-02 17:14:10

hmm not gonna lie, im confused :p can you help me write it out? haha

devilgnome

2012-06-02 17:26:16

+ is there anyway i can make it click a certain part if that part pops up?

kevin33

2012-06-02 17:42:45

program autofighterpro;

procedure initiate;
Begin;
MoveMouse(939, 540);
ClickMouse(939, 540, 1);
Wait(10000)
end;

procedure attack;
Begin;
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(10000)
MoveMouse(658, 316);
ClickMouse(658, 316, 1);
Wait(3000);
ClickMouse(782, 319, 1);
Wait(3000);
ClickMouse(657, 496, 1);
end;

begin
ClickMouse(680, 500, 1);
Wait(5000);
ClickMouse(969, 625, 1);
repeat
attack;
Until(False)
end.

This is what you asked, Yoho already made it for you, as for the clicking the pop up thing, I have no idea. Not familiar with scripts for games other than rs.

YoHoJo

2012-06-02 17:43:59

Yeah read some beginner tutorials to use bitmap/color/dtm etc to find things besides just coordinate clicks!