SRL Archive - OSR Help

RSPS Script


himynamesnoah

2013-04-09 16:56:28

I'm new to coding and all, but I'm looking to try and make/convert a script for CorruptionX private server.
It is Runescape just before EOC. I'm looking for a script that can chop willows at draynor (or seers) and bank them. And i'm also trying to make a script that will fly fish at shilo village, and bank.
I've tried following some tutorials, but after i start the script nothing happens. It compiles, but doesn't perform any actions.
If anyone could help, that would be great. Thanks

Ian

2013-04-09 17:00:14

Make sure that you select the client with the crosshairs before starting the script, that may have been your issue.

himynamesnoah

2013-04-09 17:03:55

From: BMWxi
Make sure that you select the client with the crosshairs before starting the script, that may have been your issue.


Thanks, I've been doing that. It will either focus on the window i selected when i press run, or just run and say completed and do nothing.
I was trying to follow a tutorial on how to use Simba on an RSPS, and this is the code (It just says it compiled, and completed successfully).
I changed the color to willows, but didn't save it.:

Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 10336, 277, 169, 326, 218, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.

I also downloaded other scripts, and removed things i didn't need (antiban and stuff) just to see if i could get anything working, and they would compile, focus on the RSPS client but do nothing.

rj

2013-04-09 17:19:43

You need the procedure in your main loop

Ian

2013-04-09 17:22:20

From: himynamesnoah
Thanks, I've been doing that. It will either focus on the window i selected when i press run, or just run and say completed and do nothing.
I was trying to follow a tutorial on how to use Simba on an RSPS, and this is the code (It just says it compiled, and completed successfully).
I changed the color to willows, but didn't save it.:

Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 10336, 277, 169, 326, 218, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.

I also downloaded other scripts, and removed things i didn't need (antiban and stuff) just to see if i could get anything working, and they would compile, focus on the RSPS client but do nothing.


Change your mainloop from

Begin
MouseSpeed := 15;
SetupSRL;
end.
to

Begin
MouseSpeed := 15;
SetupSRL;
ClickTree;
end.

himynamesnoah

2013-04-09 17:52:50

Thanks to both of you. Sadly, it still doesn't work.
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 2702913, 374, 171, 457, 237, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
ClickTree;
end.

I select the client with the green target, press Run, then I get:
Compiled successfully in 717 ms.
SRL Compiled in 16 msec
Successfully executed.

But it still doesn't do anything. It doesn't even focus on the client window, doesn't move the mouse or anything. Maybe I am doing something wrong with the coords for finding the color? I mean if i could get it to just click the tree I'd be happy :confused:


EDIT:
Also, what is needed to convert Runescape script to a RSPS?

Ian

2013-04-09 18:34:33

From: himynamesnoah

Also, what is needed to convert Runescape script to a RSPS?


It's usually easier just to start from scratch, but if it's from just before EOC or something some recently outdated ones might work.

What does do when you run this:

program ChopTree;
{$i srl/srl.simba}

begin
MouseSpeed := 15;
SetupSRL;
MMouse(0, 0, 0, 0);
end.

Sjoe

2013-04-09 18:37:52

From: BMWxi
It's usually easier just to start from scratch, but if it's from just before EOC or something some recently outdated ones might work.

What does do when you run this:

program ChopTree;

{$i srl/srl.simba}

begin
MouseSpeed := 15;
SetupSRL;
MMouse(0, 0, 0, 0);
end.


Call mousespeed after SetupSRL;

From: himynamesnoah
Thanks to both of you. Sadly, it still doesn't work.
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 2702913, 374, 171, 457, 237, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
ClickTree;
end.

I select the client with the green target, press Run, then I get:
Compiled successfully in 717 ms.
SRL Compiled in 16 msec
Successfully executed.

But it still doesn't do anything. It doesn't even focus on the client window, doesn't move the mouse or anything. Maybe I am doing something wrong with the coords for finding the color? I mean if i could get it to just click the tree I'd be happy :confused:


EDIT:
Also, what is needed to convert Runescape script to a RSPS?


Use BMWxi's tester script, see if it moves the corner of the client (if not then there are coordinates off-set)

and
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 2702913, 374, 171, 457, 237, 5) then
begin
Writeln('Found Color') // always use debug lines after if then statements to see whether it HAS been found.
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;

end.

rj

2013-04-09 21:23:54

From: BMWxi
It's usually easier just to start from scratch, but if it's from just before EOC or something some recently outdated ones might work.

