SRL Archive - General

[Error] (23:4): Type mismatch at line 22


Victorshotten

2012-06-03 05:54:00

Hello, I am quite new to Simba and I am using this script as a script to learn off of and such, But I cannot fix this error.. I have tried everything and told myself I would not ask for help.. But I just can't fix it. Im sure it is something extremely simple that I am missing.

The error is "[Error] (23:4): Type mismatch at line 22"


program DPAgility;

{$DEFINE SMART}
{$i SRL/SRL.simba}
//{$i SRL/SRL/Misc/Stats.simba}


Const
SRLStats_Username = '';
SRLStats_Password = '';
BreakEvery = 120; //Minutes to break for
BreakFor = 5; //How long for
Version = '1.0';
NumbOfPlayers= '1';
StartPlayer= '0';


procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers)
CurrentPlayer := StartPlayer; //Line 22 is here @@@@
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := '';
Pass := '';
Active := True;
Integers[1] := 4;
Integers[2] := 4;
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,Trade);
Wait (100+Random(50));
FFlag(0);
End;
End;
End;


Function Course;
Var
X, Y: Integer;
Begin
if FindObjCustom(X, Y, ['Walk', 'across'], [602966, 600647], 10 Then
Writeln('First object has been found');
End;






begin
SetupSRL;
DeclarePlayers;
Repeat
Course;
Until(false);
end.

CephaXz

2012-06-03 05:55:42

CurrentPlayer := 0;

catanado15

2012-06-03 05:58:31

From: CephaXz
CurrentPlayer := 0;


yeah, this is more simple :p he put the "0" called "StartPlayer" on the const

Victorshotten

2012-06-03 06:00:23

From: catanado15
yeah, this is more simple :p he put the "0" called "StartPlayer" on the const



Ahh I see. Thank you guys very much! +Rep


From: CephaXz
Ohh, didn't notice that.
I think it shouldn't have the '', if its put as const, then

StartPlayer= 0;



Yeah I noticed that as I was putting in the new code segment.. Thank you!

CephaXz

2012-06-03 06:00:23

Ohh, didn't notice that.
I think it shouldn't have the '', if its put as const, then

StartPlayer= 0;

But no point doing that :p

Victorshotten

2012-06-03 06:39:16

Ok I fixed all the compiling issues.. I am now going through testing ingame, But I am having trouble.

I have all the correct colors picked and in the code, The bot will hover over the correct objects but it will not click on the object like it is supposed to, But instead move on.


Any Ideas?




program DPAgility;

//{$DEFINE SMART}
{$i SRL/SRL.simba}
//{$i SRL/SRL/Misc/Stats.simba}


Const
SRLStats_Username = '';
SRLStats_Password = '';
BreakEvery = 120; //Minutes to break for
BreakFor = 5; //How long for
Version = '1.0';
NumbOfPlayers= 1;
StartPlayer= 0;


procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers)
CurrentPlayer := 0;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := '';
Pass := '';
Active := True;
Integers[1] := 4;
Integers[2] := 4;
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, 1, 1);
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;


Function Course:Boolean;
Var
X, Y: Integer;
Begin
if FindObjCustom(X, Y, ['Walk', '-acr'], [606057], 20) Then
Begin
GetMousePos(X, Y);
Mouse(X, Y, 5, 5, True);
End;
End;


begin
SetupSRL;
DeclarePlayers;
Repeat
Course;
Until(false);
end.

CephaXz

2012-06-03 06:43:43

So you're only doing the function called Course here. And if it moves the mouse there, it should keep clicking endlessly. Just curious, what object shows uptext of Walk?

Victorshotten

2012-06-03 06:48:23

"Walk-across" is the full uptext.

And Im just currently trying to get it an object at a time, So I will fix the endless clicking once I have this object done..

CephaXz

2012-06-03 06:54:09

So what's the problem? It's not left clicking the object?

Victorshotten

2012-06-03 06:57:59

From: CephaXz
So what's the problem? It's not left clicking the object?


Yes

CephaXz

2012-06-03 07:04:17

I PM-ed you. Let's solve the problem through PM.