Results 1 to 6 of 6

Thread: Beginnings of my first script

  1. #1
    Join Date
    Dec 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Beginnings of my first script

    Hi everyone, i just started writing a bow stringing script. So far i'm not very far, still creating all my procedures to be used within the body of my program. Right now i'm getting a 'Duplicate Identifier' Error on the line of the name of one of my procedures.

    Code done so far is as follows:
    SCAR Code:
    program BowStinger;
    {.include SRL\SRL.scar}
    Procedure DeclarePlayers;
    begin
      HowManyPlayers:=1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer:=0;
     
      Players[0].Name := 'PutUserNameHere';
      Players[0].Pass := 'PutPasswordHere';
      Players[0].Nick := 'PutPlayerNicknameHere';
      Players[0].Active:=True;
     
      end;
     
    Procedure LoadBitmaps;
     var
      BankerSmall,Longbowsmall,BowStringsSmall: Integer;
     
     begin
            BankerSmall := BitmapFromString(81, 1, 'z78DA33301805C31F00' +
           '00B3E05B21');
           Longbowsmall := BitmapFromString(78, 16, 'z78DAED99D172E320' +
           '0C457F498041F8D106FCFF9FB43788B6A4182F4976A6F6363CDC9' +
           '90A99C83A96644F89DEEBFF5C51B13756F4D4715A5E0D8B5E32CF' +
           'D17BC49FFC6CFC93272CDEE184AC234CC3CCCAE833E7242025889' +
           '3793A779C3B19CE1C45D5A222B1E8937958D91A233AC434D04CD3' +
           '493333F1625C58581BA3F027B9DF46739CEC6598E6AE5B982A4AD' +
           '7611A023BC40CAAFF2E66E9C0C25459C564C799D6D3F678F2E2F1' +
           '63EC76F42FD3BCD420326083E76DF7D9AB98428D31D171189BAD9' +
           '1396212897A4E1FBAE3F9C2EE2ED32533B57B4C236E15A7651DB1' +
           'BFCEF48EA0D8B38A673B7F85DDDDEE429E4CD7DF30088AD286B38' +
           'B62625AF833D8E96E9D1AF83ADC11C88AFF084DB9EAEEDAAC2D35' +
           'B1AB093DDE8DEFEEFC7AE672CCB4DD3DBEEA75A64FDA334DD19A7' +
           '5D75F981ECECD5EEF0553876760F94EA766DA52E8D169ED7555FE' +
           '3AA6353B61DADA1376A6BA4E33A37BA62E575080BFD11E794BC74' +
           'CA50317A646AD64BA4C73858E3315AD2DA7626A7FA44E9F629A34' +
           'D8AD6143DEACBA3128E7A405F94CC214ECE2E7391535D26AA6A15' +
           'E1A67D87DB15BD8B9B5D7BBB5A57D4286A69E436C3F5CA7A5B355' +
           'D3B037619FABD3727E661A35B2346D06F98C49A1F7AE21DEFCB54' +
           '3DED2F13B92A8546E2FCF6DDD890AAF9A69EDDFEE8ED31CFFEE10' +
           '76A2F5DB91D0DCA9EE5CA1A288CDC3A761FA71F47746DDDD11CF8' +
           'A69596269989655BF23ADB7AE8BDB82AAF455A7B264C216828D1E' +
           'E7B666D4A3D9FAEFD81F643A4256AAB8E63848D35FE39B0E3D791' +
           '1A6748BF802318FAFC2AEE9C30F9C70629A77DF32D54A947B6FAE' +
           '56C43D93A7F7BADA7F10304945378DB71D0C133F19AB2DAD348BB' +
           'EB374C9257356344F557D7B370AEFC43CBAFE000BE7C248');
             BowStringsSmall := BitmapFromString(73, 1, 'z78DA3330180543' +
           '0F000070405221');
     end;

    Procedure UseBank;
     var
      x,y,BankerHairColor : Integer;

     begin
      BankerHairColor :=7960962;
      if(findcolor(x,y,BankerHairColor,0,0,760,500))then
      begin
       movemousesmooth(x,y);
       wait(2000);
       clickmouse(x,y,False);
       end;
       
      end;
    Procedure OpenBank;
    if(findbitmap(BankerSmall,x,y))then
    begin
    movemousesmooth(x,y);
    clickmouse(x,y,True);
    end;
     

     
    begin
    LoadBitmaps;
    UseBank;
    OpenBank;
    end.

    and my error is as follows:

    SCAR Code:
    Line 66: [Error] (17727:11): Duplicate identifier 'OPENBANK' in script C:\Documents and Settings\Owner\Desktop\My First Scar Script\Bow Stringer.scar

    Thanks for any and all help that can get me moving forward on my script again.

  2. #2
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    There is already a procedure in SRL called openbank, so name yours MyOpenBank or something.

    Take out x,y they are already in SRL

    Don't use clickmouse and movemousesmootth, use mouse in SRL/core/MouseFlag.scar

    That bitmap is huge.

    I suggest you get more comfortable using SRL commands before writing an RS script, especially a p2p one. See part 1 of my FAQ (link in sig) for info on other games you can script for without getting banned in RS.

  3. #3
    Join Date
    Dec 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wow a lot to take in, thanks for everything though. I'll take your advice and work on a project that wont get my account banned :P and keep this one on the back burner. Again thanks for all your help

  4. #4
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Np. I know it's hard to resist the urge to write an RS script straight away, but you are doing the best thing by walking before running. Have fun.

  5. #5
    ronny.m.p Guest

    Default

    I feel the urge to make a cool line for Boreas's last post

    "It's not who i am but what i will become that that will allow me to overcome the obsticles i face that I currently see."
    That's skillz

  6. #6
    Join Date
    Oct 2006
    Posts
    189
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Also if I may make a sudjestion... Use DTM's for the bowstring... alot shorter... and DTM's work great for items in inv.
    thanks the scar noob, for the avatar, it rocks!

    my sig owns

Thread Information

Users Browsing this Thread

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

Posting Permissions

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