SRL Archive - Help and Support

Type MisMatch...


Buckleyindahouse

2007-06-17 16:39:05

Trying to finish up my Karamaja Fisher V2 and I keep getting this error, Im stooped on what it could be I just don't know. Its on this procedure.

procedure FindSpot(Wait: Integer; Cage: Boolean);
var
i: Integer;
FST: Integer;
begin
if (Cage) then
begin
repeat
for i := 0 to 6 do
if (FindColorSpiralTolerance(x, y, FishSpot[i], msx1, msy1, msx2, msy2, 15)) then
MMouse(x, y, 2, 2);
Wait(50 + Random(150));
until(IsUpTextMulti('age', 'ish', 'spo') or (FST = 40)))//line 208 here
if (FST = 40) then
begin
Players[CurrentPlayer].Loc := 'FishTimedOut';
NextPlayer(False);
Exit;
end;
case Random(2) of
0: begin
Mouse(x, y, 3, 3, True);
FFlag(10);
end;
1: begin
Mouse(x, y, 3, 3, False);
FTWait(1);
ChooseOption(x, y, 'age');
FFlag(10);
end;
end;
if (not (Cage)) then
begin
Mouse(x, y, 4, 4, False);
ChooseOption(x, y, 'poon');
FFlag(10);
end;
end;
FindFishingEquipMent;
BuckBan;
FindNormalRandoms;
FindFastRandoms;
FindBuckRandoms;
Wait(Wait*1000 + Random(1000));
end;
end;
Line 208: [Error] (14609:5): Type mismatch in script

Help me please.

Bobarkinator

2007-06-17 16:50:34

One to many close rounds on that line ;)

Buckleyindahouse

2007-06-17 16:57:09

I changed the Close Ends bout 5 times still same error.

Bobarkinator

2007-06-17 17:12:53

I have no idea

Abyssal

2007-06-17 18:23:57

It looks like what bob, said, you have one to many parenthesis at the end…

Bobarkinator

2007-06-18 00:03:12

even if you remove one parentheses it still gives the error

Dark_Sniper

2007-06-18 10:34:50

well the thing was he had an extra ) yes but that was not the only problem….


the code wait(50 +random(150)) is being stuborn and is not working…

so change the wait to sleep and it works…

heres the new code:

{.include SRL\SRL.SCAR}
var
fishspot : array of integer;

procedure FindSpot(Wait: Integer; Cage: Boolean);
var
i: Integer;
FST: Integer;
begin
if (Cage) then
begin
repeat
for i := 0 to 6 do
if (FindColorSpiralTolerance(x, y, FishSpot[i], msx1, msy1, msx2, msy2, 15)) then
MMouse(x, y, 2, 2);
sleep(50 + random(150))
until(IsUpTextMulti('age', 'ish', 'spo') or (FST = 40))//line 208 here
if (FST = 40) then
begin
Players[CurrentPlayer].Loc := 'FishTimedOut';
NextPlayer(False);
Exit;
end;
case Random(2) of
0: begin
Mouse(x, y, 3, 3, True);
FFlag(10);
end;
1: begin
Mouse(x, y, 3, 3, False);
FTWait(1);
ChooseOption(x, y, 'age');
FFlag(10);
end;
end;
if (not (Cage)) then
begin
Mouse(x, y, 4, 4, False);
ChooseOption(x, y, 'poon');
FFlag(10);
end;
end;
FindFishingEquipMent;
BuckBan;
FindNormalRandoms;
FindFastRandoms;
FindBuckRandoms;
Wait(Wait*1000 + Random(1000));
end;
end;



allow me to explain this error!

notice you declare wait in your fishing procedure….

so to make wait work you your procedure change the name or make every wait you add in the procedure to sleep…

still do not get it?


procedure FindSpot(Wait: Integer; Cage: Boolean);

well that is causing the error

you already declared wait in that procedure as an integer.
now its only for that procedure anywhere else in your script can use wait the right way.
if you need to wait in the procedure again.. just use sleep….

quote form manual…
procedure Wait(ms: Integer);
Waits ms milliseconds (Wait(1000) - wait 1 second).

procedure Sleep(ms: Integer);
Alias of Wait.



if you are having problems understanding this just pm me XD


ps:


Type mismatch in script

is usually something wrong with the line above the line it said had the error…

to see if thats true just comment the line out when attempting to compile it…
easy error fix.

Bobarkinator

2007-06-18 10:38:09

I get it and would probably have never caught that :p

Dark_Sniper

2007-06-18 10:41:10

lol i did not know why wait didnt work i was like wtf for 5 mins then i just posted the fix before i subited i read the main procedure and i was like oh… im a dumb ass.

Buckleyindahouse

2007-06-18 11:47:55

Awsome, Thnx Dark. I would never gotten that figured out. I was just about to throw away the script :D.

Dark_Sniper

2007-06-18 22:13:29

and that one error you pmed me i do believe i fixed… cant be sure with the only coding you gave me XD!

like i said just giving it my best guess on that one… resend it if you still got the problem or a new one.