Difference between revisions of "User:Dt192/Sandbox2"

From Mudlet
Jump to navigation Jump to search
m
m
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<syntaxhighlight lang="lua">
+
<syntaxhighlight lang="js">
enableTimer("Newbie timer") -- enables the timer, so 2s after being enabled, it'll tick - and every 2s after that
+
let a = 1;
 
 
disableTimer("Newbie timer") -- disables it, so it won't go off anymore
 
</syntaxhighlight>
 
 
 
 
 
 
 
<syntaxhighlight lang="lua">
 
tempTimer(3, [[ echo("this is timer #1 going off 3s after being made\n") ]])
 
tempTimer(4, [[ echo("this is timer #2 going off 4s after being made - and 1s after the first one\n") ]])
 
</syntaxhighlight>
 
 
 
 
 
 
 
<syntaxhighlight lang="lua">
 
-- get and store the timer ID in the global "greeting_timer_id" variable
 
greeting_timer_id = tempTimer(2, [[ echo("hello!\n") ]])
 
 
 
-- delete the timer - thus nothing will actually happen!
 
killTimer(greeting_timer_id)
 
</syntaxhighlight>
 
 
 
 
 
 
 
<syntaxhighlight lang="lua">
 
if portal_timer then killTimer(portal_timer) end
 
portal_timer = tempTimer(2, [[ send("enter portal") ]])
 
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 00:35, 16 February 2026

let a = 1;