What does do when you run this:

program ChopTree;
{$i srl/srl.simba}

begin
MouseSpeed := 15;
SetupSRL;
MMouse(0, 0, 0, 0);
end.


Or he can go hardcore and make working up text and edit sps,

But yea just start from scratch since the srl functions won't work unless the server is 100% like rs

himynamesnoah

2013-04-10 12:45:52

From: BMWxi
It's usually easier just to start from scratch, but if it's from just before EOC or something some recently outdated ones might work.

What does do when you run this:

program ChopTree;
{$i srl/srl.simba}

begin
MouseSpeed := 15;
SetupSRL;
MMouse(0, 0, 0, 0);
end.


That moves the mouse over to the top left corner of the client.

From: Sjoekeloe
Call mousespeed after SetupSRL;



Use BMWxi's tester script, see if it moves the corner of the client (if not then there are coordinates off-set)

and
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 2702913, 374, 171, 457, 237, 5) then
begin
Writeln('Found Color') // always use debug lines after if then statements to see whether it HAS been found.
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;

end.


This is the code i just tried:
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 2702913, 374, 171, 457, 237, 5) then
begin
Writeln('Found Color') // always use debug lines after if then statements to see whether it HAS been found.
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
SetupSRL;
MouseSpeed := 15;
ClickTree;
end.

It still doesn't do anything. This is all i get:
Compiled successfully in 702 ms.
SRL Compiled in 15 msec
Successfully executed.

From: RJJ95
Or he can go hardcore and make working up text and edit sps,

But yea just start from scratch since the srl functions won't work unless the server is 100% like rs

I was following you're guide, just to get a basic idea of what to do. I just can't get it to do anything. And i don't think i know enough to make my own upText and edit the SPS :p

Thanks for the help everyone!

rj

2013-04-10 12:51:20

From: himynamesnoah
That moves the mouse over to the top left corner of the client.



This is the code i just tried:
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 2702913, 374, 171, 457, 237, 5) then
begin
Writeln('Found Color') // always use debug lines after if then statements to see whether it HAS been found.
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
SetupSRL;
MouseSpeed := 15;
ClickTree;
end.

It still doesn't do anything. This is all i get:
Compiled successfully in 702 ms.
SRL Compiled in 15 msec
Successfully executed.


I was following you're guide, just to get a basic idea of what to do. I just can't get it to do anything. And i don't think i know enough to make my own upText and edit the SPS :p

Thanks for the help everyone!


You appear to be making it search in a very small box did you use the color picker to find the boxed area to search?

himynamesnoah

2013-04-10 13:54:33

From: Officer Barbrady
You appear to be making it search in a very small box did you use the color picker to find the boxed area to search?

I'm really new to using Simba, and coding in general. How big should i be making the searching area? The color picker just gives me the coords of the color and the color.

t4q

2013-04-10 14:35:31

You can use
if FindColorTolerance(X, Y, 2702913, MSX1, MSY1, MSX2, MSY2, 5)
This searches whole main screen

and this line is right

mmouse(x, y,1,1);
wait(250);
but add some randomness for perfection
mmouse(x, y,2,2);
wait(250+random(100));

himynamesnoah

2013-04-10 16:49:49

From: t4q
You can use
if FindColorTolerance(X, Y, 2702913, MSX1, MSY1, MSX2, MSY2, 5)
This searches whole main screen

and this line is right

mmouse(x, y,1,1);
wait(250);
but add some randomness for perfection
mmouse(x, y,2,2);
wait(250+random(100));


Thanks for the help. The main problem right now is getting it to actually do something.
This is my code at the moment:
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 2572095, MSX1, MSY1, MSX2, MSY2, 5) then
begin
Writeln('Found Color') // always use debug lines after if then statements to see whether it HAS been found.
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
SetupSRL;
MouseSpeed := 15;
ClickTree;
end.

It just doesn't do anything, this is what it outputs:
Compiled successfully in 687 ms.
SRL Compiled in 0 msec
Successfully executed.

Thanks for all the help guys, but i guess with my limited knowledge i'm not going to be able to do this. Thanks anyway.

rj

2013-04-10 16:51:11

From: himynamesnoah
Thanks for the help. The main problem right now is getting it to actually do something.
This is my code at the moment:
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 2572095, MSX1, MSY1, MSX2, MSY2, 5) then
begin
Writeln('Found Color') // always use debug lines after if then statements to see whether it HAS been found.
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
SetupSRL;
MouseSpeed := 15;
ClickTree;
end.

