SRL Archive - FAQ

Error when Compiling script (Trying to follow YoHoJoSRL youtube Guide)


melkoo

2013-03-09 15:39:03

So I decided I wanted to learn to script and code, and gave it a go, I've been watching YoHoJoSRL videos and following along and everything has gone great up until this point.

Here is the video I am currently at:

[video=youtube_share;qfumZWrm_DE]http://youtu.be/qfumZWrm_DE[/video]

If you look at 18 minutes he tries to compile the script but he didnt do something with the progress report, however when I try and compile the script I get this error instead:


Exception in Script: Unknown compiler directives at 5:3

I did some searching and people are saying its the "Anti Leech dont ask about it" so I figured i wrote something wrong, but I cant figure out what.

Here is what I've written so far.

program PowerChopper;
{$DEFINE SMART8}
{$i SRL\SRL.simba}
{$1 SRL\SRL\Misc\Stats.simba}

Const
SRLStats_Username = '';// Your SRL Stats Username
SRLSTats_Password = '';// Your SRL Stats Password
BreakEvery = 120; //How many minutes to break after
Breakfor = 5; //How long to break for
Version = '1.0';
NumberOfPlayerss = 1; //How many players you are using
StartPlayer = 0; //Player to start auting with (0 means first char)

Procedure DeclarePlayers;
var i:integer;
begin
NumberOfPLayers(NumbOfPlayers);
CurrentPLayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player Password.
Active := True;
Integers[1] := 4; //1=BrightCopper, 2=DarkCopper, 3=Tin, 4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
end;
end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
end;

Function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean) :Boolean;
Begin
MMouse (x, y, 5, 5);
If WaitUptext (UpText, 1500+Random(500)) Then
Begin
Result:=True;
GetMousePos (x, y);
If RClick Then
Begin
Mouse (x, y, 0, 0, False);
Result := WaitOption (Option, 2000);
If Result then FFlag (0);
End Else
Begin
Mouse (x, y, 0, 0, True);
Wait (100+Random(50));
FFlag(0);
End;
End;
End;

Procedure Antiban;
Begin
Case Random(250) of
0: Begin StatsGuise ('AntiBan') Gametab(tab_Stats) Hoverskill('Woodcut', 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;
End;
End;

Procedure Failsafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
ProgressReport;
TerminateScript;
End;

Function Chopdown:Boolan;
Var
X, Y, Integer;
Begin

If FindObjectCustom(X, Y, ['Chop', 'Down'], [3627896, 3166827, 3627896], 30) Then
WriteLn ('This is the start of something Great!');
end;


begin
SetupSRL;
DeclarePlayers;
Repeat
ChopDown
Until(False);
end.

Also another thing that bugs me is that not all my Procedures are in the Function list. I'll provide a pic:

[ATTACH=CONFIG]19807[/ATTACH]

I'm sorry if I posted this in the wrong section, any help is appreciated.

Thanks in Advance

-Melk

Sjoe

2013-03-09 16:06:13

Check this line, there is something off about it: {$1 SRL\SRL\Misc\Stats.simba}
compare it to this {$I SRL/SRL.simba}

There are some other compiling issues, but you should be able to find those.

And I have no idea why it doesn't show up on your function list :p
Because it does on mine.

melkoo

2013-03-09 16:17:47

From: Sjoekeloe
Check this line, there is something off about it: {$1 SRL\SRL\Misc\Stats.simba}
compare it to this {$I SRL/SRL.simba}

There are some other compiling issues, but you should be able to find those.

And I have no idea why it doesn't show up on your function list :p
Because it does on mine.


Ahh, thankyou,

I've got another problem now though



Exception in Script: Unable to find file 'SRL\SRL\Misc\Stats.simba' used from 'C:\Simba\Scripts\powerchopper.simba'

Did some searching and my SRL and SPS is updated.



program PowerChopper;
{$DEFINE SMART8}
{$i SRL\SRL.simba}
{$i SRL\SRL\Misc\Stats.simba}

Const
SRLStats_Username = '';// Your SRL Stats Username
SRLSTats_Password = '';// Your SRL Stats Password
BreakEvery = 120; //How many minutes to break after
Breakfor = 5; //How long to break for
Version = '1.0';
NumberOfPlayerss = 1; //How many players you are using
StartPlayer = 0; //Player to start auting with (0 means first char)

Procedure DeclarePlayers;
var i:integer;
begin
NumberOfPLayers(NumbOfPlayers);
CurrentPLayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player Password.
Active := True;
Integers[1] := 4; //1=BrightCopper, 2=DarkCopper, 3=Tin, 4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
end;
end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
end;

Function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean) :Boolean;
Begin
MMouse (x, y, 5, 5);
If WaitUptext (UpText, 1500+Random(500)) Then
Begin
Result:=True;
GetMousePos (x, y);
If RClick Then
Begin
Mouse (x, y, 0, 0, False);
Result := WaitOption (Option, 2000);
If Result then FFlag (0);
End Else
Begin
Mouse (x, y, 0, 0, True);
Wait (100+Random(50));
FFlag(0);
End;
End;
End;

