SRL Archive - OSR Help

Type mismatch at line 153


Spandzbab

2012-04-21 16:16:28

I've been following YoHoJo's tutorial #2 2/2 and when I compile I get this error:
[Error] (154:42): Type mismatch at line 153

I've checked everything a few times on the video and in my script and still get that error when I compile.

Line 153 is:

MouseItem (LogPattern [I], False); 

Abu

2012-04-21 16:19:55

Replace False with 0

Spandzbab

2012-04-21 16:22:16

From: abu_jwka
Replace False with 0

So now instead of True and False it's 0 and 1?

It works by the way, thank you,

Mark

2012-04-21 16:22:27

too many spaces

try this
Simba Code:
[LEFT]MouseItem(LogPattern, False);


:S my bad didnt notice it was asking for a Click type
[/LEFT]

Rich

2012-04-21 16:24:24

From: Spandzbab
So now instead of True and False it's 0 and 1?

It works by the way, thank you,
Either work.


From: CRU1Z1N
too many spaces

try this
MouseItem(LogPattern[I], False);
And spaces don't matter. As an example
MoveMouse             (             100      ,    50        )     ;   
works just fine.

Spandzbab

2012-04-21 16:34:58

From: Rich
Either work.


And spaces don't matter. As an example
MoveMouse             (             100      ,    50        )     ;   
works just fine.

But I've had False before and it didn't compile but after I changed it to 0 it did. What's up with that ?

Rich

2012-04-21 16:50:27

No idea. Just did some tests and sometimes one worked and the other didn't, and visa versa.

Spandzbab

2012-04-21 16:58:51

@Edit@ Scratch that completely. New problem has occured.

Whenever I run the script it goes to the top right corner of the Runescape screen and just waits there.

I'll post the whole script so far maybe someone will find the problem while I experiment around with it.


program PowerChopper;

//{$DEFINE SMART}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}
//{$i SRL\SRL\Misc\paintsmart.simba}


Const
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
BreakEvery = 120; //How Many Minutes To Break After
BreakFor = 10; //How Long To Break For
Version = '1.0';



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;
end;

end;



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


Procedure Antiban;
Begin
Case Random(250) Of

0:
Begin
//PaintReport;
HoverSkill('Woodcut', False);
//PaintReport;
GameTab(Tab_Inv);
//PaintReport;
End;
1:
Begin
//PaintReport;
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
//PaintReport;
PickUpMouse;
End;
2: ExamineInv;
3:
Begin
//PaintReport;
RandomAngle(SRL_ANGLE_HIGH);
//PaintReport;
SetAngle(SRL_ANGLE_HIGH);
//PaintReport;
End;
4:
Begin
//PaintReport;
GameTab(Tab_Stats);
//PaintReport;
Wait(3000 + Random(500));
//PaintReport;
GameTab(Tab_Inv);
End;
5:
Begin
//PaintReport;
HoverSkill('random', False);
//PaintReport;
GameTab(Tab_Inv);
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 FindObjTPA (x, y, 1252378, 10, 1, 15, 60, 3, ['Chop','Tree']) Then
Begin
StatsGuise ('We have found the tree');
GetMousePos (x, y);

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

Flag;

Repeat
Antiban;
MarkTime (TreeCounter);
Wait (1000);
If InvCount=PlusOne Then
StatsGuise ('We got one');
Until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 7000)

End;
End;


Procedure DropLogs;
var
X, Y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern: TIntegerArray;

Begin

LogDTM := DTMFromString('maQEAAHicE2RgYBBkgABmKM0KxJxALADEokAsBcRyUAxiSwKxOBALATEvELNBaRDmBmIRIBZDUicKFQOp5wNiDiS7mICYBYq9LRSgIuTjAAbKASMVMAYAACNQAx8=');
LogPattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];
For I:=0 To 27 Do

Begin

SlotBox:= InvBox(LogPattern[I]);
If FindDTm(LogDTM, X, Y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem (LogPattern[I], 0);
ChooseOption ('Drop');
End;
End;

End;


Begin

SetupSRL;
DeclarePlayers;
SetAngle(SRL_ANGLE_HIGH);
Repeat
ChopDown;
If InvFull Then
DropLogs;
Until(false);

End.

Abu

2012-04-22 10:45:36

Most likely you need to fix your color

Element17

2012-04-22 19:56:46

From: abu_jwka
Most likely you need to fix your color


That and also work on your standards good habit to get into.