Results 1 to 5 of 5

Thread: "TimeRunning" help please.

  1. #1
    Join Date
    Sep 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default "TimeRunning" help please.

    Hi everyone i'm currently stuck trying to work a timerunning into one of my scripts and this is the procedure...

    Simba Code:
    procedure teleaftertime;
    begin
     if TimeRunning (300000) = True;
     then
       typesend('::shops')
      end;

    I know I probably have it wrong but if someone can point me into the right direction that would be great... If you can't tell what i'm trying to do its that after 300 seconds (5 minutes) to teleport out using '::shops' but i want the script to keep checking to see if its time ti teleport out even in combat. If someone has the skill to help me out that would be greatly appreciated

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Simba Code:
    If TimeRunning=300000 Then
    Assuming you have a function called TimeRunning set/started.

  3. #3
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Hey Irae,

    The function TimeRunning results a string with hours, minutes, and seconds. What you want to use is MarkTime and TimeFromMark:

    Simba Code:
    var
      t: Integer;
    // ^ declared globally

    MarkTime(t);
    // ^ call MarkTime before your main loop
    repeat
      if (TimeFromMark(t) > (5 * 60 * 1000)) then
        TypeSend('::shops');
      // FightSomething;
      // EatWhatever;
    until(False);

    Hopefully no further explanation is needed

  4. #4
    Join Date
    Sep 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Runaway View Post
    Hey Irae,

    The function TimeRunning results a string with hours, minutes, and seconds. What you want to use is MarkTime and TimeFromMark:

    Simba Code:
    var
      t: Integer;
    // ^ declared globally

    MarkTime(t);
    // ^ call MarkTime before your main loop
    repeat
      if (TimeFromMark(t) > (5 * 60 * 1000)) then
        TypeSend('::shops');
      // FightSomething;
      // EatWhatever;
    until(False);

    Hopefully no further explanation is needed
    Ok im still new but let me see if I get this... I need to add the "t: Integer;" to my variables and place the "marktime(t);" as a new procedure and place it at the beginning of my loop?

  5. #5
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    You can place everything under a single procedure. And if you want to repeat it, you will need 2 loops, 1 given by Runaway, and another to repeat the MarkTime(t) and the initial repeat loop.

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
  •