Author Topic: WriteConsole every 2 minutes  (Read 893 times)

0 Members and 1 Guest are viewing this topic.

Offline DarkSpread

  • Major(1)
  • Posts: 25
WriteConsole every 2 minutes
« on: September 23, 2011, 02:22:43 pm »
What's the line of code that makes this: WriteConsole(0,'Type !cmds for commands.',$00FFFF) "say again" every 2 minutes?
I've not been scripting for a while and then i forgot how to make it. ???

Thanks in advance!

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: WriteConsole every 2 minutes
« Reply #1 on: September 23, 2011, 02:56:53 pm »
put it in AppOnIdle:

Code: [Select]
procedure AppOnIdle(ticks: integer);
begin
  if (ticks mod AMOUNT = 0) then writeconsole(0, 'your text', color);
end;

It's convenient to use timeInSeconds*60 or timeInMinutes*3600 as AMOUNT. In your case it would be 2*60*60 = 2*3600 = 7200 ticks.

Offline DarkSpread

  • Major(1)
  • Posts: 25
Re: WriteConsole every 2 minutes
« Reply #2 on: September 23, 2011, 03:08:51 pm »
Thank you! It works! :P