This makes a generic function that you can use to send commands with waits in between them. The first time is optional (0 is inserted if none is provided), but after that, it needs a number (time to wait in seconds) followed by a string (command to send to the game). Might be useful for what you are looking to do.
Like so: sendQueue('w',0,'s',0,'open west',1,'w',1,'say hello')
local runQueue
function runQueue(tbl)
local info = table.remove(tbl,1)
if info then
local run = function()
send(info[2])
runQueue(tbl)
end
tempTimer(info[1], run)
end
end
function sendQueue(...)
local tbl = {}
if type(arg[1]) ~= "number" then
table.insert(arg,1,0)
end
for k = 1,#arg,2 do
tbl[(k + 1) / 2] = {arg[k],arg[k+1]}
end
runQueue(tbl)
end