Results 1 to 5 of 5

Thread: Using Procedures in Procedures?

  1. #1
    Join Date
    Oct 2007
    Location
    uuuuuuuu
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Using Procedures in Procedures?

    Here is a procedure;

    As you can see im trying to make my miner check for gas everytime its going to mine..

    procedure miner;
    begin
    MouseSpeed := 13;
    FindGas;
    findObj(x, y, 'Mine',Coal, 5)
    mouse(x, y, 1, 1, true);
    flag;
    repeat
    until findBlackChatMessage('You manage')
    end;


    Well whenever I try to do this, it gives me this error;
    Unknown identifier 'FindGas' in script

    I don't know why its doing this because I have a FindGas procedure.

  2. #2
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    is the findgas procedure above the checkgas procedure? i think that couses your error.

    if you don't want to move the procedure up: place this (in one of the first lines) in your script:

    SCAR Code:
    Procedure FindGas; Forward;

  3. #3
    Join Date
    Oct 2007
    Location
    uuuuuuuu
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I moved them around with no luck.. Im thinking its my standards and just put the FindGas in the Mainloop.

    All good,

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah, if you have something like this

    SCAR Code:
    Procedure Mine;
    Begin
    CheckGas;
    MineStuff;
    End;

    Procedure CheckGas;
    Begin
    BlaBlah...
    End;
    Then it'd give you error unknown identifier CheckGas.

    So you would have to have

    SCAR Code:
    Procedure CheckGas; Forward;

    Procedure Mine;
    Begin
    CheckGas;
    MineStuff;
    End;

    Procedure CheckGas;
    Begin
    BlaBlah...
    End;

    You have to have both of the CheckGas procedures. If that wasn't clear just post and i'll try to tell you clearer.

  5. #5
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Have you maybe mispelled the name in your FindGas procedure and instead put FindGsa or something or have you called it GasFinder and then tried to call FindGas?
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with procedures :s
    By Macro_FTW in forum OSR Help
    Replies: 1
    Last Post: 05-02-2007, 02:15 AM
  2. better procedures?
    By lilboy543 in forum OSR Help
    Replies: 3
    Last Post: 04-25-2007, 01:15 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
  •