It just doesn't do anything, this is what it outputs:
Compiled successfully in 687 ms.
SRL Compiled in 0 msec
Successfully executed.

Thanks for all the help guys, but i guess with my limited knowledge i'm not going to be able to do this. Thanks anyway.


Try taking out setup srl;

himynamesnoah

2013-04-10 17:00:47

From: Officer Barbrady
Try taking out setup srl;

Still nothing. It just compiles and says it successfully executed.

Sjoe

2013-04-10 17:03:01

From: himynamesnoah
Still nothing. It just compiles and says it successfully executed.


Use Mouse(0,0,0,0, true); See if it moves the left top corner of the client, (must be perfect) else there is an offset.
(there's a x -50, y -50 for Mainscreen coordinates due to the topbar on Eoc Runescape)

if that's fine then your colors and tolerance are wrong, pick new colors + a big higher tolerance.
And make sure the box u made is correct.

rj

2013-04-10 17:03:37

From: himynamesnoah
Still nothing. It just compiles and says it successfully executed.


Try picking a different color and is a higher tolerance

t4q

2013-04-10 17:13:20

Right now it just does one click if it finds the tree. You must add repeat and until to make it click more times
Also you need to make sure if you are just standing or you are cutting the tree
This is function that might come helpful
function iscutting: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 300);
end;
and adding repeat. Repeats clicking trees and waits while is cutting them until inventory is full
Begin
SetupSRL;
MouseSpeed := 15;
repeat
if not iscutting then
ClickTree;
wait(100+random(50));
until invfull
end.
And please use account which doesn't make you sad if it's gets banned while testing your scripts :D

himynamesnoah

2013-04-10 17:23:09

From: Sjoekeloe
Use Mouse(0,0,0,0, true); See if it moves the left top corner of the client, (must be perfect) else there is an offset.

if that's fine then your colors and tolerance are wrong, pick new colors + a big higher tolerance.


This is where it goes:

Also, i raised the tolerance to 10 and still nothing. So i raised it to 100:
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 2176052, MSX1, MSY1, MSX2, MSY2, 100) then
begin
Writeln('Found Color') // always use debug lines after if then statements to see whether it HAS been found.
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
ClickTree;
end.

Now it moves the mouse here:

The lowest tolerance i could get it to move the mouse at was 81, and it would move the mouse to the same spot as above. The spot it moves to is not even remotely close to the color i selected. I don't really understand how much the value changes for the tolerance, but atleast it moves the mouse now ;)

Sjoe

2013-04-10 17:25:06

100 tolerance…. LOL . It will basically find all colors.

try 10-15

himynamesnoah

2013-04-10 17:30:03

From: Sjoekeloe
100 tolerance…. LOL . It will basically find all colors.

try 10-15


Yea, i was just seeing if i could get it to do anything. It won't do anything at all unless it is 81+ tolerance. So it's having problems finding the color. Is there a good spot i should be getting colors from on willow trees?

t4q

2013-04-10 17:30:54

Have you selected your client? Use crosshair next to "Pick-a-color" thing and drag it on your client

himynamesnoah

2013-04-10 17:33:04

From: t4q
Have you selected your client? Use crosshair next to "Pick-a-color" thing and drag it on your client


Yes, i have.
And i found that removing SetupSRL; from this:
program ChopTree;
{$i srl/srl.simba}

begin
MouseSpeed := 15;
MMouse(0, 0, 0, 0);
end.

Will now make the mouse go exactly in the top left corner.

Sjoe

2013-04-10 17:49:09

From: himynamesnoah
Yes, i have.
And i found that removing SetupSRL; from this:
program ChopTree;
{$i srl/srl.simba}

begin
MouseSpeed := 15;
MMouse(0, 0, 0, 0);
end.

Will now make the mouse go exactly in the top left corner.


y-coordinates might be 20 to 50 off. Best way is to keep SetupSRL; and when u pick coordinates eg: 454,127 => deduct 20/50 : 454,87 (experiment on your own to see how much the offset is)

t4q

2013-04-10 17:59:26

From: himynamesnoah
This is where it goes:

Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 2176052, MSX1, MSY1, MSX2, MSY2, 100) then
begin
Writeln('Found Color') // always use debug lines after if then statements to see whether it HAS been found.
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
ClickTree;
end.

Now it moves the mouse here:



you need setupSRL; because you are using MSX1 etc to select area where to search color