SRL Archive - Help

Very easy fix needed.


spin3x

2012-05-31 15:03:12

Guys I know this is probably an easy fix, but this is what I really find hard (The ending)
Code:
program Fungus;
var
time: integer;

Procedure ToBar;
var
x, y:Integer;
begin
if FindColorSpiralTolerance(x, y, 2190478, 556, 82, 723, 230, 5) then //bar
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
begin
if FindColorSpiralTolerance(x, y, 730719, 556, 82, 723, 230, 5) then // Plant
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
begin
if FindColorSpiralTolerance(x, y, 999777, 556, 82, 723, 230, 5) then //Swamp
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
begin
if FindColorSpiralTolerance(x, y, 2969405, 556, 82, 723, 230, 5) then //log
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
end;

begin
ToBar
repeat
ToBar;
until(false);
end.

Error: [Error] (40:6): Identifier expected at line 39
Compiling failed.

Runaway

2012-05-31 15:06:45

For every begin, you need an end. Also, you can just do:



begin
repeat
ToBar;
until(false);
end.

catanado15

2012-05-31 15:12:05

there are so many missing "end;" i recommend you to don't use begin before MoveMouse.. and MoveMouse is really bot-like…

Use Mouse(x, y, 0, 0, True/False);

Runaway

2012-05-31 15:19:07

I fixed your standards and made it smaller:


program Fungus;
{$i SRL/SRL.simba}
// be sure to include SRL!

var
time: Integer;

Procedure ToBar;
var
Colors: TIntegerArray;
i, x, y: Integer;
begin
Colors := [2190478, 730719, 999777, 2969405]; // put all of the colors into an array
for i := 0 to High(Colors) do
begin
if FindColorSpiralTolerance(x, y, Colors[i], 556, 82, 723, 230, 5) then // Colors[i] represents a single color
begin
{MoveMouse(x, y);
ClickMouse(x, y, 1);}
Mouse(x, y, 3, 3, mouse_left); // same as the above but less bot-like
FFlag(2); // waits until it's close to the MM flag until continuing
Wait(500+Random(500)); // randomness is good
end;
end;
end;

begin
MarkTime(time);
repeat
ToBar;
until(TimeFromMark(time) > (60 * 1000)); // 60 seconds
end.

spin3x

2012-05-31 15:49:54

It doesnt seem to do anything… The mouse just moves to the right by like a mm

Runaway

2012-05-31 15:59:28

Make sure SRL.simba is included:


{$i SRL/SRL.simba}

and also, you can use global coordinates for the minimap with your color-finding, like this:


if FindColorSpiralTolerance(x, y, Colors[i], MMX1, MMY1, MMX2, MMY2, 5) then

spin3x

2012-05-31 16:04:37

Umm I forgot to mention that this is for an rsps, if that makes a difference.

Recursive

2012-05-31 16:06:39

The only difference it makes is that you don't have to worry about using human-like movement. And basically play as a computer not human!

spin3x

2012-06-01 08:45:15

Can anyone trusted please tv me. Im having trouble, like I said aboce, when I click run the mouse just moves slowly to the right.

spin3x

2012-06-01 09:13:40

Any idea why this isnt doing anything? I select my rsps client using the cross hair, press run and doesnt do anything (Script is running)

program SPSTut;
{$i srl/srl.simba}
{$i sps/sps.simba}
Var
myPath:TPointArray;
begin
SetupSRL;
SPS_Setup(RUNESCAPE_SURFACE,['14_6']);//SPS Areas
myPath := [Point(215, 341), Point(212, 316), Point(177, 331), Point(156, 348), Point(146, 377), Point(125, 399), Point(131, 422)];//Path
SPS_WalkPath(myPath);
end.

begin
MarkTime(time);
until(false)
end.

John

2012-06-01 09:37:54

Umm, Are you sure you have the RSPS Client targeted with simba using this thing:

spin3x

2012-06-01 11:39:15

Yh, Im pretty sure. Im just wondering that it might be the actual code. Im still new to this. Does sps walking work with rsps? The rsps is a 714 source meaning it looks exactly like rs.

I dont understand what is wrong with thise:
program Fungus;
var
time: integer;

Procedure ToBar;
var
x, y, Time:Integer;
begin
if FindColorSpiralTolerance(x, y, 2190478, 518, 1, 716, 165, 5) then //bar
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
begin
if FindColorSpiralTolerance(x, y, 730719, 518, 1, 716, 165, 5) then // Plant
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
begin
if FindColorSpiralTolerance(x, y, 999777, 518, 1, 716, 165, 5) then //Swamp
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
begin
if FindColorSpiralTolerance(x, y, 2969405, 518, 1, 716, 165, 5) then //log
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
end;

begin

until(false)
end.

CephaXz

2012-06-01 11:58:37

For every begin, you need an end. I thought that is answered. If your mouse is slow, try putting SetupSRL in your main loop before everything else. Or just set your mouse speed. I believe normal setupsrl mouse speed is 15.

MouseSpeed := 15;

spin3x

2012-06-01 13:00:32

Ok so I think I had it and then got an error on the Until

program Fungus;
var
time: integer;

Procedure ToBar;
var
x, y, Time:Integer;
begin
if FindColorSpiralTolerance(x, y, 2190478, 518, 1, 716, 165, 5) then //bar
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
end;
begin
if FindColorSpiralTolerance(x, y, 730719, 518, 1, 716, 165, 5) then // Plant
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
end;
begin
if FindColorSpiralTolerance(x, y, 999777, 518, 1, 716, 165, 5) then //Swamp
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
end;
begin
if FindColorSpiralTolerance(x, y, 2969405, 518, 1, 716, 165, 5) then //log
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
Wait(2000);
end;

begin
ToBar
until (false); //line 39
end.

[Error] (40:4): Identifier expected at line 39
Compiling failed.

CephaXz

2012-06-01 13:10:39

You got 9 begins, and only 5 ends.

And basically, all the solutions needed are already posted on this thread, just that you didn't read them?

Runaway

2012-06-01 13:28:46

From: CephaXz
You got 9 begins, and only 5 ends.

And basically, all the solutions needed are already posted on this thread, just that you didn't read them?


Yeah… take a look at the code I posted. It's (Length(your code) / 2) + speed.

spin3x

2012-06-01 14:21:42

The only reason why I tried to do it again is because when I use your code, whenever I click start and move my mouse anywhere, it just keeps moving by like a mm to a direction.

Thats why I asked if someone can tv me, I wanted to show what its doing.

CephaXz

2012-06-01 14:26:34

You need to put in
SetupSRL;

Try reading the posts again, I already answered the solution to your problem.

spin3x

2012-06-01 14:51:35

Omgf sorry for not reading your thread :S I feel stupid. That fixed the problem :) Thank you so much.

Im truly sorry if I'm annoying or irritating but I really want to learn

Thank you both :) :) Reped