RoM bot

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Locked
Message
Author
User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: RoM bot

#1661 Post by Administrator » Mon Aug 24, 2009 1:05 am

That assertion error means that it failed to compile the Lua code you placed in that tag. I assume it is because of this line:

Code: Select all

load_paths("repair.xml");
load_paths() takes two arguments: waypoints and return path. If you just want to load a waypoint path, then use

Code: Select all

__WPL:load(getExecutionPath() .. "/waypoints/myPath.xml");
if i get attacked at any of those waypoints i get an error:
"bot.lua:416: attempt to index global 'anguage' (a nil value)
Thanks for the report. I'll make an update to SVN to fix this.

j_schlott
Posts: 119
Joined: Tue Aug 18, 2009 11:42 pm

Re: RoM bot

#1662 Post by j_schlott » Mon Aug 24, 2009 1:07 am

damn Im thinkin i broke somethin now, im having problems running 2 MMs with 2 accounts,

i have 1 account macroing, i am trying to create a path on a 2nd MM/ account

rom\createpath.lua gives me a instant error:
functions.lua:79: bad argument #1 to '?' (string expected, got nil)
Should normaly don't be a problem. I just changed something (translated some messages). I suppose just did a 'half' SVN update? Be sure no of the files is 'red' after updating. Just delete the 'red' files and repeat the SVN update.

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

Re: RoM bot

#1663 Post by Administrator » Mon Aug 24, 2009 1:16 am

What language do you have the bot configured to use?

Try going to functions.lua, line 79. Add this:

Code: Select all

			print("LANG45: ", language[45]);
			print("KEY: ", getKeyName(skey));
Right above this line:

