Log in

View Full Version : Invalid number of parameters in script



herpes
09-01-2007, 02:15 PM
Ok well, this is literally my first post, so don't think im a leecher or something.
I've downloaded SCAR 3.11 and srl 4 and tried running some scripts that I downloaded. So far most of them have said "Failed compiling"
One of them said Invalid number of parameters in the script.

What am I doing wrong?

I apologize if this is the one thousandth thread you have seen about this. I tried searching and that didn't help.

rotflmfwao
09-01-2007, 02:18 PM
Post the code, I'll fix it. Thats a simple error.
<>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~<>
Explanation:
You have a function, or procedure, that requires parameters. Such as
Mouse(132,456,3,3,True)
and(132,456,3,3,True) are your parameters
<>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~<>
Invaid parameters means that you have the wrong number of parameters;
<>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~<>
WRONG
Mouse(132,456,3,3,True,extra)
Because you have 6 parameters instead of 5.
<>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~<>
WRONG
Mouse(132,456,3,3)
Because you have 4 parameters instead of 5.
<>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~<>
RIGHT
Mouse(132,456,3,3,True)
Because you have 5 parameters, no more no less.
<>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~<>

herpes
09-01-2007, 02:22 PM
Line 259: [error] (15073:33)
Is that what you need?

herpes
09-01-2007, 02:24 PM
The line it is having an error on is this
1: RandomRClick(2 + Random (10));

Bourdou!
09-01-2007, 02:24 PM
NO post the script itself. It is probably because you are trying to use scripts that aren't compatible with SRL4, or just not up to date.

herpes
09-01-2007, 02:27 PM
ER...what do you mean by post the script?


This?



{ //-------------------------------------------------------------\\
|| INSTRUCTIONS ||
||-------------------------------------------------------------||
|| ||
|| 1. Declare Players lines 37-61. ||
|| 2. Axe in first INV slot... ||
|| 3. Drag Crosshair into RS window. ||
|| 4. Hit play and fill out forms. ||
|| 5. AXE HEAD FINDER WILL WORK!!! ||
||-------------------------------------------------------------||
|| INSTRUCTIONS ||
\\-------------------------------------------------------------//
}

{.include SRL\SRL.SCAR}
{.include SRL\SRL\Skill\Woodcutting.SCAR}

Var
LoadNumber : Integer;
LogDTM, BrokenAxeDTM, AxeHandleDTM, RegularAxeDTM : Integer;
StartXP, EndXP, TotalXP, TotalLogs : Integer;
frmDesign : TForm;
Label1 : TLabel;
Label2 : TLabel;
Label3 : TLabel;
Edit1 : TEdit;
Edit2 : TEdit;
Edit3 : TEdit;
Button1 : TButton;
TheTreeName : String;
AmmountOfLoads : Integer;
TreeColor : Integer;

//->Declare Players<-//
Procedure DeclarePlayers;
begin
Status('Loading Players')

HowManyPlayers := 1;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 1;

Players[0].Name := '';
Players[0].Pass := '
Players[0].Nick := ''; // 2-4 letters of username
Players[0].Active := True;

Players[1].Name := 'Username';
Players[1].Pass := 'Password';
Players[1].Nick := 'Nickname'; // 2-4 letters of username
Players[1].Active := True;

Players[2].Name := 'Username';
Players[2].Pass := 'Password';
Players[2].Nick := 'Nickname'; // 2-4 letters of username
Players[2].Active := True;

Players[3].Name := 'Username';
Players[3].Pass := 'Password';
Players[3].Nick := 'Nickname'; // 2-4 letters of username
Players[3].Active := True;
end;


procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;

procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;

