Author Topic: How do I make a script that repeats the same line every X amount of seconds?  (Read 1080 times)

0 Members and 1 Guest are viewing this topic.

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
How do I make a script that repeats the same line every X amount of seconds?
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
I sometimes like doing it this way (which is unnecessarily complex but whatever):
Code: [Select]
const
   Time = 5; //Seconds

var
   Timer: integer;

procedure ActivateServer;
begin
   Timer := Time;
end;

procedure AppOnIdle(Ticks: cardinal);
begin
   Timer := Timer - 1;
   if (Timer = 0) then begin
      //Do stuff here
      Timer := Time;
   end;
end;

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
I sometimes like doing it this way (which is unnecessarily complex but whatever):
Code: [Select]
const
   Time = 5; //Seconds

var
   Timer: integer;

procedure ActivateServer;
begin
   Timer := Time;
end;

procedure AppOnIdle(Ticks: cardinal);
begin
   Timer := Timer - 1;
   if (Timer = 0) then begin
      //Do stuff here
      Timer := Time;
   end;
end;

Thanks, what do I put in "Do stuff here" I knew how a long time ago, but I forgot.
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
I sometimes like doing it this way (which is unnecessarily complex but whatever):
Code: [Select]
const
   Time = 5; //Seconds

var
   Timer: integer;

procedure ActivateServer;
begin
   Timer := Time;
end;

procedure AppOnIdle(Ticks: cardinal);
begin
   Timer := Timer - 1;
   if (Timer = 0) then begin
      //Do stuff here
      Timer := Time;
   end;
end;

Thanks, what do I put in "Do stuff here" I knew how a long time ago, but I forgot.
Code: [Select]
WriteConsole(0, 'Writing', $FFFFFF);
Will write the stuff in ''s (currently Writing) in white (#FFFFFF) to everyone (0).

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Thanks.
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.