SRL Archive - OSR Help

Help Please New To Scripting!


Darcy_Oner

2013-03-26 21:43:15

Ok this is my first script im following YoHoJo's tutorial video step by step.



Can someone please tell me whats wrong?

Script:

program YewCutter;

//{$DEFINE SMART8}
{$i SRL/SRL.simba}
{$i P07Include.simba}


procedure StatsGuise(wat:String);
begin
Status(wat);
Disguise(wat);
end;

function CheckAndClick(UpText, Ootion: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('text', 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('Skill_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('Skill_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, ['Ch', 'Do', 'Ye'], [3297875 , 284750 , 1525308 , 1462857 ], 0) Then
begin
Writeln ('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;
end;
end;







begin
SetupSRL;
//DeclarePlayers;
//repeat
ChopDown;
//until( False);
end.

Sjoe

2013-03-26 21:45:14

Wait(Option, 2000);

Should be

WaitOption('text', 2000);

Darcy_Oner

2013-03-26 21:46:35

From: Sjoekeloe
Wait(Option, 2000);

Should be

WaitOption('text', 2000);


Ahh thankyou! YoHoJo made the same mistake but it still compiled for him :S

Darcy_Oner

2013-03-26 22:23:53

Also lines 37-42 have invalid paramters. Does anyone know why?

Total

2013-03-26 22:33:18

procedure Antiban;
begin
Case Random(250) Of
0: Begin StatGuide('AntiBan') GameTab(Tab_Stats) HoverSkill('Woodcut'), False) GameTab(28); end; // Missing a opening parenthesis for HoverSkill
1: Begin StatGuide('AntiBan') SleepAndMoveMouse(7000 + Random(500)); end;
2: Begin StatGuide('AntiBan') GameTab(Tab_Inv) ExamineInv; GameTab(28); end;
3: Begin StatGuide('AntiBan') RandomAngle(1); end;
4: Begin StatGuide('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); end;
5: Begin StatGuide('AntiBan') GameTab(TabStats) ; HoverSkill('random', False); GameTab(28); end; // Missing a opening parenthesis for HoverSkill and missing underscore in Tab_Stats
end;
end;

Darcy_Oner

2013-03-26 22:45:36

EDIT: NVM Fixed it :D

Total

2013-03-26 22:47:09

procedure Antiban;
begin
Case Random(250) Of
0: Begin StatGuide('AntiBan') GameTab(Tab_Stats) HoverSkill(('Woodcut'), False) GameTab(28); end; // Missing a opening parenthesis for HoverSkill
1: Begin StatGuide('AntiBan') SleepAndMoveMouse(7000 + Random(500)); end;
2: Begin StatGuide('AntiBan') GameTab(Tab_Inv) ExamineInv; GameTab(28); end;
3: Begin StatGuide('AntiBan') RandomAngle(1); end;
4: Begin StatGuide('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); end;
5: Begin StatGuide('AntiBan') GameTab(Tab_Stats) ; HoverSkill(('random', False); GameTab(28); end; // Missing a opening parenthesis for HoverSkill and missing underscore in Tab_Stats
end;
end;

That should work. Just talking about a normal parenthesis '(' lol.

Darcy_Oner

2013-03-26 23:06:22

From: Total
procedure Antiban;
begin
Case Random(250) Of
0: Begin StatGuide('AntiBan') GameTab(Tab_Stats) HoverSkill(('Woodcut'), False) GameTab(28); end; // Missing a opening parenthesis for HoverSkill
1: Begin StatGuide('AntiBan') SleepAndMoveMouse(7000 + Random(500)); end;
2: Begin StatGuide('AntiBan') GameTab(Tab_Inv) ExamineInv; GameTab(28); end;
3: Begin StatGuide('AntiBan') RandomAngle(1); end;
4: Begin StatGuide('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); end;
5: Begin StatGuide('AntiBan') GameTab(Tab_Stats) ; HoverSkill(('random', False); GameTab(28); end; // Missing a opening parenthesis for HoverSkill and missing underscore in Tab_Stats
end;
end;

That should work. Just talking about a normal parenthesis '(' lol.


Actually that doesn work either its HoverSkill('Skill_Woodcut', False)
Also getting an error at line 60 'Writeln'

Total

2013-03-26 23:15:25

Oh my bad lol. Here is the full code fixed.


program YewCutter;

{$DEFINE SMART8}
{$i SRL/SRL.simba}
{$i P07Include.simba}


procedure StatsGuise(wat:String);
begin
Status(wat);
Disguise(wat);
end;

function CheckAndClick(UpText, Ootion: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:= WaitUpText('', 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 StatGuide('AntiBan') GameTab(Tab_Stats) HoverSkill('Woodcut', False) GameTab(28); end; // Missing a opening parenthesis for HoverSkill
1: Begin StatGuide('AntiBan') SleepAndMoveMouse(7000 + Random(500)); end;
2: Begin StatGuide('AntiBan') GameTab(Tab_Inv) ExamineInv; GameTab(28); end;
3: Begin StatGuide('AntiBan') RandomAngle(1); end;
4: Begin StatGuide('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); end;
5: Begin StatGuide('AntiBan') GameTab(Tab_Stats) ; HoverSkill('random', False); GameTab(28); end; // Missing a opening parenthesis for HoverSkill and missing underscore in Tab_Stats
end;
end;

procedure FailSafe(Reason:String);
begin
Players[CurrentPlayer] .Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
end;

procedure ChopDown;
var
x , y: Integer;
begin
if FindObjCustom (x, y, ['Ch', 'Do', 'Ye'], [2836291, 1194297, 409140, 2115648], 20) Then
Writeln('Found Tree');
end;





begin
SetupSRL;
ChopDown;
end.

Basically for line 60 you weren't using the arrays correctly. They all need to be put in square brackets with commas separating each term. For the Writeln you had a colon that you didn't need.

Darcy_Oner

2013-03-26 23:17:39

Thanks Total!