Procedure InitForm;
Begin
Status('Form Is Up')
frmDesign := CreateForm;
frmDesign.Left := 306;
frmDesign.Top := 367;
frmDesign.Width := 428;
frmDesign.Height := 207;
frmDesign.Caption := 'Setup';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;;
frmDesign.PixelsPerInch := 96;
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 3;
Label1.Top := 20;
Label1.Width := 258;
Label1.Height := 20;
Label1.Caption := 'Loads For Player Before Logging Off';
Label1.Font.Color := clWindowText;
Label1.Font.Height := -17;
Label1.Font.Name := 'MS Sans Serif';
Label1.Font.Style := [];
Label1.ParentFont := False;
Label2 := TLabel.Create(frmDesign);
Label2.Parent := frmDesign;
Label2.Left := 3;
Label2.Top := 50;
Label2.Width := 78;
Label2.Height := 20;
Label2.Caption := 'Tree Name';
Label2.Font.Color := clWindowText;
Label2.Font.Height := -17;
Label2.Font.Name := 'MS Sans Serif';
Label2.Font.Style := [];
Label2.ParentFont := False;
Label3 := TLabel.Create(frmDesign);
Label3.Parent := frmDesign;
Label3.Left := 3;
Label3.Top := 80;
Label3.Width := 73;
Label3.Height := 20;
Label3.Caption := 'Tree Color';
Label3.Font.Color := clWindowText;
Label3.Font.Height := -17;
Label3.Font.Name := 'MS Sans Serif';
Label3.Font.Style := [];
Label3.ParentFont := False;
Edit1 := TEdit.Create(frmDesign);
Edit1.Parent := frmDesign;
Edit1.Left := 269;
Edit1.Top := 20;
Edit1.Width := 24;
Edit1.Height := 21;
Edit1.TabOrder := 8;
Edit1.Text := '3';
Edit2 := TEdit.Create(frmDesign);
Edit2.Parent := frmDesign;
Edit2.Left := 87;
Edit2.Top := 50;
Edit2.Width := 58;
Edit2.Height := 21;
Edit2.TabOrder := 9;
Edit2.Text := 'Oak';
Edit3 := TEdit.Create(frmDesign);
Edit3.Parent := frmDesign;
Edit3.Left := 87;
Edit3.Top := 79;
Edit3.Width := 69;
Edit3.Height := 21;
Edit3.TabOrder := 10;
Edit3.Text := '876624';
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 172;
Button1.Top := 133;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'OK GO';
Button1.ModalResult := 1;
Button1.TabOrder := 11;
end;

Procedure Convert2;
Begin
TheTreeName := Edit2.text
AmmountOfLoads := StrToInt(Edit1.text)
TreeColor := StrToInt(Edit3.text)
end;



//->Load Dtm's<-//
Procedure LoadDTMs;

begin
Status('Loading DTM''s')

LogDTM := DTMFromString('78DA632C666260E0646440067921460CFF8 13' +
'448F43F103066314179C880118904D2354035FF19F0AB2905 AA11' +
'22604E23500D0F0135C94035DCF8D50000507909F5');

BrokenAxeDTM := DTMFromString('78DA633CCAC4C090C1C8800C9A127919FE0 36' +
'990E87F2060BC0C54938CAA06220B2381F445A09A04026A8E 01D5' +
'C41050B31FA8A698809AB384CD0100CBBD0D20');

AxeHandleDTM := DTMFromString('78DA637CCFC4C0E0C6C8800CCA227819FE0 36' +
'990E87F2060FC06546389AA06220B2381F473A09A00026ADE 00D5' +
'F81350F316A8C685809A97403541F8D50000D0090D3C');

RegularAxeDTM := DTMFromString('78DA637461626060676440060DF1BC0CFF8 13' +
'448F43F10300601D5FC6740038C482490F604AAF94D408D13 500D' +
'2B237E35F640358204D4F813618E1F50CD1F02EE0906AA61C 26F0' +
'E0099720B7E');

end;


//->Setup<-//
Procedure MySetupScript;
Begin
Status('Set-Up')
SetupSRL;
DeclarePlayers;
LoadDTMs;
end;


//->GetRandomLoad-//
Var
RandomLoad : Integer;

Procedure GetRandomLoad;
Begin
RandomLoad := (AmmountOfLoads + Random (5))
end;


//->Anti Randoms<-//
Procedure TheAntiRandoms;
Begin
Status('Random Check')
FindNormalRandoms;
wait(10)
FindTalk;
wait(10)
if (FindFight) then
begin
Status('Running From a fight.')
RunAwayDirection('E');
Wait(8500 + random(3500));
RunBack;
end;
Wait(10);
FindTalk;
end;


//->Anti Ban<-//
Var
WCLEVEL, DONTBAN : Integer;

