Results 1 to 16 of 16

Thread: Duplicate identifier Error

  1. #1
    Join Date
    Apr 2007
    Location
    South-West
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Duplicate identifier Error

    uhhhhhh i keep getting this error:

    [H]Line 8: [Error] (15340:1) : duplicate identifier ' ' in C:/Program Files\Scar 3.06\Scripts\practice (power miner)[/H]

    heres the full script

    SCAR Code:
    program PowerMiner;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/Mining.scar}
    var
    z,c:integer;
    Const
    OreColor=4211015:5789794;\\this is the line it said i had a error on while i was programing on SCAR 2.06
     begin \\this is the line it says i have the error
    if(FindColor(z,c,OreColor,0,0,100,100)) then
     Begin
      MoveMouseSmoothEx(z,c+random(5),20,40,45,25,20);
      wait(100+random(10));
      ClickMouse(z,c,true);
     end;
    end.

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    SCAR Code:
    program PowerMiner;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/Mining.scar}
    var
    z,c:integer;
    Const
    SoulOreColor=4211015;


     begin
    if(FindColor(z,c,OreColor,0,0,100,100)) then
     Begin
      MoveMouseSmoothEx(z,c+random(5),20,40,45,25,20);
      wait(100+random(10));
      ClickMouse(z,c,true);
     end;
    end.

    OreColor is a variable already named in SRL, so just changed the name.
    You also defined it wrong, i think you put like 2 colors?
    Well it can just be 1 color folowed by a ;.

    Enjoy,
    Yohojo

  3. #3
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    OreColor=4211015:5789794;
    lol u cant put a : in the middle of a constant you have to make two seperant ones for different colors

  4. #4
    Join Date
    Apr 2007
    Location
    South-West
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    im a noob at this kind of stuff so dont get mad at me but i got it all to compile but once it compiles it goes str8 to executing >_> *turns bright red* i'm new to programing and stuff but im going to be going to school for Game Programming next year so im trying to figure this out cuz it'll give me an idea for C++ and Java

  5. #5
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    show us ur mainloop and make sure you have the RS screen targetted using the target thingy, I think I may know what's wrong
    Sleeping...

  6. #6
    Join Date
    Apr 2007
    Posts
    220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by rkroxpunk View Post
    show us ur mainloop and make sure you have the RS screen targetted using the target thingy, I think I may know what's wrong
    He posted his mainloop... it ends with end. so its his main loop or he just put a . in it in stead of ;
    But maybe it is his mainloop BTW Its just his color constant. Don't put a ":" in a color

  7. #7
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    rofl my bad lol didn't look properly....well firstly u need SetupSRL and SetupSRLMining; at the start of ur main loop. the after that put
    ActivateClient;
    Wait(1000)

    Should look something like this

    SCAR Code:
    program PowerMiner;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/Mining.scar}
    var
    z,c:integer;
    Const
    OreColor=4211015:5789794;\\this is the line it said i had a error on while i was programing on SCAR 2.06
     
    begin \\this is the line it says i have the error
      SetupSRL;
      SetupSRLMining;
      ActivateClient;
      Wait(1000)
      if(FindColor(z,c,OreColor,0,0,100,100)) then
      Begin
        MoveMouseSmoothEx(z,c+random(5),20,40,45,25,20);
        wait(100+random(10));
        ClickMouse(z,c,true);
      end;
    end.

    and Fearless I think he fixed his problem and now was getting this because he wasn't getting the error anymore :P
    Sleeping...

  8. #8
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    SCAR Code:
    program PowerMiner;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/Mining.scar}
    var
    z,c:integer;
    Const
    SoulOreColor=4211015;
     
     
     begin
    if(FindColor(z,c,OreColor,0,0,100,100)) then
     Begin
      MoveMouseSmoothEx(z,c+random(5),20,40,45,25,20);
      wait(100+random(10));
      ClickMouse(z,c,true);
     end;
    end.

    OreColor is a variable already named in SRL, so just changed the name.
    You also defined it wrong, i think you put like 2 colors?
    Well it can just be 1 color folowed by a ;.

    Enjoy,
    Yohojo
    hehe, your forgot to change orecolor to soul orecolor in the finding procedure, and also dont use movemoustsmoothex or clickmousem, they'll get you banned so fast. use Mouse(x, y, randx, randy : integer; left : boolean); (movesmouse and clicks) MMouse(x, y, randx, rany); to just move mouse,

    SCAR Code:
    program PowerMiner;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/Mining.scar}
    var
    z,c:integer;
    Const
    SoulOreColor=4211015;
     
     
    begin
    SetupSRL;
    SetupSRLMining;
    ActivateClient;
    Wait(1000);
    if(FindColor(z,c,SoulOreColor,0,0,100,100)) then
     Begin
       Mouse(z, c, 2, 2, True);
     end;
    end.

  9. #9
    Join Date
    Apr 2007
    Location
    South-West
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well i fixed it and all... i added a loop (this is all just practice to me till i know what im doing) and thank you to those who took time to help me but now i got another problum -.- i programed it to move the mouse over the ore and click (even if its not that much coding) and it just compiles then Executes which i know means that the coding is correct heres the script
    SCAR Code:
    program PowerMiner;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/Mining.scar}
    var
    z,c:integer;
    i:integer;
    Const
    TinOreColor1=4211015;
    TinOreColor2= 5789794;
      Begin
     i:=0
      repeat
     i:=i+1;
    if(FindColor(z,c,TinOreColor1,0,0,100,100))THEN
      Begin
      MoveMouseSmoothEx(z,c+random(5),20,40,45,25,20);
      wait(100+random(10));
      ClickMouse(z,c,true);
    end;
    until(i>=10);
    end.

    and yeah i kinda know its a nooby script but its my first... i'll probably add more stuff once i get it to actualy mine 0.0

  10. #10
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    its not finding the tinorecolor
    and also do not use MoveMouseSmoothEx and ClickMouse

    use

    MMouse(x, y, randx, rany) - Moves Mouse
    Mouse(x, y, randx, rany, True) - Moves and Clicks Mouse

  11. #11
    Join Date
    Apr 2007
    Location
    South-West
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)
    yeah i tried those... i think its just the coding... ima try to re-code it maybe i can figure it out anyways i'll keep ya up 2 date with it

    ok heres Whats happening now... my curser gets stuck in the far upper left corner and i have no clue why... i set the color and everything is working correct accept that -.-

    i even tried to take out my veriable and same thing... i wrote in the coords and same thing... (im such a horrible programmer )

  12. #12
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    reselect the rs window? if that doesn't work repost your code that you have now =)

  13. #13
    Join Date
    Apr 2007
    Location
    South-West
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default -.- it keeps going to the upper left hand corner

    heres the script it wont click on the rocks for nothin >_>

    SCAR Code:
    program PowerMiner;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/Mining.scar}
    var
    z,c:integer;
    i:integer;
    Const
    TinOreColor1=4211015;
    TinOreColor2= 5592415;

    procedure Mine;
    begin
    i:=0;
    repeat
    i:=i+1
    if(FindColor(
    MMouse(x,y,0,0);
    wait(100+random(50));
    Mouse(x,y,0,0,true);
    until(InvFull);
    end;
    procedure Drop;
    begin
    DropAll;
    end;
    begin
    SetupSRL;
    repeat
    Mine;
    Drop;
    until(i >=10);
    end.

    P.S. theres alot of useless junk in there for later >_>

  14. #14
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    got to add begin and ends to it, or else the if will only do the frist line, then the script automatically does the rest

    SCAR Code:
    if (FindColor(wheres your findcolor procedure at?) then
    begin
      MMouse(x,y,0,0);
      wait(100+random(50));
      Mouse(x,y,0,0,true);
    end;

  15. #15
    Join Date
    Apr 2007
    Location
    South-West
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  16. #16
    Join Date
    Apr 2007
    Location
    South-West
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Duplicate Identifier Error
    By A G E N T in forum OSR Help
    Replies: 7
    Last Post: 02-13-2007, 01:46 AM
  2. Duplicate Identifier Error
    By I Karma I in forum OSR Help
    Replies: 6
    Last Post: 12-05-2006, 11:55 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
  •