F
falcon7453
Guest
need help im a noob at SCAr so im trying to get script to work and every timei do i get this
Failed when compiling
Line 296: [Error] (14697:1): Unknown identifier 'ClickItemColorTol' in script C:\Documents and Settings\Owner\Desktop\AutoWoodCut v2.scar
heres the script:::
{ INSTRUCTIONS v2
1. Declare your players starting at line 29 of script.
2. Hit play then fill out Setup Form.
3. Watch. This script does not have an axe head finder.
It does have Charms ent finder. (I hope that's ok)
{.include SRL\SRL.SCAR}
Var
TreeColor,InvColor,Loats,cx,cy: Integer;
Setup : TForm;
Label1 : TLabel;
Label2 : TLabel;
Label3 : TLabel;
Label4 : TLabel;
Edit1 : TEdit;
Edit2 : TEdit;
Button1 : TButton;
NameofTree : string;
Loads : integer;
//[][][][][][][][][][][][][][][][][][][][]
//Declare Players <======================
//[][][][][][][][][][][][][][][][][][][][]
Procedure DeclarePlayers;
begin
HowManyPlayers := 6;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := 'Nickname';
Players[0].Active := True;
Players[1].Name := 'UserName';
Players[1].Pass := 'Password';
Players[1].Nick := 'Nickname';
Players[1].Active := True;
Players[2].Name := 'UserName';
Players[2].Pass := 'Password';
Players[2].Nick := 'Nickname';
Players[2].Active := True;
Players[3].Name := 'UserName';
Players[3].Pass := 'Password';
Players[3].Nick := 'Nickname';
Players[3].Active := True;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
setup.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
Procedure InitForm;
Begin
Setup := CreateForm;
Setup.Left := 321;
Setup.Top := 193;
Setup.Width := 328;
Setup.Height := 227;
Setup.Caption := 'Fours Setup';
Setup.Color := clBtnFace;
Setup.Font.Color := clWindowText;
Setup.Font.Height := -11;
Setup.Font.Name := 'MS Sans Serif';
Setup.Font.Style := [];
Setup.Visible := False;
Setup.PixelsPerInch := 96;
Label1 := TLabel.Create(Setup);
Label1.Parent := Setup;
Label1.Left := 80;
Label1.Top := 0;
Label1.Width := 156;
Label1.Height := 33;
Label1.Caption := 'Fours Power Cutter';
Label1.Font.Color := clBlue;
Label1.Font.Height := -24;
Label1.Font.Name := 'Mandela';
Label1.Font.Style := [];
Label1.ParentFont := False;
Label2 := TLabel.Create(Setup);
Label2.Parent := Setup;
Label2.Left := 4;
Label2.Top := 54;
Label2.Width := 187;
Label2.Height := 20;
Label2.Caption := 'What tree are you cutting?';
Label2.Font.Color := clWindowText;
Label2.Font.Height := -16;
Label2.Font.Name := 'MS Sans Serif';
Label2.Font.Style := [];
Label2.ParentFont := False;
Label3 := TLabel.Create(Setup);
Label3.Parent := Setup;
Label3.Left := 4;
Label3.Top := 105;
Label3.Width := 198;
Label3.Height := 20;
Label3.Caption := 'How many loads per player?';
Label3.Font.Color := clWindowText;
Label3.Font.Height := -16;
Label3.Font.Name := 'MS Sans Serif';
Label3.Font.Style := [];
Label3.ParentFont := False;
Label4 := TLabel.Create(Setup);
Label4.Parent := Setup;
Label4.Left := 4;
Label4.Top := 74;
Label4.Width := 141;
Label4.Height := 13;
Label4.Caption := 'Exactly like RS '#39'Oak'#39' not '#39'oak'#39;
Edit1 := TEdit.Create(Setup);
Edit1.Parent := Setup;
Edit1.Left := 220;
Edit1.Top := 54;
Edit1.Width := 90;
Edit1.Height := 22;
Edit1.Font.Color := clWindowText;
Edit1.Font.Height := -11;
Edit1.Font.Name := 'Arial';
Edit1.Font.Style := [fsBold];
Edit1.ParentFont := False;
Edit1.TabOrder := 8;
Edit1.Text := 'Oak';
Edit2 := TEdit.Create(Setup);
Edit2.Parent := Setup;
Edit2.Left := 220;
Edit2.Top := 105;
Edit2.Width := 25;
Edit2.Height := 21;
Edit2.OEMConvert := True;
Edit2.TabOrder := 9;
Edit2.Text := '4';
Button1 := TButton.Create(Setup);
Button1.Parent := Setup;
Button1.Left := 120;
Button1.Top := 139;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Ok, Start';
Button1.ModalResult := 1;
Button1.TabOrder := 10;
end;
Procedure Convert2;
Begin
NameofTree := Edit1.text
Loads := StrToInt(Edit2.text)
end;
//[][][][][][][][][][][][][][][][][][][][]
//MySetup <==============================
//[][][][][][][][][][][][][][][][][][][][]
Procedure MySetup;
Begin
SetupSrl;
UseBoxSolver := True
wait(10)
UseCerterSolver := True
wait(10)
UseSandwichSolver :=True
ClearDebug;
cx:=x;
cy:=y;
end;
//[][][][][][][][][][][][][][][][][][][][]
//Second Setup <=========================
//[][][][][][][][][][][][][][][][][][][][]
Procedure SecondSetup;
Begin
If NameofTree = ('Oak') then
TreeColor := (2252880)
If NameofTree = ('Willow') then
TreeColor := (1982520)
If NameofTree = ('Tree') then
TreeColor := (1730648)
//------------------------------//
If NameofTree = ('Oak') then
InvColor := (3694460)
If NameofTree = ('Willow') then
InvColor := (2051414)
If NameofTree = ('Tree') then
InvColor := (3430514)
WriteLn('You are cutting a[n] '+(NameofTree) + ' and the color of it is ' +IntToStr(TreeColor) + '.')
WriteLn('You are cutting '+ InttoStr(Loads) +' loads of logs.')
end;
//[][][][][][][][][][][][][][][][][][][][]
//AntiBan Procedure <====================
//[][][][][][][][][][][][][][][][][][][][]
Procedure MyAntiban;
Begin
GameTab(1+Random(7))
Wait(2000+Random(1000)+Random(500))
MMouse(200,200,300,300)
If (2+random(3)=4) then
Begin
GetSkillLevel('Woodcutting')
If (2+random(3)=3) then
Begin
GetXp('Woodcutting')
end;
end;
end;
//[][][][][][][][][][][][][][][][][][][][]
//AntiRandoms Procedure <================
//[][][][][][][][][][][][][][][][][][][][]
Procedure MyAntiRandoms;
Begin
FindNormalRandoms;
wait(10)
wait(10)
FindMaze;
wait(10)
Solvepinball;
Wait(10)
if (FindFight) then
begin
RunAwayDirection('E');
Wait(8500 + random(3500));
RunBack;
end;
Wait(10);
FindTalk;
end;
//[][][][][][][][][][][][][][][][][][][][]
//Chopping Procedure <===================
//[][][][][][][][][][][][][][][][][][][][]
Procedure Chopping;
Begin
Repeat
If FindObj(x,y,NameofTree,TreeColor,3) then
Begin
Mouse(x,y,1,1,true)
wait(100)
MyAntiRandoms;
ChooseOption(x,y,'Chop')
MyAntiRandoms;
MyAntiBan;
Wait(6000+random(3000))
If(Not(LoggedIn)) then NextPlayer(False);
end;
Until InvFull;
end;
//[][][][][][][][][][][][][][][][][][][][]
//Droping Procedure <====================
//[][][][][][][][][][][][][][][][][][][][]
Procedure Drop;
Begin
Repeat
ClickItemColorTol(InvColor,4,False)
ChooseOption(x,y,'Drop')
Wait(800+random(200)+random(200))
MyAntiRandoms;
Until (CountItemColorTol(InvColor,4)<Random(4))
Loats:=Loats+1
End;
//[][][][][][][][][][][][][][][][][][][][]
//MAIN THING <===========================
//[][][][][][][][][][][][][][][][][][][][]
Begin
MySetup;
SafeInitForm;
SafeShowFormModal;
Convert2;
DeclarePlayers;
SecondSetup;
Loats:=0
Wait(3000+random(1000))
LoginPlayer;
Repeat
Repeat
MakeCompass('N')
HighestAngle;
Chopping;
If(Not(LoggedIn)) then NextPlayer(False);
Drop;
SrlRandomsReport;
Until (Loads = Loats)
NextPlayer(True)
Loats:=0
If(Not(LoggedIn)) then NextPlayer(False);
Until False;
end.
//THANK YOU ALL!
//Fours.
//Credits will go to EVERYONE in the SRL community. Yohojo8. I took up
//alot of his time and he put up with me. Charms. Procedures and scripts
//helped me alot in learning SRL and SCAR procedures/function.
Failed when compiling
Line 296: [Error] (14697:1): Unknown identifier 'ClickItemColorTol' in script C:\Documents and Settings\Owner\Desktop\AutoWoodCut v2.scar
heres the script:::
{ INSTRUCTIONS v2
1. Declare your players starting at line 29 of script.
2. Hit play then fill out Setup Form.
3. Watch. This script does not have an axe head finder.
It does have Charms ent finder. (I hope that's ok)
{.include SRL\SRL.SCAR}
Var
TreeColor,InvColor,Loats,cx,cy: Integer;
Setup : TForm;
Label1 : TLabel;
Label2 : TLabel;
Label3 : TLabel;
Label4 : TLabel;
Edit1 : TEdit;
Edit2 : TEdit;
Button1 : TButton;
NameofTree : string;
Loads : integer;
//[][][][][][][][][][][][][][][][][][][][]
//Declare Players <======================
//[][][][][][][][][][][][][][][][][][][][]
Procedure DeclarePlayers;
begin
HowManyPlayers := 6;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := 'Nickname';
Players[0].Active := True;
Players[1].Name := 'UserName';
Players[1].Pass := 'Password';
Players[1].Nick := 'Nickname';
Players[1].Active := True;
Players[2].Name := 'UserName';
Players[2].Pass := 'Password';
Players[2].Nick := 'Nickname';
Players[2].Active := True;
Players[3].Name := 'UserName';
Players[3].Pass := 'Password';
Players[3].Nick := 'Nickname';
Players[3].Active := True;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
setup.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
Procedure InitForm;
Begin
Setup := CreateForm;
Setup.Left := 321;
Setup.Top := 193;
Setup.Width := 328;
Setup.Height := 227;
Setup.Caption := 'Fours Setup';
Setup.Color := clBtnFace;
Setup.Font.Color := clWindowText;
Setup.Font.Height := -11;
Setup.Font.Name := 'MS Sans Serif';
Setup.Font.Style := [];
Setup.Visible := False;
Setup.PixelsPerInch := 96;
Label1 := TLabel.Create(Setup);
Label1.Parent := Setup;
Label1.Left := 80;
Label1.Top := 0;
Label1.Width := 156;
Label1.Height := 33;
Label1.Caption := 'Fours Power Cutter';
Label1.Font.Color := clBlue;
Label1.Font.Height := -24;
Label1.Font.Name := 'Mandela';
Label1.Font.Style := [];
Label1.ParentFont := False;
Label2 := TLabel.Create(Setup);
Label2.Parent := Setup;
Label2.Left := 4;
Label2.Top := 54;
Label2.Width := 187;
Label2.Height := 20;
Label2.Caption := 'What tree are you cutting?';
Label2.Font.Color := clWindowText;
Label2.Font.Height := -16;
Label2.Font.Name := 'MS Sans Serif';
Label2.Font.Style := [];
Label2.ParentFont := False;
Label3 := TLabel.Create(Setup);
Label3.Parent := Setup;
Label3.Left := 4;
Label3.Top := 105;
Label3.Width := 198;
Label3.Height := 20;
Label3.Caption := 'How many loads per player?';
Label3.Font.Color := clWindowText;
Label3.Font.Height := -16;
Label3.Font.Name := 'MS Sans Serif';
Label3.Font.Style := [];
Label3.ParentFont := False;
Label4 := TLabel.Create(Setup);
Label4.Parent := Setup;
Label4.Left := 4;
Label4.Top := 74;
Label4.Width := 141;
Label4.Height := 13;
Label4.Caption := 'Exactly like RS '#39'Oak'#39' not '#39'oak'#39;
Edit1 := TEdit.Create(Setup);
Edit1.Parent := Setup;
Edit1.Left := 220;
Edit1.Top := 54;
Edit1.Width := 90;
Edit1.Height := 22;
Edit1.Font.Color := clWindowText;
Edit1.Font.Height := -11;
Edit1.Font.Name := 'Arial';
Edit1.Font.Style := [fsBold];
Edit1.ParentFont := False;
Edit1.TabOrder := 8;
Edit1.Text := 'Oak';
Edit2 := TEdit.Create(Setup);
Edit2.Parent := Setup;
Edit2.Left := 220;
Edit2.Top := 105;
Edit2.Width := 25;
Edit2.Height := 21;
Edit2.OEMConvert := True;
Edit2.TabOrder := 9;
Edit2.Text := '4';
Button1 := TButton.Create(Setup);
Button1.Parent := Setup;
Button1.Left := 120;
Button1.Top := 139;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Ok, Start';
Button1.ModalResult := 1;
Button1.TabOrder := 10;
end;
Procedure Convert2;
Begin
NameofTree := Edit1.text
Loads := StrToInt(Edit2.text)
end;
//[][][][][][][][][][][][][][][][][][][][]
//MySetup <==============================
//[][][][][][][][][][][][][][][][][][][][]
Procedure MySetup;
Begin
SetupSrl;
UseBoxSolver := True
wait(10)
UseCerterSolver := True
wait(10)
UseSandwichSolver :=True
ClearDebug;
cx:=x;
cy:=y;
end;
//[][][][][][][][][][][][][][][][][][][][]
//Second Setup <=========================
//[][][][][][][][][][][][][][][][][][][][]
Procedure SecondSetup;
Begin
If NameofTree = ('Oak') then
TreeColor := (2252880)
If NameofTree = ('Willow') then
TreeColor := (1982520)
If NameofTree = ('Tree') then
TreeColor := (1730648)
//------------------------------//
If NameofTree = ('Oak') then
InvColor := (3694460)
If NameofTree = ('Willow') then
InvColor := (2051414)
If NameofTree = ('Tree') then
InvColor := (3430514)
WriteLn('You are cutting a[n] '+(NameofTree) + ' and the color of it is ' +IntToStr(TreeColor) + '.')
WriteLn('You are cutting '+ InttoStr(Loads) +' loads of logs.')
end;
//[][][][][][][][][][][][][][][][][][][][]
//AntiBan Procedure <====================
//[][][][][][][][][][][][][][][][][][][][]
Procedure MyAntiban;
Begin
GameTab(1+Random(7))
Wait(2000+Random(1000)+Random(500))
MMouse(200,200,300,300)
If (2+random(3)=4) then
Begin
GetSkillLevel('Woodcutting')
If (2+random(3)=3) then
Begin
GetXp('Woodcutting')
end;
end;
end;
//[][][][][][][][][][][][][][][][][][][][]
//AntiRandoms Procedure <================
//[][][][][][][][][][][][][][][][][][][][]
Procedure MyAntiRandoms;
Begin
FindNormalRandoms;
wait(10)
wait(10)
FindMaze;
wait(10)
Solvepinball;
Wait(10)
if (FindFight) then
begin
RunAwayDirection('E');
Wait(8500 + random(3500));
RunBack;
end;
Wait(10);
FindTalk;
end;
//[][][][][][][][][][][][][][][][][][][][]
//Chopping Procedure <===================
//[][][][][][][][][][][][][][][][][][][][]
Procedure Chopping;
Begin
Repeat
If FindObj(x,y,NameofTree,TreeColor,3) then
Begin
Mouse(x,y,1,1,true)
wait(100)
MyAntiRandoms;
ChooseOption(x,y,'Chop')
MyAntiRandoms;
MyAntiBan;
Wait(6000+random(3000))
If(Not(LoggedIn)) then NextPlayer(False);
end;
Until InvFull;
end;
//[][][][][][][][][][][][][][][][][][][][]
//Droping Procedure <====================
//[][][][][][][][][][][][][][][][][][][][]
Procedure Drop;
Begin
Repeat
ClickItemColorTol(InvColor,4,False)
ChooseOption(x,y,'Drop')
Wait(800+random(200)+random(200))
MyAntiRandoms;
Until (CountItemColorTol(InvColor,4)<Random(4))
Loats:=Loats+1
End;
//[][][][][][][][][][][][][][][][][][][][]
//MAIN THING <===========================
//[][][][][][][][][][][][][][][][][][][][]
Begin
MySetup;
SafeInitForm;
SafeShowFormModal;
Convert2;
DeclarePlayers;
SecondSetup;
Loats:=0
Wait(3000+random(1000))
LoginPlayer;
Repeat
Repeat
MakeCompass('N')
HighestAngle;
Chopping;
If(Not(LoggedIn)) then NextPlayer(False);
Drop;
SrlRandomsReport;
Until (Loads = Loats)
NextPlayer(True)
Loats:=0
If(Not(LoggedIn)) then NextPlayer(False);
Until False;
end.
//THANK YOU ALL!
//Fours.
//Credits will go to EVERYONE in the SRL community. Yohojo8. I took up
//alot of his time and he put up with me. Charms. Procedures and scripts
//helped me alot in learning SRL and SCAR procedures/function.


