Results 1 to 15 of 15

Thread: Using an array for finding goblins

  1. #1
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Using an array for finding goblins

    Someone modified my original procedure, and it changed it into an array. I get an error when I use it. I'll attach the script. The procedure is Fight.
    Thank you
    Quote Originally Posted by The Un-Named View Post
    You can do this a few times before mods catch on...

    "oh fuck, I think the icecream truck just knocked a kid over, brb".

  2. #2
    Join Date
    Sep 2007
    Location
    newcastle australia
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    firstly, NEVER declare x and y as variables in your scripts, its almost always used in an include and will create a duplicate variable error, im still looking at the script so ill get back to you in a few minutes re: fixing it.
    edit: in the procedure "walk" you dont have enough end; statements.
    2nd edit: you didnt put the x,y coords for "chooseoption" in.
    3rd edit: i dont really know much about the chooseoption procedure(im guessing its srl)
    however i believe it incorporates a mouse movement to the x,y location, so for this part of your script:

    Mouse(x, y, 1, 3, false);
    ChooseOption('ttack');
    the mouse command is redundant, i changed it to(note: i also changed the variables using the edit>replace tool so it wouldnt conflict with includes)

    ChooseOption(xx,yy,'ttack');

    note: when ive finished fixing this script ill re-upload it and you can compare the 2 to see what you did wrong, ill list most of them here.

    LAST EDIT:
    all finished, here is your working script
    note: i didnt test it in game.

  3. #3
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    As a side not, X and Y are not global variables in SRL, so you are right in declaring them if you want to use them, HairyDuncan2
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  4. #4
    Join Date
    Sep 2007
    Location
    newcastle australia
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Starblaster100 View Post
    As a side not, X and Y are not global variables in SRL, so you are right in declaring them if you want to use them, HairyDuncan2
    evidently they were used somewhere, otherwise i wouldnt have gotten:

    Failed when compiling
    Line 8: [Error] (14861:1): Duplicate identifier 'x' in script C:\Program Files\SCAR 3.11\Scripts\autofighter.scar

  5. #5
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    You are using an old version of SRL (3.81 which is auto downloaded through SCAR). Download SRL 4 beta from this site and install that, otherwise he'll be getting errors when he tries compiling the script.
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  6. #6
    Join Date
    Sep 2007
    Location
    newcastle australia
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh alright, sorry about that
    regardless, that script will work anyways as i only changed the name of a few variables as well as minor syntax errors and redundancy errors.
    unless chooseoption has been changed?

  7. #7
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    yup chooseoption has also been changed

  8. #8
    Join Date
    Sep 2007
    Location
    newcastle australia
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    in that case, completely disregard that script, ill fix it for you tomorrow, gotta go sleep now.

  9. #9
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by elementalelf View Post
    in that case, completely disregard that script, ill fix it for you tomorrow, gotta go sleep now.
    Haha, okey dokey.
    Thank's for trying.
    Hope to talk to you soon.
    Quote Originally Posted by The Un-Named View Post
    You can do this a few times before mods catch on...

    "oh fuck, I think the icecream truck just knocked a kid over, brb".

  10. #10
    Join Date
    Sep 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    kewl idea

  11. #11
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ninja iwk View Post
    kewl idea
    What is??
    Quote Originally Posted by The Un-Named View Post
    You can do this a few times before mods catch on...

    "oh fuck, I think the icecream truck just knocked a kid over, brb".

  12. #12
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ive made the script compile for you, test it to make sure it is still working.
    I have also added some SRL Offical Scripting Standards to it.

    Good job on script and good luck.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  13. #13
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by rogeruk View Post
    Ive made the script compile for you, test it to make sure it is still working.
    I have also added some SRL Offical Scripting Standards to it.

    Good job on script and good luck.
    Mate, your a lifesaver. Thanks alot. Means heaps.
    Sorry about the standards. I'm trying to learn them. To me they're even harder then learning to script. I'll be right.
    It worked exactly as it should've.
    Did you identify the problem? Just curious, it doesn't really matter.
    Thanks again.

    Quote Originally Posted by The Un-Named View Post
    You can do this a few times before mods catch on...

    "oh fuck, I think the icecream truck just knocked a kid over, brb".

  14. #14
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No problem,


    SCAR Code:
    ChooseOption(xx,yy,'ttack');

    Was one of your problems, you were using an old version of the function.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  15. #15
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by rogeruk View Post
    No problem,


    SCAR Code:
    ChooseOption(xx,yy,'ttack');

    Was one of your problems, you were using an old version of the function.
    Oh yeah.
    Well, thanks again.
    Quote Originally Posted by The Un-Named View Post
    You can do this a few times before mods catch on...

    "oh fuck, I think the icecream truck just knocked a kid over, brb".

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Array in an array...
    By Lorax in forum OSR Advanced Scripting Tutorials
    Replies: 20
    Last Post: 01-16-2010, 09:10 PM
  2. Replies: 3
    Last Post: 09-23-2008, 03:37 AM
  3. ItemColors: Array of Array of Integer
    By n3ss3s in forum Research & Development Lounge
    Replies: 5
    Last Post: 10-30-2007, 06:04 PM
  4. Array of Tbox - And TPoint array helps.
    By R0b0t1 in forum OSR Help
    Replies: 4
    Last Post: 06-10-2007, 06:43 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
  •