Results 1 to 4 of 4

Thread: Need Help With My Power Chopper I Made!

  1. #1
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need Help With My Power Chopper I Made!

    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.
    Woot woot.

  2. #2
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OMG Somone help me, this post had been here for like 1 hour already, and there were like 8 people on the Scripting help section...
    Woot woot.

  3. #3
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Although learning to fix errors on your own is a huge part of scripting I will help you anyway
    1. "EntsAvoided" (lines 8) is already in SRL. No need to declare it (jus take it out).
    2. "RunAway(EntRun);" (line 249) should be "RunAwayDirection(x, y, EntRun);"
    3. "RunBack" (line 251) should then be "RunBack(x, y);"
    4. "If(FoundFight)Then" (line 264) should be "If(FindFight)Then"
    5. Again "RunAway(FightRun);" (line 266) should be "RunAwayDirection(x, y, FightRun);"
    6. And "RunBack;" (line 268) should then be "RunBack(x, y);"
    7. "DropToPos(2, 28);" (line 302) should be "DropToPosition(2, 28);"
    8. "WriteLn('Made By U L T R A.';" (line 314) is missing an end parenthesis.
    9. That's it!

  4. #4
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks alot dude, but i think i was ahead of you, i used the search button and also looked over the script my self. Anyways thanks dude.
    Woot woot.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Power chopper
    By smartshark in forum RS3 Outdated / Broken Scripts
    Replies: 1
    Last Post: 11-25-2007, 11:35 PM
  2. First Power Chopper
    By Jahooma in forum First Scripts
    Replies: 0
    Last Post: 10-09-2007, 12:30 AM
  3. My First Power Chopper
    By destroyface in forum First Scripts
    Replies: 4
    Last Post: 09-12-2007, 11:35 AM
  4. Power Chopper
    By Pwnt by Pwnt in forum RS3 Outdated / Broken Scripts
    Replies: 64
    Last Post: 08-02-2007, 02:46 PM
  5. R3v Power Chopper
    By R3velati0n in forum RS3 Outdated / Broken Scripts
    Replies: 27
    Last Post: 01-30-2007, 03:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •