how to run a external program?
Posted: Mon Apr 01, 2013 1:25 pm
like title, how do i run a cmdline program from the bot?
MicroMacro home
https://www.solarstrike.net/phpBB3/
Code: Select all
function MemClean(sleeptime)
if sleeptime == nil or sleeptime == "" then sleeptime = 5000 end
os.execute("start 'ramrush.exe' -AutoOptimize")
yrest(sleeptime)
os.execute("TASKKILL /IM ramrush.exe /F")
end
Code: Select all
client = string.lower(client)
local path = getExecutionPath().."/"..client
-- fix spaces
path = string.gsub(path," ","\" \"")
local a,b,c = os.execute("START "..path.." NoCheckVersion")
if not a then
error("Trouble executing shortcut. Values returned were: "..(a or "nil")..", "..(b or "nil")..", "..(c or "nil"))
end
Code: Select all
Command> print(getExecutionPath())
C:/micromacro/scripts/rom
Code: Select all
function MemClean(sleeptime)
if sleeptime == nil or sleeptime == "" then sleeptime = 50000 end
os.execute("start "..getExecutionPath().."/ramrush.exe -AutoOptimize")
yrest(sleeptime)
os.execute("TASKKILL /IM ramrush.exe /F")
end