Procedure Antiban;
Begin
Case Random(250) of
0: Begin StatsGuise ('AntiBan') Gametab(tab_Stats) Hoverskill('Woodcut', 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;
End;
End;

Procedure Failsafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
ProgressReport;
TerminateScript;
End;

Function Chopdown:Boolan;
Var
X, Y, Integer;
Begin

If FindObjectCustom(X, Y, ['Chop', 'Down'], [3627896, 3166827, 3627896], 30) Then
WriteLn ('This is the start of something Great!');
end;


begin
SetupSRL;
DeclarePlayers;
Repeat
ChopDown
Until(False);
end.

Sjoe

2013-03-09 16:21:35

From: melkoo
Ahh, thankyou,

I've got another problem now though



Exception in Script: Unable to find file 'SRL\SRL\Misc\Stats.simba' used from 'C:\Simba\Scripts\powerchopper.simba'

Just remove the line: {$i SRL\SRL\Misc\Stats.simba}
Doesn't matter lol, it's there for show imo :p

melkoo

2013-03-09 16:32:04

Compiled successfully in 530 ms.

Yay! Thank you so much for your help!

Here is the finished code in case you want to look it over.


program PowerChopper;
{$DEFINE SMART8}
{$i SRL\SRL.simba}

Const
SRLStats_Username = '';// Your SRL Stats Username
SRLSTats_Password = '';// Your SRL Stats Password
BreakEvery = 120; //How many minutes to break after
Breakfor = 5; //How long to break for
Version = '1.0';
NumbOfPlayers = 1; //How many players you are using
StartPlayer = 0; //Player to start auting with (0 means first char)

Procedure DeclarePlayers;
var i:integer;
begin
NumberOfPLayers(NumbOfPlayers);
CurrentPLayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player Password.
Active := True;
Integers[1] := 4; //1=BrightCopper, 2=DarkCopper, 3=Tin, 4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
end;
end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
end;

Function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean) :Boolean;
Begin
MMouse (x, y, 5, 5);
If WaitUptext (UpText, 1500+Random(500)) Then
Begin
Result:=True;
GetMousePos (x, y);
If RClick Then
Begin
Mouse (x, y, 0, 0, False);
Result := WaitOption (Option, 2000);
If Result then FFlag (0);
End Else
Begin
Mouse (x, y, 0, 0, True);
Wait (100+Random(50));
FFlag(0);
End;
End;
End;

Procedure Antiban;
Begin
Case Random(250) of
0: Begin StatsGuise ('AntiBan') Gametab(tab_Stats) Hoverskill('Woodcut', 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;
End;
End;

Procedure Failsafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;

Function Chopdown:Boolean;
Var
X, Y: Integer;
Begin

If FindObjCustom(X, Y, ['Chop', 'Down'], [3627896, 3166827, 3627896], 30) Then
WriteLn ('This is the start of something Great!');
end;


begin
SetupSRL;
DeclarePlayers;
Repeat
ChopDown
Until(False);
end.

Sjoe

2013-03-09 16:35:20

From: melkoo
Compiled successfully in 530 ms.

Yay! Thank you so much for your help!

Here is the finished code in case you want to look it over.



Well done !

Don't forget to implement your check and click, antiban and failsafe procedures into the script though.
I only see Chopdown in the mainloop.

melkoo

2013-03-09 16:40:58

From: Sjoekeloe
Well done !

Don't forget to implement your check and click, antiban and failsafe procedures into the script though.
I only see Chopdown in the mainloop.


Yeah, Im not done yet, Still like 30 minutes left of this tutorial video!

Sjoe

2013-03-09 16:42:13

From: melkoo
Yeah, Im not done yet, Still like 30 minutes left of this tutorial video!


Ooh it's on his video tutorial :) ok. I'll let u focus.

melkoo

2013-03-09 17:44:54

Hopefully I can get some more help!


program PowerChopper;
//{$DEFINE SMART8}
{$i SRL\SRL.simba}

Const
SRLStats_Username = '';// Your SRL Stats Username
SRLSTats_Password = '';// Your SRL Stats Password
BreakEvery = 120; //How many minutes to break after
Breakfor = 5; //How long to break for
Version = '1.0';
NumbOfPlayers = 1; //How many players you are using
StartPlayer = 0; //Player to start auting with (0 means first char)

Procedure DeclarePlayers;
var i:integer;
begin
NumberOfPLayers(NumbOfPlayers);
CurrentPLayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player Password.
Active := True;
Integers[1] := 4; //1=BrightCopper, 2=DarkCopper, 3=Tin, 4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
end;
end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
end;

Function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean) :Boolean;
Begin
MMouse (x, y, 5, 5);
If WaitUptext (UpText, 1500+Random(500)) Then
Begin
Result:=True;
GetMousePos (x, y);
If RClick Then
Begin
Mouse (x, y, 0, 0, False);
Result := WaitOption (Option, 2000);
If Result then FFlag (0);
End Else
Begin
Mouse (x, y, 0, 0, True);
Wait (100+Random(50));
FFlag(0);
End;
End;
End;