Procedure TheAntiBan;
begin
TheAntiRandoms;
Status('Preforming Antiban')
if ( not ( LoggedIn )) then Exit;
DONTBAN:= 1 + Random(140)
case DONTBAN of
1: RandomRClick(2 + Random (10));
2: HoverSkill('woodcutting', false);
3: HoverSkill('random', false);
4: DoEmote(1 + Random(20));
6: PickUpMouse;
9: MMouse(MSX1,MSX2,10,10)
12: GameTab(1+random(7))
13: HighestAngle;
14: TypeSend('Lol my wc lvl is ' +IntToStr (WClevel) + '.')
15: TypeSend('Wc lvl ' +IntToStr (WClevel) + '! Sweet!')
16: TypeSend('Grr, my wc lvl is only ' +IntToStr (WClevel) + '')
17: GetSkillLevel('WoodCutting')
18: GameTab(1+Random(7))
21: TypeSend('I''m lvl ' +IntToStr (WClevel) + ', but I want ' +IntToStr (WClevel + 3 + Random(8)) + '')
22: TypeSend('' +IntToStr (WClevel) + ' woodcuting.../')
23: TypeSend('I can''t wait till im lvl ' +IntToStr (WClevel + 4 + Random(7)) + '')
24: TypeSend('Hmm... im only lvl ' +IntToStr (WClevel) + ' woodcutting... i should go for ' +IntToStr (WClevel + 6 + Random(8))+'')
25: TypeSend('yay... lvl ' +IntToStr (WClevel) + 'wc... still...')
26: TypeSend('cool! only ' + IntToStr (10+random(8)) + 'k xp till lvl ' +IntToStr (WClevel + 1 + random(4)) + ' wc')
27: TypeSend('WC lvl ' +IntToStr (WClevel) + '')
28: TypeSend('hmph... only ' +IntToStr (WClevel) + '')
end;
TheAntiRandoms;
end;


//->Get Axe Colors<-//
Procedure GetAxeColors;
Begin
Wait(100)
MakeCompass('S');
GameTab(4)
FindAxeHeadColor;
MakeCompass('N')
end;


//->Ent Checker<-//
Var
EX, EY : integer;
FX, FY : integer;
Procedure EntChecker;
Begin
Status('Checking For Ent')
Flag;
If (FindObjMultiText(EX, EY, TheTreeName, TheTreeName, TheTreeName, Treecolor, 4)) then
Begin
MMouse(Ex, EY, 0, 0)
If FindColorTolerance( FX, FY, 55769, 85, 15, 115, 15, 20) then
Begin
Status('Ent Found');
MouseFindFlag(648,83,5,5);
Wait(15000+Random(5000));
EntsAvoided := EntsAvoided + 1
end;
end;
end;


//->Check for Broken Axe<-//
Var
BX, BY, NX, NY : integer;

Procedure IsAxeBroken;
Begin
Status('Checking for broken axe')
GameTab(4)
Wait(400 + Random (100))
If (Not(FindDTM(BrokenAxeDTM, BX, BY, MIX1, MIY1, MIX2, MIY2 ))) then
Begin
Status('Axe Not Broken')
Exit;
end;
Begin
If (FindDTM(BrokenAxeDTM, BX, BY, MIX1, MIY1, MIX2, MIY2 )) and
(Not(FindDTM(RegularAxeDTM, NX, NY, MIX1, MIY1, MIX2, MIY2))) then
Begin
Status('Broke an Axe, and you have no more.')
NextPlayer(False)
end;
end;
end;


//->Axe Head Finder<-//
Procedure TheFindAxe;
Begin
Status ('Looking For Axe')
FindHead;
end;


//->Start Chopping<-//
Var
TX, TY : Integer;

Procedure StartChopping;
Begin
Repeat
Begin
IsAxeBroken;
Status('Looking For Oak')
If (InvFull) then
Begin
Exit;
end;
If ( Not (LoggedIn) ) Then NextPlayer (False)
EntChecker;
If ( Not (LoggedIn) ) Then NextPlayer (False)
If (FindObjMultiText(TX, TY, TheTreeName, TheTreeName, TheTreeName, Treecolor, 4)) then
Begin
Mouse(TX, TY, 3, 3, True)
Wait( 100 + Random (200) )
TheAntiRandoms;
Wait(10)
TheAntiBan;
Wait(10)
If ( Not (LoggedIn) ) Then NextPlayer (False)
Wait(10)
EntChecker;
Wait(10)
TheFindAxe;
Wait(4000+Random(1000))
end;
end;
Until (InvFull)
end;


