TehNeonFishy
2012-06-10 19:01:56
So I'm following YoHoJo's guide video 2 part 1 and I ran into this error even though my code is exactly the same as his. The error is
Line 107 is the 'End;' underneath the invcount part. I've tried searching for an answer but to no avail, anyone have any ideas?
[Error] (108:3): Type mismatch at line 107
Compiling failed.
Line 107 is the 'End;' underneath the invcount part. I've tried searching for an answer but to no avail, anyone have any ideas?
Program PowerChopper;
//{$DEFINE SMART}
{$i SRL\SRL.simba}
//{$i SRL\SRL\Misc\Stats.simba}
Const
SRLStats_Username = '';
SRLStats_Password = '';
BreakEvery = 120;
BreakFor = 5;
Version = '1.0';
NumbOfPlayers = 1;
StartPlayer = 0;
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 := '';
Pass := '';
Active := True;
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('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;
End;
End;
Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;
Function ChopTree:Boolean;
Var
seX, seY, PlusOne, TreeCounter:Integer;
Begin
PlusOne := InvCount +1;
If FindObjCustom(seX, seY, ['Chop', 'down', 'p d'], [1581857, 1450014, 1912107, 1318172], 10) Then
Begin
StatsGuise('Tree sighted.');
GetMousePos(seX, seY);
Case Random(2) Of
1: Mouse(seX, seY, 5, 5, 1);
2: Begin
Mouse(seX, seY, 5, 5, 0);
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;
Repeat
ChopTree;
Until(false);
End.