SRL Archive - OSR Help

Needing Some Help With My First Script Please


AnonymousUser

2013-06-28 06:42:29

Hey, i am working on my first ever script " AnonymousNormals ". Where I can start the script at the Varrock West bank, walk to trees, until inv. Full, Go bank, Repeat. I have the path with sps and everything..

coming from Griff's tutorial on script down your first rs tree!:
(http://villavu.com/forum/showthread.php?t=44942)

I have started trying to use SPS, creating my path from Wolygon's path creator:
(http://villavu.com/forum/showthread.php?t=44942)

Here is what i have so far.

[PHP]program AnonymousNormals;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
FindNormalRandoms;
end;
end;
end;
Var
mypath:TPointArray;
begin
SPS_Areas := ['11_7','11_6','];
myPath := [Point(4529, 2832), Point(4505, 2802),
Point(4479, 2791), Point(4455, 2786), Point(4441, 2789)];


procedure ChopTree;
var x, y: integer;
begin
repeat
FindNormalRandoms;
if FindObj(x, y, 'hop', 1785912, 35) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
end;
repeat
wait(400+random(250));
AntiBan;
Until not IsUpText('ew') or (InvFull);
until(InvFull);
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
ChopTree;
end.[/PHP]

~AnonymousUser

Element17

2013-06-28 09:44:23

Why not just post your script? Can get more help and quicker.

Peanuts

2013-06-28 10:13:03

Do you have skype?

Add: PEANUTS123123

AnonymousUser

2013-06-28 10:56:19

There we go, i have added my script. I know it probably needs A LOT of work… that's why i wasn't going to add it here.

Peanuts

2013-06-28 19:38:37

From: AnonymousUser
There we go, i have added my script. I know it probably needs A LOT of work… that's why i wasn't going to add it here.


I fixed it and it now walks to the trees….
You had a few things in the wrong spot..

The variable for the SPS_PATH is set at the top of the script, above declare players.

Also you should use 'if not logged in then log in player' ( that will help it stop typing ur password / user in the game )

I changed a couple other things around too..

Yeah.. Ask any questions / paste anything if you need more help..
Maybe i didn't even help. :P

program AnonymousNormals;
{$DEFINE SMART8}
{$i srl/srl.simba}
{$i sps/sps.simba}

Var
mypath:TPointArray;

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
FindNormalRandoms;
end;
end;
end;



procedure ChopTree;
var x, y: integer;
begin
repeat
FindNormalRandoms;
if FindObj(x, y, 'hop', 1785912, 35) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
end;
repeat
wait(400+random(250));
AntiBan;
Until not IsUpText('ew') or (InvFull);
until(InvFull);
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;

SPS_Setup(RUNESCAPE_SURFACE, ['11_7','10_7','11_6','10_6']);
myPath := [Point(4529, 2832), Point(4505, 2802),
Point(4479, 2791), Point(4455, 2786), Point(4441, 2789)];


if not LoggedIn then
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH); // Set camera angle high
SPS_WalkPath(MyPath); // walks your path.
Fflag(0); // will wait for the flag to go from minimap before continuing.
ChopTree;
end.

AnonymousUser

2013-06-29 20:26:51

From: Peanuts
I fixed it and it now walks to the trees….
You had a few things in the wrong spot..

The variable for the SPS_PATH is set at the top of the script, above declare players.

Also you should use 'if not logged in then log in player' ( that will help it stop typing ur password / user in the game )

I changed a couple other things around too..

Yeah.. Ask any questions / paste anything if you need more help..
Maybe i didn't even help. :P

program AnonymousNormals;
{$DEFINE SMART8}
{$i srl/srl.simba}
{$i sps/sps.simba}

Var
mypath:TPointArray;

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
FindNormalRandoms;
end;
end;
end;



procedure ChopTree;
var x, y: integer;
begin
repeat
FindNormalRandoms;
if FindObj(x, y, 'hop', 1785912, 35) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
end;
repeat
wait(400+random(250));
AntiBan;
Until not IsUpText('ew') or (InvFull);
until(InvFull);
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;

SPS_Setup(RUNESCAPE_SURFACE, ['11_7','10_7','11_6','10_6']);
myPath := [Point(4529, 2832), Point(4505, 2802),
Point(4479, 2791), Point(4455, 2786), Point(4441, 2789)];


if not LoggedIn then
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH); // Set camera angle high
SPS_WalkPath(MyPath); // walks your path.
Fflag(0); // will wait for the flag to go from minimap before continuing.
ChopTree;
end.



How could i make it to where when the inv. is full, Sps to walk back to the bank, and bank? and if maybe rewalking centered to trees if wonders off to far?

Peanuts

2013-06-29 20:30:10

You can make the main loop something like this….


repeat

WalkToTrees;

[B]Repeat
chopTree;
until(InvFull)
[/B]

walktobank;
progressreport;
until(Finished)

You can put a timer to walk back to the trees if you havne't found a tree for a set amount of time.

look through the banking functions… plenty of stuff there.. otherwise TPA finding works pretty good for me..

AnonymousUser

2013-06-29 21:08:15

okay, sorry for all the questions! Just now trying to get a little money making script/wc. I'm really wanting to learn to script!

Peanuts

2013-06-29 21:25:24

From: AnonymousUser
okay, sorry for all the questions! Just now trying to get a little money making script/wc. I'm really wanting to learn to script!


That's okay man..
Over the last few months I've being learning to script and asking thousands of questions lol.. :p

I'm probably not the best at explaining things though ;p

By the way, are you using pixel shift?

its realllllly good for detecting if you're cutting a tree..

TUTORIAL: http://villavu.com/forum/showthread.php?t=74090

AnonymousUser

2013-06-30 01:36:00

From: Peanuts
That's okay man..
Over the last few months I've being learning to script and asking thousands of questions lol.. :p

I'm probably not the best at explaining things though ;p

By the way, are you using pixel shift?

its realllllly good for detecting if you're cutting a tree..

TUTORIAL: http://villavu.com/forum/showthread.php?t=74090


Thanks man i'll check it out! You mind if i PM you if i have a question?

Peanuts

2013-06-30 04:43:42

From: AnonymousUser
Thanks man i'll check it out! You mind if i PM you if i have a question?


Any time man.
Sometimes I vanish for 1-5 days though.
Usually pretty quick to respond though

I'm still learning though, might not be able to help with complex things.. xD