Results 1 to 8 of 8

Thread: Custom Wait (Dual purpose)

  1. #1
    Join Date
    Feb 2007
    Posts
    849
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Custom Wait (Dual purpose)

    Hey, I want a procedure that allows me to wait and check for randoms at the same time, so far i have...

    SCAR Code:
    procedure MyWait(t);


    lol, not much but i am relearning scar after doing alot of AS2.


    ***Edit
    Deleted other thread, made by accident.
    ________________________________________
    14:19 < cycrosism> I wonder what she would have done without it
    14:19 < cycrosism> without me*
    Cycrosism is now an it.
    Quote Originally Posted by Dervish View Post
    /Facedesk.

  2. #2
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    You could use a lot of different methods to do that. One way is using timers:

    SCAR Code:
    procedure MyWait(Time: Integer);
    var
      Marker: Integer;
    begin
      MarkTime(Marker);
      while (TimeFromMark(Marker) < Time) do
      begin
        Wait(50);
        FindNormalRandoms;
      end;
    end;

    You can change the wait time inside the loop, but the rest should work fine for you.
    :-)

  3. #3
    Join Date
    Feb 2007
    Posts
    849
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ah okay, thanks alot!

    I am doing this for my default save as
    I dont even know what script i will be making first.
    ________________________________________
    14:19 < cycrosism> I wonder what she would have done without it
    14:19 < cycrosism> without me*
    Cycrosism is now an it.
    Quote Originally Posted by Dervish View Post
    /Facedesk.

  4. #4
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    SCAR Code:
    procedure MyWait(Time : Integer);
    var
      StartTime : Integer;
    begin
      MarkTime(StartTime);
      while (TimeFromMark(StartTime) < Time) do
      begin
        Wait(100);
        FindNormalRandoms;
        if FindFight then RunAway('N', False, 1, 5000+random(1000));
      end;
    end;

    I think that will work??

    EDIT: omg Method beat me... i went to the bathroom...

    Edit2: fixed thnx senrath!

    Edit3: fixed for reals this time

  5. #5
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    SCAR Code:
    procedure MyWait(Time : Integer);
    var
      StartTime : Integer;
    begin
      MarkTime(StartTime);
      while (StartTime < Time) do
        Wait(100);
        FindNormalRandoms;
        if FindFight then RunAway('N', False, 1, 5000+random(1000));
    end;

    I think that will work??

    EDIT: omg Method beat me... i went to the bathroom...
    Yours wouldn't work, though, since StartTime would almost always be greater than Time, since it pulls system time. You'd need TimeFromMark(StartTime).

  6. #6
    Join Date
    Feb 2007
    Posts
    849
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    New thread.
    ________________________________________
    14:19 < cycrosism> I wonder what she would have done without it
    14:19 < cycrosism> without me*
    Cycrosism is now an it.
    Quote Originally Posted by Dervish View Post
    /Facedesk.

  7. #7
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    Edit2: fixed thnx senrath!
    Er, not quite. You had the MarkTime(StartTime) part correct. It's just you needed while(TimeFromMark(StartTime) < Time) do instead of while(StartTime < Time)

  8. #8
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    procedure FTWait(Time: Integer);
    By: WT-Fakawi
    Description:
    Performs Wait and FindTalk. Time is multiple of 250 msec, so FTWait(4)
    waits approx 1 sec and performs 4 FindTalks;
    This might also be useful.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. I just found out a Forums Bug! or is it purpose?
    By ub3r |<1||3r*1337* in forum News and General
    Replies: 3
    Last Post: 07-02-2006, 04:09 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
  •