Help Please MM2 >> RomBot2

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Message
Author
User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Help Please MM2 >> RomBot2

#21 Post by Administrator » Tue Sep 09, 2014 4:51 pm

Change it to return true instead of just return.

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Help Please MM2 >> RomBot2

#22 Post by Lamkefyned » Tue Sep 09, 2014 6:29 pm

not detected error

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>
If you think something is right just because everyone else believes,you're not thinking.

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Help Please MM2 >> RomBot2

#23 Post by Administrator » Tue Sep 09, 2014 7:10 pm

This:

Code: Select all

  if( not running )
    return true;
Needs to be changed to:

Code: Select all

  if( not running ) then
    return true;
  end

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Help Please MM2 >> RomBot2

#24 Post by Lamkefyned » Tue Sep 09, 2014 7:23 pm

bug fixed tomorrow but are now 3 o'clock in the morning and have to sleep
If you think something is right just because everyone else believes,you're not thinking.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Help Please MM2 >> RomBot2

#25 Post by lisa » Wed Sep 10, 2014 10:57 pm

you are missing an end

Code: Select all

function macro.main(dt)
  if( not running )
    return true;

  -- other code here.
end
needs to be

Code: Select all

function macro.main(dt)
  if( not running )
    return true;
  end
  -- other code here.
end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Help Please MM2 >> RomBot2

#26 Post by Lamkefyned » Thu Sep 11, 2014 10:58 am

I am very grateful to all. Thanks a lot

Code: Select all

function exitCallback()
	releaseKeys();
end
atExit(exitCallback);
and for this and the next the same?

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);
If you think something is right just because everyone else believes,you're not thinking.

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests