PDA

View Full Version : Invalid parameters help.



Hey321
11-13-2006, 12:07 AM
Failed when compiling
Line 95: [Error] (16065:11): Invalid number of parameters in script


That's what i get. This is line 95:



NextPlayer;

Yes i have SRL included all that jazz.

XcanadamanX
11-13-2006, 12:38 AM
show the whole procedure or whatever. i might be able to help

Hey321
11-13-2006, 12:41 AM
procedure NoBan;
begin
AntiBan;
BoredHuman;
RandomMovement;
FindMod;
RotateEvery(10);
FindNormalRandoms;
if (not loggedin) then begin;
NextPlayer;
end;

Boreas
11-13-2006, 12:46 AM
{************************************************* ******************************
procedure NextPlayerOrder(Active : Boolean);
By: WT-Fakawi
Description: Logs in CurrentPlayer. If Player[CurrentPlayer].Active = False,
then next Player attempts to login.
************************************************** *****************************}

XcanadamanX
11-13-2006, 12:47 AM
try putting this:

procedure NoBan;
begin
AntiBan;
BoredHuman;
RandomMovement;
FindMod;
RotateEvery(10);
FindNormalRandoms;
if (not (loggedin)) then begin;
NextPlayer(true);
end;

one difference...you didnt put (true) after nextplayer. see if that works.

Hey321
11-13-2006, 12:49 AM
Ok, thanks canadaman now i'm getting identifier expected :P never knew it was so hard to do multiplayers :(.

XcanadamanX
11-13-2006, 12:51 AM
hmmmm....ill have to see the script.

Hey321
11-13-2006, 12:54 AM
PM-ed you it :P.

Boreas
11-13-2006, 12:58 AM
Replace

if (not (loggedin)) then begin;
NextPlayer(true);

with
if (not (loggedin)) then NextPlayer(true);

or

if (not (loggedin)) then
begin
NextPlayer(true);
end;

Hey321
11-13-2006, 01:03 AM
Yes, boreas i did that fixed that problem if you read above i'm now having problems with identifiers being expected. I'll post script to see if you can find whats wrong.



program Hey321sNoobFighter;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Fighting.scar}
{.include SRL/SRL/extended/xAntiRandoms.scar}

var
MColor1, MColor2, MColor3: Integer;

var
MonsterName:string;

var
MonstersFought: Integer;

{Edit lines 17-19 with name/pass for login}

Const
Tolerance=5;
fightmode=0;
NumLoops=5;
waittime=1000;
procedure Colours;
begin
MonsterName:='Cow';//name of monster to fight.
MColor1:=000000;//first colour on the monster.
MColor2:=000000;//second colour.
MColor3:=000000;//self explanotory.
end;

Procedure DeclarePlayers;
begin

HowManyPlayers:=4;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active :=True;

Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active :=True;

Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Active :=True;

Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Active :=True;
end;


procedure Login;
begin
if(not loggedin)then
loginplayer
end;

procedure NoBan;
begin
AntiBan;
BoredHuman;
RandomMovement;
FindMod;
RotateEvery(10);
FindNormalRandoms;
if (not (loggedin)) then
begin
NextPlayer(true);
end;

procedure Setup;
begin
SetupSRL;
SetUpDemon;
SetupSandWich;
declareplayers;
Login;
SetFightMode(FightMode);
end;


procedure ProgressReport;
begin
Writeln('[]---////////////////////\\\\\\\\\\\\\\\---[]');
Writeln(' Thanks for using Hey321s');
Writeln(' Auto-Fighter ');
Writeln(' Worked for:' +ScriptTime2(2));
Writeln(' Monsters Fought: '+IntToStr(MonstersFought)+'');
Writeln('[]---////////////////////\\\\\\\\\\\\\\\---[]');
end;

Procedure Fighting;
begin if not InFight then begin
FindMonster(MColor1, MColor2, MColor3,tolerance, MonsterName);
KAttackMonster(MColor1,MColor2,MColor3,tolerance, MonsterName);
end; while InFight do
wait(waittime);
end;


begin
Setup;
Colours;
repeat
NoBan;
Fighting;
NoBan;
ProgressReport;
if (MonstersFought=NumLoops) then
NextPlayer(true);
end.

lardmaster
11-13-2006, 01:03 AM
ok...

invalid number of parameters means you are putting the wrong number of arguments into a function or a procedure. i.e. "random(590,234,True,1.2)" becuase random only accepts ONE argument, that is an integer. different procedures/functions need different amounts of arguments.

identifyer expected means that there are too many "end"s or "begin"s. look through and keep track of how many begins are "open" (if you see a end, then that means one of the begins has been "closed") when you go through your script, there should be 0 open Begins at the end. this is because every begin needs one end.

Boreas
11-13-2006, 01:05 AM
Yes, boreas i did that fixed that problem if you read above i'm now having problems with identifiers being expected. I'll post script to see if you can find whats wrong.



Yes what I posted fixes the identifiers. Your begins and ends dont match up.

Hey321
11-13-2006, 01:10 AM
Ok, wierd? I just counted them and i have 8 begin; 7 end; and 1 end. Is there something wrong with that? Either i did one or two things wrong or i suck at scripting :P.

Boreas
11-13-2006, 01:12 AM
you shouldn't have ; after begin

the main loop is

begin
end.

everything else is
begin
end;


Ex:


if condtion then
begin
action1
action2
end;

if condidtion then action1;

case variable of
outcome1: action1;
outcome2: action2;
end;

case variable of
outcome1:
begin
action1a;
action1b;
end;
outcome2:
begin
action2a;
action2b;
end;
end;

procedure blah;
var
a :integer;
begin
writeln(inttostr(a));
end;

function blah(a:integer):boolean;
begin
if a=1 then result:=true;
end;

//Main loop
begin
stuff;
end. grr scar tags still screwed

Hey321
11-13-2006, 01:16 AM
:P Oops i forgot that haha i didnt put it in script accidently did here though :P.

lardmaster
11-13-2006, 02:21 AM
i like your blah function. i think i might use it in my script! :)

Boreas
11-13-2006, 02:29 AM
lol