Results 1 to 6 of 6

Thread: Until?

  1. #1
    Join Date
    Mar 2009
    Location
    About six feet off the ground.
    Posts
    95
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Until?

    Can I make a script wait until a bitmap shows up on the screen?

    If so, would it look like this?

    SCAR Code:
    program Help;
    {.include SRL/SRL.scar}
    var
      x, y, Bitmap: Integer;
    begin
    procedure DeclareBMP;
    begin
      Bitmap := BitmapFromString(73, 1, 'beNo7seTOqZVo6NaJJUAEYWC' +
           'VRVOG3wRchsARGherOAMDA1YFEHTz2GK4wxAKAIazpPE=');
    end;
    procedure WaitForBitmap;
    begin
      if not FindBitmap(Bitmap, x, y) then
        repeat
          Wait(10);
        until(FindBitmap(Bitmap, x, y) true);
    end;
    begin
      DeclareBMP;
      WaitForBitmap;
    end.
    ~Zeek
    Last major script: November 2009
    Attempted to rejoin: January 2011
    Rejoining: [][][][][]
    Current task: writing basic alching script

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

    Default

    Yes. But if youre using it in a script, you'd want failsafes of course - for example, to break out of the loop if the bitmap hasnt appeared after a certain time

  3. #3
    Join Date
    Mar 2009
    Location
    About six feet off the ground.
    Posts
    95
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Understood.
    That being said, I'm not entirely sure on how to put a failsafe like that into a script.
    Would it be a new procedure entirely or a boolean statement?
    ~Zeek
    Last major script: November 2009
    Attempted to rejoin: January 2011
    Rejoining: [][][][][]
    Current task: writing basic alching script

  4. #4
    Join Date
    Mar 2009
    Location
    Ireland
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    program Help;
    {.include SRL/SRL.scar}
    var
      x, y, Bitmap: Integer;
    begin
    procedure DeclareBMP;
    begin
      Bitmap := BitmapFromString(73, 1, 'beNo7seTOqZVo6NaJJUAEYWC' +
           'VRVOG3wRchsARGherOAMDA1YFEHTz2GK4wxAKAIazpPE=');
    end;
    procedure WaitForBitmap;
    Var
      T:integer;      //declares a variable to hold the time
    begin
      MarkTime(T);     //sets T to current time
      if not FindBitmap(Bitmap, x, y) then
        repeat
          Wait(10);
        until((FindBitmap(Bitmap, x, y) true) or (TimeFromMark(T) > 20000));    //repeats until the bitmap is found or its been 20 seconds
    end;
    begin
      DeclareBMP;
      WaitForBitmap;
    end.
    A simple failsafe to break the loop if the bitmap is not found in 20 seconds.

  5. #5
    Join Date
    Mar 2009
    Location
    About six feet off the ground.
    Posts
    95
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I've got another question (or so) that I'd rather post here than in a new thread:
    Is there a "MakeCompass" procedure or function that will make the compass automatically North?
    Also, is there a procedure or function that I can make hold the up arrow so that the RS window is at its highest?


    EDIT: Rofl!! I just looked at the SRL Manual. I feel dumb now.
    Last edited by zeeky111; 04-08-2009 at 03:32 AM. Reason: EDIT:
    ~Zeek
    Last major script: November 2009
    Attempted to rejoin: January 2011
    Rejoining: [][][][][]
    Current task: writing basic alching script

  6. #6
    Join Date
    Mar 2009
    Location
    Ireland
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    to make the compass north

    Code:
    MakeCompass('n');
    to make the camera angle highest
    Code:
    SetAngle(True);
    or to make the camera angle lowest!!!
    Code:
    SetAngle(False);

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
  •