Code: Select all

			cprintf(cli.yellow, language[45],	-- Multiple RoM windows found
Now, start the script again as you were trying to do. It should say either LANG45 or KEY is nil. Which is it?

j_schlott
Posts: 119
Joined: Tue Aug 18, 2009 11:42 pm

Re: RoM bot

#1664 Post by j_schlott » Mon Aug 24, 2009 1:17 am

That assertion error means that it failed to compile the Lua code you placed in that tag. I assume it is because of this line:

Code: Select all

load_paths("repair.xml");

load_paths() takes two arguments: waypoints and return path. If you just want to load a waypoint path, then use

Code: Select all

__WPL:load(getExecutionPath() .. "/waypoints/myPath.xml");
i dont think that section of the code is the problem, as i did change the code to this:

Code: Select all

	<!-- # 1 --><waypoint x="00000" z="00000">
        if( player.Fights-player.free_counter1 > 500 ) then  <!--recall at 500 monsters-->
        player.free_counter1 = player.Fights; 
	showWindow(getWin(), sw.show);
	player:rest(2);
        keyboardPress(key.VK_7);
	player:rest(20);
	load_paths("repair.xml");
        end;
and this worked

so to me it seems like something changed with a newer update with this bit of code:

Code: Select all

if( os.difftime(os.time(), player.BotStartTime) > 660 ) then

****give me a min to add that code to my function file and ill post back

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: RoM bot

#1665 Post by d003232 » Mon Aug 24, 2009 1:21 am

j_schlott wrote:i was having problems with attacking, so i updated now some of my code isnt working =\

Code: Select all

       <!-- # 1 --><waypoint x="00000" z="00000">
	if( os.difftime(os.time(), player.BotStartTime) > 660 ) then
	showWindow(getWin(), sw.show);
	player:rest(2);
        keyboardPress(key.VK_7);
	player:rest(20);
	load_paths("repair.xml");
	player:BotStartTime = 0;
        end
	</waypoint>
i get "player.lua:876: assertion failed!" as soon as he reaches this waypoint, none of the code runs

i now know how many mobs i kill in the timeframe i want to use this code in, so i think ill change it back to monster # instead of a timer, but i figured i would post my error anyway
Thats wrong:

Code: Select all

player:BotStartTime = 0;
it should be

Code: Select all

player.BotStartTime = 0;
And I'm just not sure if

Code: Select all

keyboardPress(key.VK_7);
should'nt be

Code: Select all

keyboardPress(_G.key.VK_7);
?

The use of

Code: Select all

load_paths("repair.xml");
is ok. You could also us it like

Code: Select all

load_paths("repair.xml", "repair_return");
or

Code: Select all

load_paths(" ", "new_return");
The RoM Bot Online Wiki needs your help!

j_schlott
Posts: 119
Joined: Tue Aug 18, 2009 11:42 pm

Re: RoM bot

#1666 Post by j_schlott » Mon Aug 24, 2009 1:40 am

ok im not sure what language i have it set to and i cant figure out how to add the code you wanted into functions, i tried a bunch of different ways

Code: Select all

function getWin()
	local skey = getStartKey();

	if( __WIN == nil ) then
		local winlist = findWindowList("Runes of Magic", "Radiant Arcana");

		if( #winlist == 0 ) then
			error(language[47], 0);	-- RoM window not found
		end

		if( #winlist > 1 ) then
			cprintf(cli.yellow, language[45],   -- Multiple RoM windows found <-- THIS IS FUNCTION LUA LINE 79
				getKeyName(skey));

			while( not keyPressed(skey) ) do
				yrest(10);
			end
			while( keyPressed(skey) ) do
				yrest(10);
			end

			__WIN = foregroundWindow();
		else
			__WIN = winlist[1];
		end
	else
		if( not windowValid(__WIN) ) then
			error(language[52], 0);
		end
	end

	return __WIN;
end

ok ill try to mess with
player.BotStartTime = 0;
later on, although i think thats how i had it orignally, i only changed it to
player:BotStartTime = 0;
after i updated and the code stopped working

the

Code: Select all

keyboardPress(key.VK_7);
works well

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: RoM bot

#1667 Post by d003232 » Mon Aug 24, 2009 1:46 am

j_schlott wrote:ok im not sure what language i have it set to and i cant figure out how to add the code you wanted into functions, i tried a bunch of different ways
You don't need to change anything. The language is coming from your 'settings.xml' file. And the default in settings.lua is also 'english'. As I wrote, I suppose you have only a half new SVN update. Only updated the bot.lua and missed the settings.lua or english.lua
The RoM Bot Online Wiki needs your help!

j_schlott
Posts: 119
Joined: Tue Aug 18, 2009 11:42 pm

Re: RoM bot

#1668 Post by j_schlott » Mon Aug 24, 2009 1:52 am

when i updated i drained my profiles and waypoints into a new folder, then deleted everything in the rom folder, then did svn update.

so im almost positive i have the newest files, i will have to try updating again in the morning, its 3am here now time for bed


****edit: i updated again this morning, the problem i was having with with dual MM/accounts is gone

j_schlott
Posts: 119
Joined: Tue Aug 18, 2009 11:42 pm

Re: RoM bot

#1669 Post by j_schlott » Mon Aug 24, 2009 3:10 pm

not sure if this is the spot to post this, but i was trying to use a mouseclick for the right mouse button, instead of left,

it doesnt seem like theres a function, or if there is, it isnt the obvious mouseclickR()

so i copied mouseclickL from player.lua:

Code: Select all

function CPlayer:mouseclickL(_x, _y, _wwide, _whigh)
	if( foregroundWindow() ~= getWin() ) then
		return;
	end

	detach(); -- Remove attach bindings

	local wx,wy,wwide,whigh  = windowRect(getWin());
	local hf_x, hf_y;
	
	-- recalulate clickpoints depending from the actual RoM windows size
	-- only if we know the original windows size from the clickpoints
	if(_wwide  and _whigh) then
		hf_x = wwide * _x / _wwide;
		hf_y = whigh * _y / _whigh;
		cprintf(cli.green, language[92], -- Mouseclick Left at %d,%d in %dx%d (recalculated 
			hf_x, hf_y, wwide, whigh, _x, _y, _wwide, _whigh);
	else
		hf_x = _x;
		hf_y = _y;
		cprintf(cli.green, language[93],	 -- Clicking mouseL at %d,%d in %dx%d\n
			hf_x, hf_y, wwide, whigh);
	end;
	
	mouseSet(wx + hf_x, wy + hf_y);
	yrest(100);

	mouseLClick();
	yrest(100);

	attach(getWin()); -- Re-attach bindings
end
and made it a right click:

Code: Select all

function CPlayer:mouseclickR(_x, _y, _wwide, _whigh)
	if( foregroundWindow() ~= getWin() ) then
		return;
	end

	detach(); -- Remove attach bindings

	local wx,wy,wwide,whigh  = windowRect(getWin());
	local hf_x, hf_y;
	
	-- recalulate clickpoints depending from the actual RoM windows size
	-- only if we know the original windows size from the clickpoints
	if(_wwide  and _whigh) then
		hf_x = wwide * _x / _wwide;
		hf_y = whigh * _y / _whigh;
		cprintf(cli.green, language[141], -- Mouseclick Right at %d,%d in %dx%d (recalculated 
			hf_x, hf_y, wwide, whigh, _x, _y, _wwide, _whigh);
	else
		hf_x = _x;
		hf_y = _y;
		cprintf(cli.green, language[142],	 -- Clicking mouseR at %d,%d in %dx%d\n
			hf_x, hf_y, wwide, whigh);
	end;
	
	mouseSet(wx + hf_x, wy + hf_y);
	yrest(100);

	mouseRClick();
	yrest(100);

	attach(getWin()); -- Re-attach bindings
end
it worked for what i needed, to sell off bag items when at a merchant
never worked with that kind of code, so i dont know a whole lot, but if it looks ok can u add it to future revisions

*edit* MM window still spouts out leftclick so addition language needs to be added too

Code: Select all

	[141] = "Mouseclick Right at %d,%d in %dx%d (recalculated from %d,%d by %dx%d)\n",
	[142] = "Mouseclick Right at %d,%d in %dx%d.\n",

Glopo
Posts: 29
Joined: Tue Aug 11, 2009 9:52 pm

Re: RoM bot

#1670 Post by Glopo » Tue Aug 25, 2009 2:08 pm

hello,

V178 works with the new patch ?
Attachments
erreur169.jpg

Uniden65
Posts: 151
Joined: Thu Aug 20, 2009 5:17 pm

Re: RoM bot

#1671 Post by Uniden65 » Tue Aug 25, 2009 2:20 pm

178 works run the update.lua ..

Only problems i have found is the Nodes for Harvesting does not work ? is there a way to run something like update.lua to get the new Nodes thay might have changed for harvesting .......

Glopo
Posts: 29
Joined: Tue Aug 11, 2009 9:52 pm

Re: RoM bot

#1672 Post by Glopo » Tue Aug 25, 2009 2:58 pm

same error in v180 and after update.lua

depp69
Posts: 30
Joined: Mon Aug 17, 2009 12:46 pm

Re: RoM bot

#1673 Post by depp69 » Tue Aug 25, 2009 3:18 pm

yup same here, just checked out and run update.lua
after startup: pawn.lua:173 bad #1 to 'bitAnd' ((null))

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

Re: RoM bot

#1674 Post by Administrator » Tue Aug 25, 2009 3:19 pm

Edit settings.xml and change this line:

Code: Select all

<option name="DEBUGGING" value="true" />
Change value="true" (I assume yours is currently set to false). Start the script again and when it gets that error, post a copy of your log.txt.

Exactly what is it doing when the error occurs? Right after targeting an enemy?

Glopo
Posts: 29
Joined: Tue Aug 11, 2009 9:52 pm

Re: RoM bot

#1675 Post by Glopo » Tue Aug 25, 2009 3:25 pm

just in script launch i upload fast

Code: Select all

==================================================

Tue Aug 25 22:04:05 2009 : Execution success

Tue Aug 25 22:04:08 2009 : Executing script 'bot.lua'
==================================================

Tue Aug 25 22:04:09 2009 : RoM Bot Version 2.45
Tue Aug 25 22:04:09 2009 : Language: english
Tue Aug 25 22:04:09 2009 : Using static char address 0x8E19C8, player address 0x2BAF6000

stack traceback:
	...:\Users\x\Desktop\rune bot\micromacro\lib\lib.lua:536: in function 'startMacro'
	scripts\rom\bot.lua:581: in main chunk

----------TRACEBACK END----------

Tue Aug 25 22:04:09 2009 : ...top/rune bot/micromacro/scripts/rom/classes/pawn.lua:169: bad argument #1 to 'bitAnd' ((null))
Tue Aug 25 22:04:09 2009 : Execution error: Runtime error
Tue Aug 25 22:18:50 2009 : Executing script 'update.lua'
==================================================

Tue Aug 25 22:18:52 2009 : Execution success

Tue Aug 25 22:18:54 2009 : Executing script 'bot.lua'
==================================================

Tue Aug 25 22:18:55 2009 : RoM Bot Version 2.45
Tue Aug 25 22:18:55 2009 : Language: english
Tue Aug 25 22:18:55 2009 : Using static char address 0x8E19C8, player address 0x2BAF6000

stack traceback:
	...:\Users\x\Desktop\rune bot\micromacro\lib\lib.lua:536: in function 'startMacro'
	scripts\rom\bot.lua:581: in main chunk

----------TRACEBACK END----------

Tue Aug 25 22:18:55 2009 : ...top/rune bot/micromacro/scripts/rom/classes/pawn.lua:169: bad argument #1 to 'bitAnd' ((null))
Tue Aug 25 22:18:55 2009 : Execution error: Runtime error
Tue Aug 25 22:32:46 2009 : Executing script 'bot.lua'
==================================================

Tue Aug 25 22:32:47 2009 : RoM Bot Version 2.45
Tue Aug 25 22:32:47 2009 : Language: english
Tue Aug 25 22:32:47 2009 : Using static char address 0x8E19C8, player address 0x2BAF6000

stack traceback:
	...:\Users\x\Desktop\rune bot\micromacro\lib\lib.lua:536: in function 'startMacro'
	scripts\rom\bot.lua:581: in main chunk

----------TRACEBACK END----------

Tue Aug 25 22:32:47 2009 : ...top/rune bot/micromacro/scripts/rom/classes/pawn.lua:169: bad argument #1 to 'bitAnd' ((null))
Tue Aug 25 22:32:47 2009 : Execution error: Runtime error
Tue Aug 25 22:32:52 2009 : Executing script 'update.lua'
==================================================

Tue Aug 25 22:32:53 2009 : Execution success

Tue Aug 25 22:32:56 2009 : Executing script 'bot.lua'
==================================================

Tue Aug 25 22:32:57 2009 : RoM Bot Version 2.45
Tue Aug 25 22:32:57 2009 : Language: english
Tue Aug 25 22:32:57 2009 : Using static char address 0x8E19C8, player address 0x2BAF6000

stack traceback:
	...:\Users\x\Desktop\rune bot\micromacro\lib\lib.lua:536: in function 'startMacro'
	scripts\rom\bot.lua:581: in main chunk

----------TRACEBACK END----------

Tue Aug 25 22:32:57 2009 : ...top/rune bot/micromacro/scripts/rom/classes/pawn.lua:169: bad argument #1 to 'bitAnd' ((null))
Tue Aug 25 22:32:57 2009 : Execution error: Runtime error
Last edited by Glopo on Tue Aug 25, 2009 3:46 pm, edited 1 time in total.

User avatar
BlackGod
Posts: 53
Joined: Wed Jul 01, 2009 10:05 am

Re: RoM bot

#1676 Post by BlackGod » Tue Aug 25, 2009 3:45 pm

Hey...

I changed the setting as you said but it still fails...

here is my log: First one is without the debug-option... ;)

Code: Select all

Tue Aug 25 22:22:37 2009 : MicroMacro v1.0
Tue Aug 25 22:22:37 2009 : Processor Type: 2X 586, OS: Windows XP Service Pack 3
Tue Aug 25 22:22:37 2009 : LuaCoco is available.
Tue Aug 25 22:22:37 2009 : Lua glues exported.
Tue Aug 25 22:22:37 2009 : Keyboard layout: US English
Tue Aug 25 22:23:44 2009 : Executing script 'bot.lua'
==================================================

Tue Aug 25 22:23:44 2009 : Language: english
Tue Aug 25 22:23:50 2009 : RoM Bot Version 2.46
Tue Aug 25 22:23:50 2009 : Using static char address 0x8E19C8, player address 0x330F0000

stack traceback:
	...tellungen\Etienne\Desktop\micromacro NEU\lib\lib.lua:536: in function 'startMacro'
	scripts\\rom\bot.lua:561: in main chunk

----------TRACEBACK END----------

Tue Aug 25 22:23:50 2009 : ...nne/Desktop/micromacro NEU/scripts//rom/settings.lua:435: Failed to compile and run Lua code for onLeaveCombat in character profile.
Tue Aug 25 22:23:50 2009 : Execution error: Runtime error
Tue Aug 25 22:41:26 2009 : Executing script 'bot.lua'
==================================================

Tue Aug 25 22:41:26 2009 : Language: english
Tue Aug 25 22:41:27 2009 : RoM Bot Version 2.46
Tue Aug 25 22:41:27 2009 : Using static char address 0x8E19C8, player address 0x330F0000

stack traceback:
	...tellungen\Etienne\Desktop\micromacro NEU\lib\lib.lua:536: in function 'startMacro'
	scripts\\rom\bot.lua:561: in main chunk

----------TRACEBACK END----------

Tue Aug 25 22:41:27 2009 : ...nne/Desktop/micromacro NEU/scripts//rom/settings.lua:435: Failed to compile and run Lua code for onLeaveCombat in character profile.
Tue Aug 25 22:41:27 2009 : Execution error: Runtime error
And here is a screeny
Attachments
error.JPG

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: RoM bot

#1677 Post by d003232 » Tue Aug 25, 2009 3:47 pm

BlackGod wrote:Failed to compile and run Lua code for onLeaveCombat in character profile.
Oo :-)
The RoM Bot Online Wiki needs your help!

shotpuller
Posts: 12
Joined: Wed Jul 01, 2009 2:32 pm

Re: RoM bot

#1678 Post by shotpuller » Tue Aug 25, 2009 4:01 pm

after the patch i tried to run my rombot and got a ton of errors.. any idea what I need to do??
Attachments
microwrong.jpg

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

Re: RoM bot

#1679 Post by Administrator » Tue Aug 25, 2009 4:11 pm

Glopo: try editing addresses.lua:

Code: Select all

pawnAttackable_offset = 0x368;
Let me know if it works after making this change.


shotpuller: Either update off of SVN or download the newer release that is attached to the first post in this thread. It is still being fixed for the latest patch, so you can expect problems.

Wobit
Posts: 5
Joined: Tue May 12, 2009 6:28 am

Re: RoM bot

#1680 Post by Wobit » Tue Aug 25, 2009 4:20 pm

Got some errors aswell after new release

Code: Select all

Script> rom/bot.lua
Opening bot.lua...
Starting script execution - Press CTRL+C to exit.
Press CTRL+L to cancel execution and low a new script.
-------------------------------------------------------------------------------
We read the hotkey settings from your bindings.txt file ...\Runes of Magic\bindings.txt instead of using the
settings.lua file.
Due to technical reasons, we don't support modifiers like CTRL/ALT/SHIFT for hot
keys at the moment. Please change your hotkey CTRL-TAB for 'TARGET_FRIEND'
You can't use the player:target_NPC() function until changed!

®SolarStrike Software, www.solarstrike.net

G:\micromacro\micromacro\lib\lib.lua:359: bad argument #1 to 'getKeyName' ((null
))
had the functions.lua, line 79 error while doing update.lua, was fixed by closing the 2nd ROM window opened

Locked

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests