Mirage Source
A little something about timers - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: A little something about timers (/showthread.php?tid=615)



A little something about timers - Joost - 09-01-2007

The example.

2 timers. Intervals at 500, and 1000
The one with 500 has this code:

Code:
Call Download(Porn)

The one with 1000 has this code:

Code:
Call Upload(Porn)

Timers use ram and CPU. We don't want that.

So, we fix that.

Inside the timer with the 500 interval, we
Code:
Dim Variable as Boolean
and we set
Code:
Variable = !Variable
Then we just

Code:
Call Download(Porn)
like before.
However, now we add something else to that sub too :
Code:
If Variable = True Then
       Call Upload(Porn)
End If

Now we delete the timer with an interval of 1000, and we're done. We've replaced a timer, and it's sub with just an if statement, a boolean, and the
Code:
Variable = !Variable
part.
Simple, yet effective.


- Bradyok - 16-01-2007

Thanks man, this is a great way to download porn!


Re: A little something about timers - Robin - 25-12-2007

Happy anniversary.