Results 1 to 8 of 8

Thread: Duplicate Identifier?

  1. #1
    Join Date
    Jan 2007
    Location
    Skaville, Jamaica
    Posts
    1,117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Duplicate Identifier?

    I keep getting:

    Line 23: [Error] (17684:8): Duplicate identifier 'x' in script C:Program FilesSCAR 2.03ScriptsPowerchopper.scar

    that error in my script. How can I fix it?

    SCAR Code:
    program PowerChopper;
    //IIIIIIIII EEEEEEEEEE JJJJJJJJJJ BBBBBBB
    //   II     E              JJ     B      BB
    //   II     EEEEEE      JJ JJ     BBBBBBB
    //   II     E           JJ JJ     B      BB
    //IIIIIIIII EEEEEEEEEE   JJ       BBBBBBB

    //All credit goes to JAB!
    //Read his tutorial at [url]http://www.villavu.com/forum/showthread.php?t=6366[/url]
    //Have axe unequipped and in the first inventory slot.
    //Enjoy.  This is my first real Runescape script!
    //AntiRandoms, at least I think so :P
    //Post Progress Reports, or comments if you could.
    //You can stop script with the normal hotkeys or F12

    {.include SRL/SRL.scar}
    //If somebody reads this, does this need the woodcutting include?


    //Variables

    var
    Loads, x, y: integer;

    //Constants
    Const
    TreeColor = 0; //Set the Tree Color

    Procedure AntiRandoms;
    Begin
    FindTalk;
    FindNormalRandoms;
    if (FindFight = True) then
    begin
         RunAwayDirection('N');
         Wait(10000 + random(3000));
         RunBack;
         end;
    end;

    Procedure Cut;
    Begin
    Repeat
    if(FindColor(x,y,TreeColor,0,0,515,337))then
      MMouse(x,y,0,0);
      Wait(250+random(50));
      Mouse(x,y,0,0,true);
      Wait(500 + random(250));
    AntiRandoms;
    until(InvFull);
    end;

    Procedure Drop;
    Begin
    DropTo(2,28);
    Loads:=Loads+1;
    End;

    Procedure Prog;
    Begin
    ClearDebug;
         WriteLn('----->Welcome to my first Woodcutter!!<-----');
         WriteLn('                                            ');
         WriteLn('--------------------------------------------');
         WriteLn('------------->Progress Report<--------------');
         WriteLn('You have cut down' +IntToStr(Loads)+ 'loads!');
         WriteLn('---------->End of Progress Report<----------');
         WriteLn('--------------------------------------------');
    end;

    begin
    ActivateClient;
    SetupSRL;
         repeat
         if(not(LoggedIn))then
         Exit;
         Mine;
         Drop;
         ProgressReport;
    until(IsFKeyDown(12));
    end.

  2. #2
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Fixed for you

    Added optional wait time (to allow for the walking to the tree + cutting of difficult tree's, like oaks).

    Fixed compile errors.

  3. #3
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    423
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sp0rk-eh View Post
    Reserved for fix.
    Just for that im gunna try beat you to it :P

    edit: there were a few minor errors, look at the coments they explain what was wrong
    SCAR Code:
    program PowerChopper;
    //IIIIIIIII EEEEEEEEEE JJJJJJJJJJ BBBBBBB
    //   II     E              JJ     B      BB
    //   II     EEEEEE      JJ JJ     BBBBBBB
    //   II     E           JJ JJ     B      BB
    //IIIIIIIII EEEEEEEEEE   JJ       BBBBBBB

    //All credit goes to JAB!
    //Read his tutorial at <a href="http://www.villavu.com/forum/showthread.php?t=6366" target="_blank">http://www.srl-forums.com/forum/tut-...ner-t7368.html</a>
    //Have axe unequipped and in the first inventory slot.
    //Enjoy.  This is my first real Runescape script!
    //AntiRandoms, at least I think so :P
    //Post Progress Reports, or comments if you could.
    //You can stop script with the normal hotkeys or F12

    {.include SRL/SRL.scar}
    //If somebody reads this, does this need the woodcutting include?


    //Variables
    Var loads:integer;//  no need to declare x,y because there just like the standard variable, you didnt declare loads
    //Constants
    Const
    TreeColor = 0; //Set the Tree Color

    Procedure AntiRandoms;
    Begin
    FindTalk;
    FindNormalRandoms;
    if (FindFight = True) then
    begin
         RunAwayDirection('N');
         Wait(10000 + random(3000));
         RunBack;
         end;
    end;

    Procedure Cut;
    Begin
    Repeat
    if(FindColor(x,y,TreeColor,0,0,515,337))then
      MMouse(x,y,0,0);
      Wait(250+random(50));
      Mouse(x,y,0,0,true);
      Wait(500 + random(250));
    AntiRandoms;
    until(InvFull);
    end;

    Procedure Drop;
    Begin
    DropTo(2,28);
    Loads:=Loads+1;
    End;

    Procedure Prog;
    Begin
    ClearDebug;
         WriteLn('----->Welcome to my first Woodcutter!!<-----');
         WriteLn('                                            ');
         WriteLn('--------------------------------------------');
         WriteLn('------------->Progress Report<--------------');
         WriteLn('You have cut down' +IntToStr(Loads)+ 'loads!');
         WriteLn('---------->End of Progress Report<----------');
         WriteLn('--------------------------------------------');
    end;

    begin
    ActivateClient;
    SetupSRL;
         repeat
         if(not(LoggedIn))then
         Exit;
         Cut;//you had mine, you cut trees not mine them
         Drop;
         Prog;//you ask it to do progressreport but your progress report  procedure is called prog
    until(IsFKeyDown(12));
    end.

  4. #4
    Join Date
    Jan 2007
    Location
    Skaville, Jamaica
    Posts
    1,117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Please do fight over helping me

    var
    Loads, x, y: integer;
    It was there

    The other things I changed. I forgot to change them in the main loop. Thanks for your help!

  5. #5
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Heres the fixed + improved script. Good job on your first

  6. #6
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by meanage View Post
    Just for that im gunna try beat you to it :P

    edit: there were a few minor errors, look at the coments they explain what was wrong

    omg! lol, I reserved that place so I could fix it! You're such a meanieee!

    Well I improved it too >_> so I win.

  7. #7
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    423
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sp0rk-eh View Post
    omg! lol, I reserved that place so I could fix it! You're such a meanieee!

    Well I improved it too >_> so I win.
    you didnt explain what was wrong tho, it was a team effort:P btw have you made any scripts because ive seen you helping alot but no scripts

  8. #8
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, I make scripts for myself :P

    Hoping to become an srl member soon though, so I'll have to release a few :P

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Duplicate Identifier
    By iunseeni in forum OSR Help
    Replies: 2
    Last Post: 11-06-2007, 04:18 PM
  2. Duplicate Identifier
    By Jackrawl in forum OSR Help
    Replies: 9
    Last Post: 09-06-2007, 02:37 PM

Posting Permissions

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