SRL Archive - First Scripts

Draynor Willows[1st Script] NEED HELP!


Edgeeawaits

2012-04-19 17:20:40

I keep getting an error saying that i need to put a colon, but I'm following a video and my script is typed out the exact way the person in the video is typing his out, Help please? :)

NumberOfPlayers:(NumbOfPlayers); 
CurrentPlayer := StartPlayer;
for i := to NumbOfPlayers-1 do
Players[1].BoxRewards := ['XP', 'oins']


It's the line that says CurrentPlayer := StartPlayer; that is giving me problems

NKN

2012-04-19 22:04:29

Change CurrentPlayer to 0. First player should always be 0, then the next 1, and so on.

Silentcore

2012-04-19 22:31:50

From: NKN
Change CurrentPlayer to 0. First player should always be 0, then the next 1, and so on.


Yeah, first player should be player[0].

NKN

2012-04-19 22:32:35

I feel like you just copied what I said to get your post count up. Would that count as spamming?

Silentcore

2012-04-19 22:36:58

From: NKN
I feel like you just copied what I said to get your post count up. Would that count as spamming?


If I'm not mistaken you put: put player to 0.
While I said it more especifically: player[0].
see the difference?

NKN

2012-04-19 22:46:36

Not really…. because it should be:

CurrentPlayer := 0;
So you're wrong, if not using multiplayer, I think.

Silentcore

2012-04-19 22:55:31

From: NKN
Not really…. because it should be:

CurrentPlayer := 0;
So you're wrong, if not using multiplayer, I think.

Wouldn't that be in declare player, if I'm not mistaken his code is not declare player and the last line has player[1], which has to be changed to player[0].
Am I wrong or right?

NKN

2012-04-19 22:57:17

So his code is wrong, and we've both been arguing over something wrong? -facepalm-

Silentcore

2012-04-19 23:13:12

Isn't supposed to be:

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['XP'];

With Players[0] do
begin
Name := ''; //Username.
Pass := ''; //Password.
Active := True;
end;

Edgeeawaits

2012-04-20 12:06:39

Thats guys :)
I've got another problem now, im just starting out so i might get annoying with all the problems i get :p anyway

Procedure AntiBan;
Begin
Case Random(250);
0: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('Woodcutting', False) GameTab(28) End;
1: Begin StatsGuise('AntiBan') SleepAndMoveMouse(7000 + Random(500)); End;
2: Begin StatsGuise('AntiBan') GameTab(tab_Inv); ExamineInv; GameTab(28); End;
3: Begin StatsGuise('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats) Wait(3000 + Random(500)); GameTab(28) End;
5: Begin StatsGuise('AntiBan') GameTab(Tab_Stats) HoverSkill('random', False); GameTab(28) End;

the debug box says 'OF' is expented at like 63 (AntiBan 0)

NKN

2012-04-20 12:11:33

 Case Random(250) of 

Don't use a semicolon.

Edgeeawaits

2012-04-20 13:24:12

Thanks :)
now another problem :/ The mouse goes to the tree and doesnt say anything when it gets there and moves arround the tree randomly,

Program PowerChopper;
//{$DEFINE SMART}
{$i srl/srl.simba}


Const
SRLStats_Username = '';
SRLStats_Passworld = '';
BreakEvery = '600';
BreakFor = '5';
Version = '1.0';
NumbOfPlayers = 1;
StartPlayer = 0;


Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Woodcutting;
Active := True;
end;
end;



Procedure StatGuise(wat: String);
Begin
Status(wat);
Disguise(wat);
End;

procedure Antiban;
begin
case Random(60)of
10: RandomRClick;
20: HoverSkill('Strength', False);
30: PickUpMouse;
40: RandomMovement;
50: BoredHuman;
59: ExamineInv;
end;
end;
Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
TerminateScript;
End;

Function ChopDown: Boolean;
Var
x, y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x, y, ['Chop','down', 'p d'], [1715243, 1252891, 2307895, 1252891], 3) Then
Writeln('Hooray, we found a tree!');
End;

Begin
ClearDebug;
SetupSRL;
DeclarePlayers;
Repeat
ChopDown
Until(false);
End.

That's the full script so you can try and see for yourself the exact problem

Silentcore

2012-04-20 13:56:15

From: Edgeeawaits
Thanks :)
now another problem :/ The mouse goes to the tree and doesnt say anything when it gets there and moves arround the tree randomly,

Program PowerChopper;
//{$DEFINE SMART}
{$i srl/srl.simba}


Const
SRLStats_Username = '';
SRLStats_Passworld = '';
BreakEvery = '600';
BreakFor = '5';
Version = '1.0';
NumbOfPlayers = 1;
StartPlayer = 0;


Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Woodcutting;
Active := True;
end;
end;



Procedure StatGuise(wat: String);
Begin
Status(wat);
Disguise(wat);
End;

procedure Antiban;
begin
case Random(60)of
10: RandomRClick;
20: HoverSkill('Strength', False);
30: PickUpMouse;
40: RandomMovement;
50: BoredHuman;
59: ExamineInv;
end;
end;
Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
TerminateScript;
End;

Function ChopDown: Boolean;
Var
x, y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x, y, ['Chop','down', 'p d'], [1715243, 1252891, 2307895, 1252891], 3) Then
Writeln('Hooray, we found a tree!');
End;

Begin
ClearDebug;
SetupSRL;
DeclarePlayers;
Repeat
ChopDown
Until(false);
End.

Dont you need something like this, its not the code but an example ok.

Procedure WalkToTree;

Var
ToTrees:TPointArray;

Begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;

Writeln('Attempting To Walk To Trees...')
SetupSRL;
SPS_Areas := ['10_9'];
ToTrees:= [Point(4209, 3686), Point(4190, 3735)];
SPS_WalkPath(ToTrees);

Writeln('Found the trees');
Wait(5354+random(254));
End;

……Sorry but this is a really bad example….

NKN

2012-04-20 14:04:24

Make sure the Uptext is perfect, it has to be EXACTLY typed out, capitals and all.

So if it was "Chop" I would put "hop"


Edit:
By exactly, I meant the capital letters and spaces.

Silentcore

2012-04-20 14:21:00

From: NKN
Make sure the Uptext is perfect, it has to be EXACTLY typed out, capitals and all.

So if it was "Chop" I would put "hop"


yeah the uptext is also important.

tehq

2012-04-20 14:25:53

From: Ucantseemebot


Dont you need something like this, its not the code but an example ok.

Procedure WalkToTree;

Var
ToTrees:TPointArray;

Begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;

Writeln('Attempting To Walk To Trees...')
SetupSRL;
SPS_Areas := ['10_9'];
ToTrees:= [Point(4209, 3686), Point(4190, 3735)];
SPS_WalkPath(ToTrees);

Writeln('Found the trees');
Wait(5354+random(254));
End;


You didn't setup SPS and you shouldn't be setting up SRL there and it has very bad standards.. bad example :(

Abu

2012-04-20 14:29:29

From: NKN
Make sure the Uptext is perfect, it has to be EXACTLY typed out, capitals and all.

So if it was "Chop" I would put "hop"


That doesn't make sense. You told him to write it out EXACTLY with with required capitals and then wrote 'hop' as your example :confused:

Silentcore

2012-04-20 14:30:21

From: tehq
You didn't setup SPS and you shouldn't be setting up SRL there and it has very bad standards.. bad example :(


yeah i noticed the bad example when i posted. sorry.

NKN

2012-04-20 14:36:32

From: abu_jwka
That doesn't make sense. You told him to write it out EXACTLY with with required capitals and then wrote 'hop' as your example :confused:


I meant the capital letters/stuff, not the whole word. D:

-runs- Don't judge me!

Edgeeawaits

2012-04-20 16:51:40

Identifier expected at line 83
Compiling failed.

Line 83 is the end of my script where it says end. i dont know why im getting this problem, you guys have been very helpful tho :) maybe help me out once more? :)

Function ChopDown: Boolean;
Var
x, y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x, y, ['hop','down', 'p d'], [1318686, 1450785, 923159, 924954], 3) Then
Begin
Writeln('Hooray, we found a tree!');
GetMousePos(x, y);
Case Random(2) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
WaitOption('Chop', 500);
End;
End;

Begin
ClearDebug;
SetupSRL;
DeclarePlayers;
Repeat
ChopDown;
Until(false);
end.

The last line is the error, im putting this section of the code just incase something above is messing it up. the full code is listed on an earlier post

Abu

2012-04-20 16:54:03

You are missing out an end in your ChopDown procedure.

Please do not continue to post every error you get here. Part of learning to script is being able to recognise and solve these issues yourself. I certainly don't remember asking for help like this when making my first script because I always tried to be independent.

There's nothing wrong with asking for help, just don't rely on others too much ;)

Edgeeawaits

2012-04-20 17:00:23

Thanks for the help! Got it working now, ill try to be more independent in the future, the help was much appereciated :)

Silentcore

2012-04-20 17:03:11

From: Edgeeawaits
Thanks for the help! Got it working now, ill try to be more independent in the future, the help was much appereciated :)


Well i'm glad you finished it and an advice for you is: take a look around at some threads where ppl post errors and see how they solve it. GJ'

Edgeeawaits

2012-04-20 17:13:17

From: Ucantseemebot
Well i'm glad you finished it and an advice for you is: take a look around at some threads where ppl post errors and see how they solve it. GJ'


Will do, thanks for all your help :)

Edgeeawaits

2012-04-20 17:28:00

Lol, or apperantly I didnt get it working, cool. Not going to ask for help on this one unless I cant get it after a few hours ;)