Procedure Antiban;
Begin
Case Random(250) of
0: Begin StatsGuise ('AntiBan') Gametab(tab_Stats) Hoverskill('Woodcut', 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;
End;
End;

Procedure Failsafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;

Function Chopdown:Boolean;
Var
X, Y, PlusOne, Treecounter: Integer;
Begin
PlusOne:= InvCount + 1;
If FindObjCustom(X, Y, ['Chop', 'Down', 'p' ,'d'], [3627896, 3166827, 3627896, 1454376, 269596, 2044719 ], 10) Then
Begin
StatsGuise('This is the start of something Great!');
GetMousePos(X, Y);
Case Random(1) of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
WaitOption('Chop', 500);
End;
End;

Repeat
MarkTime(TreeCounter);
Antiban;
Wait(100);
If InvCount=Plusone Then
WriteLn('We got one');
Until (InvCount=Plusone) or (TimeFromMark(TreeCounter) > 7000)
End;
end;


begin
SetupSRL;
DeclarePlayers;
SetAngle(SRL_ANGLE_LOW);
//Repeat
ChopDown
//Until(False);
end.


My first problem is the

SetAngle(SRL_ANGLE_LOW); It does not put the angle all the way down when I execute the script. I orignally tried using SetAngle(False); But then I get this compiling error

[Error] C:\Simba\Scripts\powerchopper.simba(112:17): Type mismatch at line 111
Compiling failed.

Also when I try to get it to write "We got one" using the WriteLn command nothing gets written.

Another problem is that when

Case Random(1) of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
WaitOption('Chop', 500);
End;
End;

if It chooses the 1 instead of 0 it does not click Chop Down it just opens up the drop down menu (From when you rightclick in runescape) but dosnt do anything



Function Chopdown:Boolean;
Var
X, Y, PlusOne, Treecounter: Integer;
Begin
PlusOne:= InvCount + 1;
If FindObjCustom(X, Y, ['Chop', 'Down', 'p' ,'d'], [3627896, 3166827, 3627896, 1454376, 269596, 2044719 ], 10) Then
Begin
StatsGuise('This is the start of something Great!');
GetMousePos(X, Y);
Case Random(1) of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
WaitOption('Chop', 500);
End;
End;

Repeat
MarkTime(TreeCounter);
Antiban;
Wait(100);
If InvCount=Plusone Then
WriteLn('We got one');
Until (InvCount=Plusone) or (TimeFromMark(TreeCounter) > 7000)
End;
end;

melkoo

2013-03-10 10:52:04

bump

melkoo

2013-03-10 11:04:52

Just delete this thread I re posted it in the right forum section!

Here is a link!

http://villavu.com/forum/showthread.php?t=98366&p=1192492#post1192492

Runehack123

2013-03-10 11:09:23

You need ChooseOption not WaitOption. I would use 'hop' not 'Chop' since the capital letters at the start are found less accurately. ChooseOptionMulti to look for multiple string types will improve it, too.
You also need MarkTime(TreeCounter) outside of the repeat loop, because otherwise you keep doing MarkTime MarkTime MarkTime and you'll never get above 7 seconds.