Re: Help Please MM2 >> RomBot2
Posted: Tue Sep 09, 2014 4:51 pm
Change it to return true instead of just return.
Code: Select all
local running = true;
function macro.main(dt)
if( not running )
return true;
-- other code here.
end
function macro.event(e, data1, data2, data3)
if( e == "keypressed" ) then
if( not running and data1 == key.VK_F5 ) then
start();
end
if( running and data1 == key.VK_F6 ) then
pause();
end
end
end
function start()
print("Started. Press F6 to pause.");
end
function pause()
print("Paused. Press F5 to continue.");
end
Code: Select all
2014-09-10 01:21:20 : MicroMacro version 1.9.18.260 (Alpha)
2014-09-10 01:21:20 : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz @2500MHz, Windows 7
2014-09-10 01:21:20 : User privilege: Administrator
-------------------------------------------------------------------------------
2014-09-10 01:26:55 : Load file error code: 7 (Runtime error)
bot.lua:40: functions.lua:2833: 'end' expected (to close 'function' at line 340) near <eof>
Code: Select all
if( not running )
return true;
Code: Select all
if( not running ) then
return true;
end
Code: Select all
function macro.main(dt)
if( not running )
return true;
-- other code here.
end
Code: Select all
function macro.main(dt)
if( not running )
return true;
end
-- other code here.
end
Code: Select all
function exitCallback()
releaseKeys();
end
atExit(exitCallback);
Code: Select all
function errorCallback(script, line, message)
local crashed, pid = isClientCrashed()
if crashed then
printf("Attached game client has crashed. Killing client (PID %d)\n", pid);
warning(script .. ":" .. line .. ": " .. message);
os.execute("TASKKILL /PID " .. pid .. " /F");
else
releaseKeys();
printf("The game client did not crash.\n");
end
end
atError(errorCallback);