tempTimer question

Post Reply
AlterAeonUser
Posts: 26
Joined: Sun Sep 01, 2013 11:08 pm

tempTimer question

Post by AlterAeonUser »

I have been beating my head against the keyboard for about an hour now because I am trying to do something I'm not entirely sure is possible. Nowhere in the help files, or on here can I find out if it's possible to pass a number to a variable and put said variable in place of the time number for a tempTimer.

so, instead of being forced to a static time: tempTimer(60, [[send("say something"]]) I want to be able to do this from an alias:
Code: [show] | [select all] lua
Pattern: 
aliasname 10 argument1 argument2
and have it pass the number to the tempTimer for the time.
Like this:
Code: [show] | [select all] lua
Code:
tempTimer(time, [["send say " .. argument1 .. argument2]])
So when I type aliasname 20 argument1 argument2 it will wait 20 seconds to fire.
Is what I want to do even possible?

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

Re: tempTimer question

Post by Oneymus »

It's very possible.

Alias pattern (this is very basic, and should be cleaned up):

Code: Select all

^timedSay (\d+) (\w+) (\w+)$
Script:
Code: [show] | [select all] lua
local time = tonumber(matches[2])
local arguments = matches[3] .. matches[4]

tempTimer(time, [[send("say ]] .. arguments .. [[")]])
Usual disclaimer: written in browser. Untested.

Post Reply