Results 1 to 6 of 6

Thread: Little help...

  1. #1
    Join Date
    Sep 2007
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Little help...

    I want to call a procedure after every 25-30 minutes , please help me with it

  2. #2
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Simba Code:
    program new;
    {$i SRL/SRL.scar}

    procedure Name;
    begin
    end;

    procedure MainLoop;
    var T : Integer;
    begin
      MarkTime(T);

      Wait(1500000); // Waits 25 minutes in milliseconds(?)
      if (TimeFromMark(T) < 1500000) then Name;
    end;

    begin
      MainLoop;
    end.

    This is very rough and probably won't work. But it's an idea that you can build off of. Someone will probably provide you with a better procedure though.

    E: Realized I used a global variable instead of a local for T. I wonder why...

    Quote Originally Posted by astoria1112000 View Post
    I want to call a procedure after every 25-30 minutes , please help me with it
    Last edited by RISK; 12-02-2011 at 04:44 AM.

  3. #3
    Join Date
    Sep 2007
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Please explain, What does MarkTime do and i will make my own method

  4. #4
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    MarkTime(T) will start recording the time that has passed since the mark was made.

    Try this for an example:
    Simba Code:
    program new;
    {$i SRL/SRL.scar}
    var T : Integer;

    procedure MainLoop;
    begin
      MarkTime(T);

      Wait(1500); // Waits 1.5 seconds in milliseconds(?)
      Write(TimeFromMark(T));
    end;

    begin
      MainLoop;
    end.

    Quote Originally Posted by astoria1112000 View Post
    Please explain, What does MarkTime do and i will make my own method

  5. #5
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Simba Code:
    Procedure LetsWait;
      var
        T: Integer;
      begin
        MarkTime(T);
        While (TimeFromMark(T) < 1500000) do  //1 minute = 60000, so 25 minutes = 1500000
          Wait(1);
        Writeln('25 minutes is up!');
      end;

    Obviously multiple ways of doing it.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  6. #6
    Join Date
    Sep 2007
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    k thank you , got it

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
  •