PDA

View Full Version : Help with simple thieving script please!



Follow
01-28-2016, 02:52 PM
Hey everyone, I'm really new to scripting and I'm just trying to get a very simple thieving script working on a private server.

It functions essentially the same as an auto clicker, and could easily be replaced by one, but I decided to do this for practise.

Here it is..


Program ClickStall;
{$i SRL-OSR/srl.simba}
Procedure ClickStall;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 10867935, 247, 200, 336, 230, 3) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.



So, as you can see, its extremely basic. It compiiles perfectly but my problem is trying to run the script.


When I press run I get..


SRL Compiled in 31 msec
Successfully executed.

but, nothing happens in the client, and yes i did drag client selector to my client.


Any help would be greatly appreciated! I hope to contribute to this community in a big way in the future, thanks :)

the bank
01-28-2016, 03:28 PM
Notice:


Begin
MouseSpeed := 15;
SetupSRL;
end.

This is your main execution. Your entry point.

All your script does right now is set mouse speed and setup the SRL library.

Call your function in your main.


Begin
MouseSpeed := 15;
SetupSRL();
ClickStall();
end.

Follow
01-28-2016, 03:32 PM
Notice:


Begin
MouseSpeed := 15;
SetupSRL;
end.

This is your main execution. Your entry point.

All your script does right now is set mouse speed and setup the SRL library.

Call your function in your main.


Begin
MouseSpeed := 15;
SetupSRL();
ClickStall();
end.

Thanks so much!!

Would you be able to help me turn this into a loop? I just want it to keep clicking the stall, at the moment it just stops after one click.
How exactly would I go about doing this?

acow
01-28-2016, 04:35 PM
Thanks so much!!

Would you be able to help me turn this into a loop? I just want it to keep clicking the stall, at the moment it just stops after one click.
How exactly would I go about doing this?

https://gyazo.com/70d45c44da088f5d85b5211d851ec96f
https://villavu.com/forum/showthread.php?t=107757


repeat
ClickStall;
until false

Follow
01-28-2016, 05:53 PM
repeat
ClickStall;
until false
[/simba]

Thanks for the help, man. Sorry to bother everyone once more, but ive done what you said and now my script is executed succesfully but nothing is happening and my mouse doesnt even move. What could cause this? I tried chosing a more unique color and increasong the area of the coordinates where it looks for the color, but it hasnt helped. Heres the full script as I have it now!


Program ClickStall;
{$i SRL-OSR/srl.simba}
Procedure ClickStall;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 10867935, 200, 300, 500, 450, 3) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
repeat
ClickStall;
until (false)
end.

the bank
01-28-2016, 07:01 PM
Thanks for the help, man. Sorry to bother everyone once more, but ive done what you said and now my script is executed succesfully but nothing is happening and my mouse doesnt even move. What could cause this? I tried chosing a more unique color and increasong the area of the coordinates where it looks for the color, but it hasnt helped. Heres the full script as I have it now!


Program ClickStall;
{$i SRL-OSR/srl.simba}
Procedure ClickStall;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 10867935, 200, 300, 500, 450, 3) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
repeat
ClickStall;
until (false)
end.


First of all, I recommend swapping the repeat loop in favor of a while loop. I feel it is more readable, especially from people coming from other programming languages.

Next, I recommend doing some debugging. Put a WriteLn in your find color condition to see if it ever found it. Then go from there. If it never finds it, adjust your color finding. If it does find it, but doesn't move the mouse, then you seem to have a weird error.

Anyway:


Program ClickStall;
{$i SRL-OSR/srl.simba}
Procedure ClickStall;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 10867935, 200, 300, 500, 450, 3) then
begin
WriteLn('Found Color!');
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL();
while (true) do
begin
ClickStall();
end;
end.

jstemper
01-30-2016, 06:37 PM
you have some small bounds, are u sure the stall is even is within those bounds?

goodgamescript
02-04-2016, 07:48 PM
if you want to switch to srl-6 You could try something like this. Just fill in the vars.
All you have to do is get the colors of the stalls in aca and just make sure that the best color only highlights the stalls.
And if it isnt clicking the right stall adjust the cluster var.

procedure clickstall;
var
color,tol,clusterdistance:integer;
Hue,Sat:Extended;
Tpa: TPointArray;
Atpa: T2DPointArray;
area:tbox;
begin
area:= intToBox(addpoints);
color:= ;
tol:= ;
Hue:= ;
Sat:= ;
clusterdistance:= 50;

if FindColorsTolerance(Tpa, color,area,tol, colorSetting(2,Hue, sat)) then
begin
Atpa := ClusterTPA(Tpa, clusterdistance);
SortAtpaSize(Atpa, True);
mouse(middleTPA(Atpa[0]), MOUSE_MOVE,MOUSE_HUMAN);
fastclick(MOUSE_LEFT);
wait(randomrange(2900,3200))
end else
begin
writeln('couldnt find stall colors');
terminatescript;
end;
end;