Results 1 to 3 of 3

Thread: [R] Function R_RestUntil

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

    Default [R] Function R_RestUntil

    SCAR Code:
    Function R_RestUntil(EnergyS: Integer): Boolean;
     Var
      EnergyNow: Integer;
    Begin
      EnergyNow := R_GetMMLevels('energy');
      Result := EnergyNow >= EnergyS;
      If (Result) Then Exit;
      SetRest;
      While (R_GetMMLevels('energy') < EnergyS) Do
        wait(50+ Random(50));
    End;

    Uses reflection.

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

  2. #2
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by rogeruk View Post
    SCAR Code:
    Function R_RestUntil(EnergyS: Integer): Boolean;
     Var
      EnergyNow: Integer;
    Begin
      EnergyNow := R_GetMMLevels('energy');
      Result := EnergyNow >= EnergyS;
      If (Result) Then Exit;
      SetRest;
      While (R_GetMMLevels('energy') < EnergyS) Do
      Begin
        wait(50+ Random(50));
      End;
    End;

    Uses reflection.
    Shortened too

    SCAR Code:
    Function R_RestUntil(EnergyS: Integer): Boolean;
     Var
      EnergyNow: Integer;
    Begin
      EnergyNow := R_GetMMLevels('energy');
      Result := EnergyNow >= EnergyS;
      If (Result) Then Exit;
      SetRest;
      While (R_GetMMLevels('energy') < EnergyS) Do
        wait(50+ Random(50));
    End;

    Nice job though

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

    Default

    Ta forgot to remove the begin and end i have other procedures running while its waiting.

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

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
  •