SRL Archive - General

Need little bit help.


Failure

2010-11-19 01:41:46

Recently I started making "Scripts" (Can't really say that but its a start) so yes it's basic only thing what messes up is, when I run it (It's for a Runescape Private Server Though) works fine and all. But then comes a server restart and it wont login cause I don't know how to. So to make a big story little…

When I FindColor(xxxx rest of code) it clicks on a tree, i'm a beginner and just have one big messy loop, so if I add to click on login, it clicks ingame. How can I get 2 seperate lines if it finds LogOut color it will login then wait for the tree?

My Code

program DeltaScapeAutoCutterFletcherAndDropper;

var
x, y: Integer;




begin
repeat
if FindColor (x, y, 9615544, 145, 181, 294, 300)then
MoveMouseSmooth(x, y);
Wait(200+random(300));
ClickMouse(x, y, True);
Wait(100);
ClickMouse(x, y, True);
Wait(300);
ClickMouse(x, y, True);
Wait(38000+random(2000));
// Clicked Tree waiting till inventory is full.

MoveMouseSmooth(584, 228);
Wait(130+random(120));
ClickMouse(584, 228, True);
Wait(150+random(100));
MoveMouseSmooth(670+random(10), 227+random(10));
Wait(150+random(120));
ClickMouse(670+random(10), 227+random(10), True);
Wait(160+random(333));

MoveMouseSmooth(584, 228);
Wait(130+random(120));
ClickMouse(584, 228, True);
Wait(150+random(100));
MoveMouseSmooth(670+random(10), 227+random(10));
Wait(150+random(120));
ClickMouse(670+random(10), 227+random(10), True);
Wait(160+random(333));

//Replace with Shortbows
MoveMouseSmooth(358+random(10), 418+random(8));
Wait(90+random(100));
ClickMouse(358+random(5), 418+random(5), False);
Wait(90+random(100));
MoveMouseSmooth(358+13, 418+33);
Wait(120+random(130));
MoveMouseSmooth(363, 452);
Wait(120+random(80));
ClickMouse(363, 452, True);
MoveMouseSmooth(358+random(10), 418+random(8));
Wait(90+random(100));
ClickMouse(358+random(5), 418+random(5), False);
Wait(90+random(100));
MoveMouseSmooth(358+13, 418+33);
Wait(120+random(130));
MoveMouseSmooth(363, 452);
Wait(120+random(80));
ClickMouse(363, 452, True);
Wait(50000+random(1000));
//Used Knife on Logs picked "LongBow"


MoveMouseSmooth(669, 227); //Moving to Bow
Wait(110+random(40));
ClickMouse(669, 227, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(669, 227+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(669, 227+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(669, 227); //Moving to Bow
Wait(110+random(40));
ClickMouse(669, 227, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(669, 227+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(669, 227+41, True); //Clicking Drop
Wait(60+random(30));


MoveMouseSmooth(710, 228); //Moving to Bow
Wait(110+random(40));
ClickMouse(710, 228, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(710, 228+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(710, 228+41, True); //Clicking Drop
Wait(60+random(30)); //DONE

MoveMouseSmooth(584, 264); //Moving to Bow
Wait(110+random(40));
ClickMouse(584, 264, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(584, 264+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(584, 264+41, True); //Clicking Drop
Wait(60+random(30)); //DONE

MoveMouseSmooth(628, 263); //Moving to Bow
Wait(110+random(40));
ClickMouse(628, 263, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(628, 263+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(628, 263+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(669, 263); //Moving to Bow
Wait(110+random(40));
ClickMouse(669, 263, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(669, 263+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(669, 263+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(713, 264); //Moving to Bow
Wait(110+random(40));
ClickMouse(713, 264, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(713, 264+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(713, 264+41, True); //Clicking Drop
Wait(60+random(30)); //DONE

MoveMouseSmooth(586, 302); //Moving to Bow
Wait(110+random(40));
ClickMouse(586, 302, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(586, 302+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(586, 302+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(628, 304); //Moving to Bow
Wait(110+random(40));
ClickMouse(628, 304, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(628, 304+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(628, 304+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(669, 301); //Moving to Bow
Wait(110+random(40));
ClickMouse(669, 301, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(669, 301+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(669, 301+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(710, 299); //Moving to Bow
Wait(110+random(40));
ClickMouse(710, 299, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(710, 299+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(710, 299+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(584, 335); //Moving to Bow
Wait(110+random(40));
ClickMouse(584, 335, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(584, 335+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(584, 335+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(627, 336); //Moving to Bow
Wait(110+random(40));
ClickMouse(627, 336, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(627, 336+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(627, 336+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(669, 338); //Moving to Bow
Wait(110+random(40));
ClickMouse(669, 338, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(669, 338+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(669, 338+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(710, 337); //Moving to Bow
Wait(110+random(40));
ClickMouse(710, 337, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(710, 337+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(710, 337+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(585, 374); //Moving to Bow
Wait(110+random(40));
ClickMouse(585, 374, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(585, 374+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(585, 374+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(626, 374); //Moving to Bow
Wait(110+random(40));
ClickMouse(626, 374, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(626, 374+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(626, 374+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(667, 370); //Moving to Bow
Wait(110+random(40));
ClickMouse(667, 370, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(667, 370+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(667, 370+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(710, 372); //Moving to Bow
Wait(110+random(40));
ClickMouse(710, 372, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(710, 372+41); //Moving to Drop
Wait(120+random(40));
ClickMouse(710, 372+41, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(584, 409); //Moving to Bow
Wait(110+random(40));
ClickMouse(584, 409, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(584, 409+12); //Moving to Drop
Wait(120+random(40));
ClickMouse(584, 409+12, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(625, 408); //Moving to Bow
Wait(110+random(40));
ClickMouse(625, 408, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(625, 408+12); //Moving to Drop
Wait(120+random(40));
ClickMouse(625, 408+12, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(668, 409); //Moving to Bow
Wait(110+random(40));
ClickMouse(668, 409, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(668, 409+12); //Moving to Drop
Wait(120+random(40));
ClickMouse(668, 409+12, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(710, 408); //Moving to Bow
Wait(110+random(40));
ClickMouse(710, 408, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(710, 408+12); //Moving to Drop
Wait(120+random(40));
ClickMouse(710, 408+12, True); //Clicking Drop
Wait(60+random(30));


// Not sure if work!




MoveMouseSmooth(583, 446); //Moving to Bow
Wait(110+random(40));
ClickMouse(583, 446, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(583, 446-15); //Moving to Drop
Wait(120+random(40));
ClickMouse(583, 446-15, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(627, 443); //Moving to Bow
Wait(110+random(40));
ClickMouse(627, 443, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(627, 443-15); //Moving to Drop
Wait(120+random(40));
ClickMouse(627, 443-15, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(667, 445); //Moving to Bow
Wait(110+random(40));
ClickMouse(667, 445, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(667, 445-15); //Moving to Drop
Wait(120+random(40));
ClickMouse(667, 445-15, True); //Clicking Drop
Wait(60+random(30));

MoveMouseSmooth(709, 446); //Moving to Bow
Wait(110+random(40));
ClickMouse(709, 446, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(709, 446-15); //Moving to Drop
Wait(120+random(40));
ClickMouse(709, 446-15, True); //Clicking Drop
Wait(60+random(30));
MoveMouseSmooth(647, 186);
Wait(100+random(30));
ClickMouse(647, 186, True);
Wait(200);








Until false;

end.

Yes I tried to help myself with // Pretty much messy also I gotta clean my Script soon lol.
Also why do people use like this
MoveMouseSmooth(667, 445); //Moving to Bow
Wait(110+random(40));
ClickMouse(667, 445, False); //Right Click Bow prepare for "Drop"
Wait(110+random(40));
MoveMouseSmooth(667, 445-15); //Moving to Drop
Wait(120+random(40));
ClickMouse(667, 445-15, True); //Clicking Drop

With the spaces thank you for helping! :)

TomTuff

2010-11-19 01:45:46

I guess it's a start. Also, you only need 1 block of your loop instead of many over and over. At the end of every loop, check if it's logged in. If not, then log back in. I'm not sure how you could do this on this specific private server, but in the normale RuneScape client there's a function in SRL (LoggedIn). So if it were normal RS, it would be
if not(LoggedIn) then
Login; //Standards ;)

Runescape Pro

2010-11-19 01:52:59

If you mean like this("X" will be the space):
ClickMouse(666,X666,XFalse);

It just makes the code look neater. It's also easier to read. As for the log in trouble:

If FindColor(the logged out color, w/e, w/e) Then
Begin
Mouse(666, 666, 0, 0, True);//Rights clicks the box where your username goes.
TypeSend('jbeifbuweyhf');//Or w/e other typing function.
Click the pass text box
TypeSend('jbifbyef');
Repeat
Wait(25+Random(25));
Until(FindColor(tree color, the X of the color, the Y of the color,blablabla);

Then you continue with the chopping and fletching. Hope that helps.


@Tom: I'm pretty sure that won't work for a private server. They are totally different. But the advice will lead him into real rs scripting.

@Failure: You should learn to make procedures and functions. Seeing if your logged in can be easily made into a function. The tree chopping and fletching could be two separate procedures. If you want an example for help, just ask. :)

Failure

2010-11-19 02:07:19

From: Runescape Pro
If you mean like this("X" will be the space):
ClickMouse(666,X666,XFalse);

It just makes the code look neater. It's also easier to read. As for the log in trouble:

If FindColor(the logged out color, w/e, w/e) Then
Begin
Mouse(666, 666, 0, 0, True);//Rights clicks the box where your username goes.
TypeSend('jbeifbuweyhf');//Or w/e other typing function.
Click the pass text box
TypeSend('jbifbyef');
Repeat
Wait(25+Random(25));
Until(FindColor(tree color, the X of the color, the Y of the color,blablabla);

Then you continue with the chopping and fletching. Hope that helps.


@Tom: I'm pretty sure that won't work for a private server. They are totally different. But the advice will lead him into real rs scripting.

@Failure: You should learn to make procedures and functions. Seeing if your logged in can be easily made into a function. The tree chopping and fletching could be two separate procedures. If you want an example for help, just ask. :)


Hahah I know, but we all started with this crap instead of that didn't we? I'll try it out if I can figure it out in the messy Script :D!
Also little question, everytime I log out and then run the Script it goes to left corner due Color how do I fix that so I can bot continuesly.


Quess I messed up…

begin


repeat


If FindColor(x, y, 3879730, 393, 274, 533, 311) Then
Begin
MoveMouseSmooth(453, 294);
Wait(100);
ClickMouse(452, 294, True);
Wait(1000);
MoveMouseSmooth(302, 324);
Wait(1000);
ClickMouse(302, 324, True);
Wait(8000);


Repeat
Wait(25+Random(25));
Until(FindColor(x, y, 8894648, 191, 165, 260, 215));

MoveMouseSmooth(x, y);
Wait(200+random(300));
ClickMouse(x, y, True);
Wait(100);
ClickMouse(x, y, True);
Wait(300);
ClickMouse(x, y, True);
Wait(38000+random(2000));
// Clicked Tree waiting till inventory is full.

Error : Line 340: [Error] (340:1): Identifier expected in script C:\Program Files\SCAR 3.22\Scripts\Deltascape Woodcutter+Fletcher+Dropper.scar

Line 340 Until false;

Runescape Pro

2010-11-19 02:34:38

You most likely did not put an end for the "If FindColor(x, y, 3879730, 393, 274, 533, 311) Then
Begin"

Failure

2010-11-19 02:41:16

Ahh SCAR must give the exact errors lol this is driving me nuts…

If FindColor(x, y, 3879730, 393, 274, 533, 311) Then
Begin
MoveMouseSmooth(453, 294);
Wait(100);
ClickMouse(452, 294, True);
Wait(1000);
MoveMouseSmooth(302, 324);
Wait(1000);
ClickMouse(302, 324, True);
Wait(8000);

repeat
Wait(25+Random(25));
Until (FindColor(x, y, 8894648, 191, 165, 260, 211) then

Might you can fix it?

Error ; Line 25: [Error] (25:53): Closing parenthesis expected in script C:\Program Files\SCAR 3.22\Scripts\Deltascape Woodcutter+Fletcher+Dropper.scar

TomTuff

2010-11-19 03:13:11

If FindColor(x, y, 3879730, 393, 274, 533, 311) Then
begin
MoveMouseSmooth(453, 294);
Wait(100);
ClickMouse(452, 294, True);
Wait(1000);
MoveMouseSmooth(302, 324);
Wait(1000);
ClickMouse(302, 324, True);
Wait(8000);
[B][I][U]end;[/U][/I][/B]

repeat
Wait(25+Random(25));
Until (FindColor(x, y, 8894648, 191, 165, 260, 211) then

Failure

2010-11-19 03:28:22

That worked Tom, but then I felt on a other error I think if someone would fix it would be nice might take some time. But I'm gonna take a break might just re-write my shitty Script. Before that I gotta learn about Procedures and Functions.

TomTuff

2010-11-19 03:38:38

From: Failure
That worked Tom, but then I felt on a other error I think if someone would fix it would be nice might take some time. But I'm gonna take a break might just re-write my shitty Script. Before that I gotta learn about Procedures and Functions.


they're quite simple.

procedures can be used in other parts of the script. They're used to prevent two things: clutter and repetitiveness. let's say you have this procedure (totally made up):

procedure SampleProcedure;
var
x, y, i: integer;
TPA: TPointArray;
begin
TPA := FindColorsSpiralTolerance(TPA, x, y, 798223, MSX1, MSY1, MSX2, MSY2);
for i := 0 to length(TPA) do
begin
//stuff
end;
end;

it can be called on in the future in a single line.

functions return a result, such as a string, integer, or boolean.

function SampleFunction: string; // the : type; portion tells what type the function returns
begin
case Random(2) of
0: Result := 'we rolled a 1';
1: Result := 'we rolled a 1';
2: Result := 'we rolled a 1';
end;
end;

begin
Writeln(SampleFunction);
end.

see?

i luffs yeww

2010-11-19 03:42:48

"Until (FindColor(x, y, 8894648, 191, 165, 260, 211) then"

you need another ) before then.