Results 1 to 5 of 5

Thread: timing

  1. #1
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default timing

    How do I do a procedure to run a script for only a certain amount of time. Does something like this work?

    SCAR Code:
    var
    CurrentTime:integer;

    const
    TotalTime=60000;  // time you want script to run for

    //my main procedures

    procedure timestuff;
    begin
    CurrentTime:=GetSystemTime;

    if (CurrentTime>TotalTime) then
      TerminateScript;
    end;

  2. #2
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Umm I think the command is KillScript(some or other params)

    EDIT : KillScript( hours ) (maybe make a function called milstomins(milis :integer)then
    say Killscript( hours + MilsToMins)

    Join the fastest growing merchanting clan on the the net!

  3. #3
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, thanks.

    What do I do for timing if I'm only timing how long until my char logs out and the next one logs in, so I don't want to kill the script yet?

  4. #4
    Join Date
    Jul 2006
    Location
    NY
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    MarkTime(time: integer);
    TimeFromMark(time: integer);
    Those are the procedure to use. Example script, made this off the top of my head, should compile.
    SCAR Code:
    procedure settime;
    var
      maxt: integer;
    begin
      MarkTime(maxt);
      repeat
         Writeln('waiting amout of time...');
      until (TimeFromMark(maxt) = 30000) //will wait for 30 secs
        Writeln('done waiting');
    end;
    Does this help?

  5. #5
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, Ill try that.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Timing?
    By marpis in forum OSR Help
    Replies: 7
    Last Post: 11-06-2008, 05:56 PM
  2. Drop timing ?????????
    By havoc928 in forum OSR Help
    Replies: 22
    Last Post: 08-22-2007, 07:06 PM
  3. Having Problem with login(timing)
    By jnwms in forum OSR Help
    Replies: 3
    Last Post: 08-13-2007, 09:19 AM
  4. Logging and Timing
    By looneytoon in forum OSR Help
    Replies: 3
    Last Post: 03-27-2007, 03:55 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
  •