//->Start Dropping<-//
Var
LX, LY, DroppedLogsCount : Integer;

Procedure StartDropping;
Begin
If (InvFull) then
Begin
GameTab(4)
DroppedLogsCount := CountItemDtm(LogDTM) + 6
Repeat
GameTab(4)
If (FindDTM(LogDTM, LX, LY, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(LX, LY, 8, 8, false)
ChooseOption(x,y,'Drop')
If ( Not (LoggedIn) ) Then NextPlayer (False)
TheAntiRandoms;
wait(400+random(100))
end;
Until (Not(FindDTM(LogDTM, LX, LY, MIX1, MIY1, MIX2, MIY2)))
LoadNumber := LoadNumber + 1
end;
end;

//->Progress Report<-//
Procedure ReportIt;
Begin
SRLRandomsReport;
WriteLn('[>-----------------------FOURS-REPORT-----------------------<]')
WriteLn('[>Script Time: ' + (TimeRunning) + '')
WriteLn('[>Logs Chopped: ' + IntToStr (TotalLogs) + '')
WriteLn('[>XP Gained: ' + IntToStr (TotalXP) + '')
WriteLn('[>----------------------------------------------------------<]')
end;


//->Main Stuff<-//
begin
wait(1200)
MySetupScript;
SafeInitForm;
SafeShowFormModal;
Convert2;
Begin
If (Not(LoggedIn)) then
Begin
Status('Logging In')
Loginplayer;
end;
end;
GetRandomLoad;
HighestAngle;
MakeCompass('N')
WCLEVEL := GetSkillLevel('WoodCutting')
Repeat
StartXP := GetXp('Woodcutting')
GetAxeColors;
Repeat
DisguiseScar('[' + IntToStr(LoadNumber) + '/' +IntToStr(RandomLoad) + '] ' +(Players[CurrentPlayer].name) + '')
StartChopping;
If ( Not (LoggedIn) ) Then NextPlayer (False)
StartDropping;
EndXP := GetXp('Woodcutting')
TotalLogs := TotalLogs + DroppedLogsCount
TotalXP := (EndXP - StartXP) + (TotalXP)
ReportIt;
GetAxeColors;
Until (LoadNumber >= RandomLoad)
LogOut;
NextPlayer(True);
LoadNumber := 0
GetRandomLoad;
HighestAngle;
MakeCompass('S')
WCLEVEL := GetSkillLevel('WoodCutting')
If ( Not (LoggedIn) ) Then NextPlayer (False)
Until False;
end.

rotflmfwao
09-01-2007, 02:27 PM
Also, don't doublepost. Post the script and I'll update it as well as debug it 'cause I'm in a good mood today :) But I'm parking cars for a football game @ like 11 thru 12.

EDIT:Yes, that. But use scar tags next time k?

herpes
09-01-2007, 02:30 PM
I appreciate your dealing with a newb like me.

Bourdou!
09-01-2007, 02:33 PM
Ya XD Will you edit your post and put a before it and a after it?
EDIT: scar tags

herpes
09-01-2007, 02:35 PM
Where did I say that?
EDIT: I can't find it, what general direction is it in?

Bourdou!
09-01-2007, 02:40 PM
I think it is just and old script. Do you just want a PowerWoodCutter? unless rotflmfwao can fix it.

herpes
09-01-2007, 02:44 PM
Well, Im really new to this, but I would like a woodcutter that can avoid randoms and bank.
If that isn't possible please direct me to the woodcutter you would recommend. Thanks!

Bourdou!
09-01-2007, 02:46 PM
Go look in SRL Free Script>Woodcutting, and search around. EDIT I use fours, but it doesn't bank
EDIT AGAIN Make sure it is compatible with SRL 4 ;)

herpes
09-01-2007, 02:48 PM
Thank you

Bourdou!
09-01-2007, 02:49 PM
Sure, if you need any more help, Just PM me