Hey iam currently working on a power chopper but i get errors, so yeah please help me
.
SCAR Code:
Program PowerChopper;
{.Include SRL/SRL.Scar}
Var
TreeTypeName : String;
TreeTypeColor : Integer;
LogsCut : Integer;
LoadsCut : Integer;
EntsAvoided : Integer;
FightsAvoided : Integer;
Responded : Integer;
X, Y : Integer;
Const
Yew = 2184775;
Willow = 2332288;
Oak = 2188891;
Tree = 4483941;
Version = '1.0';
{SET UP HERE}
Const
LoadsToCut = 10;//How Many Loads Of Logs You Want To Cut.
TreeTolerance = 5;//Tolerance Of The Tree.
EntRun = 'E';//What Direction To Run Away To, If Found Ent.
FightRun = 'E';//What Direction To Run Away To, If Found Fight.
TreeType = 'Willow';//Yew, Willow, Oak, Tree. Capitalized.
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //username
Players[0].Pass := ''; //password
Players[0].Nick := ''; //3-4 letters from your username
Players[0].Active := True;
End;
Procedure DeclareTreeType;
Begin
If(TreeType = 'Yew')Then
Begin
TreeTypeName := 'ew';
TreeTypeColor := Yew;
End Else
If(TreeType = 'Willow')Then
Begin
TreeTypeName := 'illo';
TreeTypeColor := Willow;
End Else
If(TreeType = 'Oak')Then
Begin
TreeTypeName := 'ak';
TreeTypeColor := Oak;
End Else
If(TreeType = 'Tree')Then
Begin
TreeTypeName := 'ree';
TreeTypeColor := Tree;
End;
End;
{Procedure: TypeSendRandom}
{Made By: U L T R A.}
{Description: Types one of the three messages you chose to be randomly typed.}
{Credits: Who Ever Made TypeSend.}
Procedure TypeSendRandom(FirstWord, SecondWord, ThirdWord : String);
Begin
Case Random(3)Of
0:Begin
TypeSend(FirstWord);
End;
1:Begin
TypeSend(SecondWord);
End;
2:Begin
TypeSend(ThirdWord);
End;
End;
End;
{Procedure: AutoResponder}
{Made By: U L T R A.}
{Description: Talks back to people if they say/ask you something.}
{Credits: Who Ever Made Procedure/Function InChat.}
{Version: 1.3}
Procedure AutoResponder;
Begin
If (InChat('Hi')Or
InChat('Hey')Or
InChat('Hello')Or
InChat('Yo')Or
InChat('Hi man')Or
InChat('Hey man')Or
InChat('Yo man')Or
InChat('Hi dude')Or
InChat('Hey dude')Or
InChat('Yo dude')Or
InChat('Himan')Or
InChat('Heyman')Or
InChat('Yoman')Or
InChat('Hidude')Or
InChat('Heydude')Or
InChat('Yodude'))Then
Begin
TypeSendRandom('Hui there', 'hry', 'hrllo');
Responded := Responded + 1;
End;
If (InChat('Wats up')Or
InChat('Was up')Or
InChat('Wat up')Or
InChat('Wus up')Or
InChat('Wut up')Or
InChat('Wuts up')Or
InChat('Waz up')Or
InChat('Wazz up')Or
InChat('Wuz up')Or
InChat('Wuzz up')Or
InChat('Wats up man')Or
InChat('Wuz up man')Or
InChat('Wuts up man')Or
InChat('Wut up man')Or
InChat('Wuz up man')Or
InChat('Wats up dude')Or
InChat('Wuz up dude')Or
InChat('Wut up dude')Or
InChat('Wt up dude')Or
InChat('Wz up dude'))Then
Begin
TypeSendRandom('Nothing', 'Not much', 'Bored');
Responded := Responded + 1;
End;
If (InChat('?')Or
InChat('!')Or
InChat('.')Or
InChat('?!')Or
InChat('!?'))Then
Begin
TypeSendRandom('What', 'Huh', 'Erm');
Responded := Responded + 1;
End;
If (InChat('Lol')Or
InChat('Lolz')Or
InChat('Lols')Or
InChat('Loll')Or
InChat('Rofl')Or
InChat('Roflmao')Or
InChat('Roflmafao')Or
InChat('Lmao')Or
InChat('Lmfao')Or
InChat('Omg')Or
InChat('Omfg')Or
InChat('Oh my god')Or
InChat('God')Or
InChat('Wtf')Or
InChat('Wtf lol'))Then
Begin
TypeSendRandom('haha', 'hehe', 'funny');
Responded := Responded + 1;
End;
If (InChat('Highest levels')Or
InChat('Highest levels?')Or
InChat('Highest lvls')Or
InChat('Highest lvls?')Or
InChat('Best levels')Or
InChat('Best levels?')Or
InChat('Best lvls')Or
InChat('Best lvls?')Or
InChat('What are your highest levels?')Or
InChat('What are your best levels?')Or
InChat('What are your highest lvls?')Or
InChat('What are your best lvls?')Or
InChat('Best level?')Or
InChat('Highest level?')Or
InChat('Best lvl?')Or
InChat('Highest lvl?'))Then
Begin
TypeSendRandom('I dono', 'Wc', 'Str');
Responded := Responded + 1;
End;
If (InChat('Attack levels')Or
InChat('Attack lvls')Or
InChat('Att levels')Or
InChat('Att lvls')Or
InChat('Attack level')Or
InChat('Att lvl')Or
InChat('Attack levels?')Or
InChat('Attack lvls?')Or
InChat('Att levels?')Or
InChat('Att lvls?')Or
InChat('Attack level')Or
InChat('Attack lvl')Or
InChat('Att level')Or
InChat('Att lvl'))Then
Begin
TypeSendRandom(IntToStr(GetSkillLevel('attack')), 'Me ' + IntToStr(GetSkillLevel('attack')), 'Iam ' +IntToStr(GetSkillLevel('attack')));
Responded := Responded + 1;
End;
If (InChat('Strength levels')Or
InChat('Strength lvls')Or
InChat('Strength levels?')Or
InChat('Strength lvls?')Or
InChat('Str levels')Or
InChat('Str lvls')Or
InChat('Str levels?')Or
InChat('Str lvls?')Or
InChat('Str level')Or
InChat('Str lvl')Or
InChat('Strength level')Or
InChat('Strength lvl'))Then
Begin
TypeSendRandom(IntToStr(GetSkillLevel('strength')), 'Me ' + IntToStr(GetSkillLevel('strength')), 'Iam ' + IntToStr(GetSkillLevel('strength')));
Responded := Responded + 1;
End;
If (InChat('Wc levels')Or
InChat('Wc lvls')Or
InChat('Wc levels?')Or
InChat('Wc lvls?')Or
InChat('Woodcutting levels')Or
InChat('Woodcutting lvls')Or
InChat('Woodcutting levels?')Or
InChat('Woodcutting lvls?')Or
InChat('Wc level')Or
InChat('Wc lvl')Or
InChat('Wc level?')Or
InChat('Wc lvl?')Or
InChat('Woodcutting level')Or
InChat('Woodcutting lvl')Or
InChat('Woodcutting level?')Or
InChat('Woodcutting lvl?'))Then
Begin
TypeSendRandom(IntToStr(GetSkillLevel('woodcutting')), 'Me ' + IntToStr(GetSkillLevel('woodcutting')), 'Iam ' + IntToStr(GetSkillLevel('woodcutting')));
Responded := Responded + 1;
End;
End;
Function SolveEnt : Boolean;
Begin
If(FindColorTolerance(x, y, 56797, 25, 16, 99, 17, 5))And(IsUpText(TreeTypeName))Then
Begin
WriteLn('Found Ent!');
RunAway(EntRun);
Wait(10000+random(5000));
RunBack;
EntsAvoided := EntsAvoided + 1;
Result := True;
End Else
Result := False;
End;
Procedure FindRandoms;
Begin
FindNormalRandoms;
SolveEnt;
AutoResponder;
Begin
If(FoundFight)Then
FightsAvoided := FightsAvoided +1;
RunAway(FightRun);
Wait(10000+random(5000));
RunBack;
End;
End;
Procedure TextWait;
Begin
Repeat
Wait(500+random(500));
SolveEnt;
FindRandoms;
Until(Not(IsUpText(TreeTypeName)))Or(SolveEnt = True)Or(Not(LoggedIn));
End;
Procedure Cut;
Begin
If(FindObj(x, y, TreeTypeName, TreeTypeColor, TreeTolerance))Then
Begin
Mouse(x, y, 5, 5, True);
WriteLn('Clicked The ' + TreeType + '.');
TextWait;
SolveEnt;
FindRandoms;
End;
End;
Procedure MainCut;
Begin
Repeat
Cut;
SolveEnt;
FindRandoms;
Until(InvFull);
If(InvFull)Then
Begin
DropToPos(2, 28);
LogsCut := LogsCut + 27;
LoadsCut := LoadsCut + 1;
End;
End;
Procedure Report;
Begin
ClearDebug;
Begin
WriteLn('--------------------------------------------------------------------');
WriteLn('Power Chopper Version ' + Version + '.');
WriteLn('Made By U L T R A.';
WriteLn('--------------------------------------------------------------------');
WriteLn('Cut ' + IntToStr(LoadsCut) + ' Loads.');
WriteLn('Cut ' + IntToStr(LogsCut) + ' Logs.');
WriteLn('Avoided ' + IntToStr(EntsAvoided) + ' Ents.');
WriteLn('Avoided ' + IntToStr(FightsAvoided) + ' Fights.');
WriteLn('Responded ' + IntToStr(Responded) + ' Times.');
WriteLn('--------------------------------------------------------------------');
End;
End;
Begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
DeclareTreeType;
Begin
Repeat
Report;
MainCut;
SolveEnt;
FindRandoms;
Until(LoadsCut >= LoadsToCut)Or(Not(LoggedIn));
If(LoadsCut >= LoadsToCut)Or(Not(LoggedIn))Then
Begin
Report;
Exit;
TerminateScript;
End;
End;
End.
SCAR Code:
User specified a new RS window
Failed when compiling
Line 8: [Error] (15998:1): Duplicate identifier 'EntsAvoided' in script C:\Program Files\SCAR 3.13\Scripts\PowerChopper.scar
-Thanks alot, U L T R A.