Results 1 to 7 of 7

Thread: Help With a Procedure

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

    Default Help With a Procedure

    In my upcoming script, I am making two locations to walk to. How would I make the script walk to one of them randomly?

    (Ex: Player A walks to spot 1, but on second trip goes to spot two).
    Starting to merchant, if you know of any good clans, PM me please.

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

    Default

    first you need to get good with walking functions then use a case or something to randomise it

    eg
    Code:
    case for random(2) to
     begin
      1: procedure to walk to a
      2: procedure to walk to b.
    end;
    Hope this helps

  3. #3
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Dude View Post
    first you need to get good with walking functions then use a case or something to randomise it

    eg
    Code:
    case for random(2) to
     begin
      1: procedure to walk to a.
      2: procedure to walk to b.
    end;
    Hope this helps
    This actually WONT work because random(2) returns 0-1, not 1-2 .

    Just a small fix, but it would be
    SCAR Code:
    case for random(2) to
     begin
      0: procedure toWalkToA;
      1: procedure toWalkToB;
    end;

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

    Default

    If it's symbol based you can use FindSymbolIn.

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

    Default

    With using the small procedure, would I make the walking procedures functions or just leave them as procedures?
    Starting to merchant, if you know of any good clans, PM me please.

  6. #6
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Actually Its
    SCAR Code:
    case for random(1) to
     begin
      0: procedure toWalkToA;
      1: procedure toWalkToB;
    end;
    You should only change a procedure to funct if its nessary, functions are only diffrent to procedures because they can return things...

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

    Default

    K thanks all! Now I can finally start finishing my script!
    Starting to merchant, if you know of any good clans, PM me please.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Procedure?
    By shadowrec0n in forum OSR Help
    Replies: 3
    Last Post: 02-11-2008, 09:04 PM
  2. Procedure TypeSendRandom & Procedure AutoResponder!
    By Ultra in forum Research & Development Lounge
    Replies: 12
    Last Post: 01-08-2008, 07:04 PM
  3. Help with Procedure
    By Esteban in forum OSR Help
    Replies: 8
    Last Post: 07-06-2007, 03:45 AM
  4. Replies: 8
    Last Post: 05-24-2007, 11:57 PM
  5. Procedure that calls random procedure?
    By Secet in forum OSR Help
    Replies: 2
    Last Post: 03-03-2007, 03:56 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
  •