grouping timer variables

Post Reply
Eidolon
Posts: 15
Joined: Sun Sep 18, 2011 3:35 am

grouping timer variables

Post by Eidolon »

I have some timers in my script that I need to properly use killTimer upon correctly, but I keep getting errors regarding when grouping like this:

Shuj = {

aeon_timer = 0
onyx_timer = 0
sapphire_timer = 0
diamond_timer = 0
}


Lua syntax error:[String "Shuj = {..."]:4: '}' expected (to close '{' at line 1 near 'onyx_timer'

or when I have the timers as this:

aeon_timer = 0
onyx_timer = 0
sapphire_timer = 0
diamond_timer = 0

I still can't get it to properly kill the timer when aeon stops ticking. My tempTimer would tick a final time after the trigger ended.

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: grouping timer variables

Post by Silvine »

You need semicolons

Shuj = {

aeon_timer = 0;
onyx_timer = 0;
sapphire_timer = 0;
diamond_timer = 0
}

Eidolon
Posts: 15
Joined: Sun Sep 18, 2011 3:35 am

Re: grouping timer variables

Post by Eidolon »

alright fixed, but it didn't solve the other issue of killing the timer once the skill ended the tic. The echo displayed again right after a final time. Like:

The aeonic field that surrounds you pulses, emitting a high-pitched screech and flashing a series of bright lights.
killTimer("aeon_timer")
aeon_timer = tempTimer(5.8, [[cecho("\n<red> Aeonfield will hit in 5s!!)

The skill's final tic ends this way:
The aeonic field that surrounds you fades away.
aeonfield_timer = 0
killTimer("aeon_timer")

User avatar
Oneymus
Posts: 321
Joined: Thu Sep 17, 2009 5:24 am

Re: grouping timer variables

Post by Oneymus »

You need to pass the id returned by tempTimer to kill the timer.
Code: [show] | [select all] lua
aeon_timer = tempTimer( 5.8, [[cecho("\n<red>Aeonfield will hit in 5s!!")]] )

// Later...

killTimer( aeon_timer )
tempTimer returns a numeric id ( echo(tostring(aeon_timer))) ). That is what you use with killTimer.

Post Reply