SRL Archive - OSR Help

Help me solve this error in my first script!


mavemaniac

2013-04-14 10:01:57

Getting this error in my code:
Error: Exception: Type Mismatch at line 31

please help :)

program new;
{$DEFINE SMART8}
{$i srl-OSR/srl.simba}

Const
NAME = '';
PASS = '';
NICK = '';

OreC1 = '2898271';
OreC2 = '1910851';
OreC3 = '2240075';

Procedure DeclarePlayers;

Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);

Players[0].Name := NAME;
Players[0].Pass := PASS;
Players[0].Nick := Nick;
Players[0].Active := True;
end;

function MineOre:Boolean;
Var x, y, PlusOne: integer;
Begin
PlusOne := InvCount+1;
FindNormalRandoms;
If (FindObjCustom(x, y, ['ine', 'ock'], [OreC1, OreC2, OreC3], 5)) Then
ClickMouse2(mouse_right);
WaitOptionEx('Mine', 'action', ClickLeft, 150);
repeat
wait(400+random(250));
until (InvCount=PlusOne);
end;
begin
DeclarePlayers;
SetupSRL;
ActivateClient;
LoginPlayer;
Repeat

MineOre;
if InvFull Then
DropAll;

Until(false);

end.

Rich

2013-04-14 10:11:41

Hey man. Which line is 31? Using my phone, it isn't very easy to see. Cheers!

tealc

2013-04-14 10:19:22

because you had quotes around the numbers, they get read as strings, but they need to be integers. Remove the quotes like below.
[samba]
OreC1 = 2898271;
OreC2 = 1910851;
OreC3 = 2240075;
[/samba]

mavemaniac

2013-04-14 10:19:23

From: Rich
Hey man. Which line is 31? Using my phone, it isn't very easy to see. Cheers!


If (FindObjCustom(x, y, ['ine', 'ock'], [OreC1, OreC2, OreC3], 5)) Then

that one :))

mavemaniac

2013-04-14 10:24:12

From: tealc
because you had quotes around the numbers, they get read as strings, but they need to be integers. Remove the quotes like below.
[samba]
OreC1 = 2898271;
OreC2 = 1910851;
OreC3 = 2240075;
[/samba]


ty man! this fixed it. MY script works like a charm now :D only have to add antiban and failsafes :D