Jump to content
Sign in to follow this  
reddwarf

I'm after 2 TBC ACE functions (/in & /echo)

Recommended Posts

heya, 

the Ace module for TBC introduces the following 2 commands:

/echo 
evaluates the parameter and returns the output
example: /echo 74/3  ,  /echo 45sin(0)

/in 
schedules the parameter command in x seconds
example: /in 10 /sit , /in 30 /me trap ready

has anyone heard about any of these being ported to wow vanilla ?

Share this post


Link to post
Share on other sites

I've ended up coding it myself

The code looks like this:

Code for /echo command (example: /echo 20/5 outputs 4

function ECHO(s) DEFAULT_CHAT_FRAME:AddMessage(s); end
SLASH_ECHO1 = "/echo"
SlashCmdList["ECHO"] = function(msg, editBox)
	RunScript("ECHO("..msg..")");
end

 

Code for /in command (example: /echo 30 DEFAULT_CHAT_FRAME:AddMessage("30 seconds have passed")             )
Notice the command argument being in LUA form, you could script the playing of a sound, an emote, a whisper etc

local lastChange = 0
local f = CreateFrame("Frame")
SLASH_IN1 = "/in"
SlashCmdList["IN"] = function(msg, editBox)
	local _,_,delay,action = string.find(msg, "^(%d+)[%s](.*)")
	lastChange = GetTime()
	f:SetScript('OnUpdate', function()
		if (lastChange + delay) < GetTime() then
			RunScript(action)
			f:SetScript('OnUpdate', nil)
		end
	end)
end

The 2 scripts above have to be in a .lua addon file under Addons folder

I'll post a zipped addon file later

Edited by reddwarf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×