/delay

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Cobalt
a lesser mummy
a lesser mummy
Posts: 44
Joined: Sat Apr 24, 2004 3:42 pm

/delay

Post by Cobalt » Sat Apr 24, 2004 3:47 pm

Is there a way to cast/onvert/append seconds onto a variable containing float data?

Here's a snipet

Code: Select all

Sub CheckCastTime(SpellName)
	/varset SpellCastTime ${Spell[@SpellName].CastTime}
	/echo Cast Time: ${Spell[@SpellName].CastTime}
	/delay @SpellCastTime
/return
Currently this returns say 6.10 which is consider 6.10 tenths of a second, instead of 6.10 seconds. I've tried /varcat, possibly not correctly.

Cobalt

Cobalt
a lesser mummy
a lesser mummy
Posts: 44
Joined: Sat Apr 24, 2004 3:42 pm

Post by Cobalt » Sat Apr 24, 2004 3:51 pm

Spelling mistakes are fun. Figured it out.

Cobalt

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Sat Apr 24, 2004 3:53 pm

Not totally clear on your question but you can add to it, subtract etc:

This would add 10 seconds to it.

Code: Select all

/varset SpellCastTime ${Math.Calc[${Spell[@SpellName].CastTime}+10]}
This would subtract 10 seconds to it.

Code: Select all

/varset SpellCastTime ${Math.Calc[${Spell[@SpellName].CastTime}-10]}
This would drop the decimal:

Code: Select all

/varset SpellCastTime ${Math.Calc[${Spell[@SpellName].CastTime}].Int}

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Sat Apr 24, 2004 3:54 pm

Figures you'd fix it while I'm replying heh.

Falco72
a hill giant
a hill giant
Posts: 215
Joined: Fri Sep 26, 2003 3:24 am

Post by Falco72 » Sat Apr 24, 2004 3:55 pm

You can also do this:

Code: Select all

/delay "@SpellCastTime"s
It will become 6.1 secs.

Cobalt
a lesser mummy
a lesser mummy
Posts: 44
Joined: Sat Apr 24, 2004 3:42 pm

Post by Cobalt » Sun Apr 25, 2004 1:25 pm

Thanks for all the posts! I figured it out, but you all posted various better ways to do it. Thanks!

Cobalt