Page 84 of 111

Re: RoM bot

Posted: Mon Aug 24, 2009 1:05 am
by Administrator
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.

Re: RoM bot

Posted: Mon Aug 24, 2009 1:07 am
by j_schlott
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.

Re: RoM bot

Posted: Mon Aug 24, 2009 1:16 am
by Administrator
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?

Re: RoM bot

Posted: Mon Aug 24, 2009 1:17 am
by j_schlott
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

Re: RoM bot

Posted: Mon Aug 24, 2009 1:21 am
by d003232
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");

Re: RoM bot

Posted: Mon Aug 24, 2009 1:40 am
by j_schlott
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

Re: RoM bot

Posted: Mon Aug 24, 2009 1:46 am
by d003232
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

Re: RoM bot

Posted: Mon Aug 24, 2009 1:52 am
by j_schlott
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

Re: RoM bot

Posted: Mon Aug 24, 2009 3:10 pm
by j_schlott
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",

Re: RoM bot

Posted: Tue Aug 25, 2009 2:08 pm
by Glopo
hello,

V178 works with the new patch ?

Re: RoM bot

Posted: Tue Aug 25, 2009 2:20 pm
by Uniden65
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 .......

Re: RoM bot

Posted: Tue Aug 25, 2009 2:58 pm
by Glopo
same error in v180 and after update.lua

Re: RoM bot

Posted: Tue Aug 25, 2009 3:18 pm
by depp69
yup same here, just checked out and run update.lua
after startup: pawn.lua:173 bad #1 to 'bitAnd' ((null))

Re: RoM bot

Posted: Tue Aug 25, 2009 3:19 pm
by Administrator
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?

Re: RoM bot

Posted: Tue Aug 25, 2009 3:25 pm
by Glopo
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

Re: RoM bot

Posted: Tue Aug 25, 2009 3:45 pm
by BlackGod
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

Re: RoM bot

Posted: Tue Aug 25, 2009 3:47 pm
by d003232
BlackGod wrote:Failed to compile and run Lua code for onLeaveCombat in character profile.
Oo :-)

Re: RoM bot

Posted: Tue Aug 25, 2009 4:01 pm
by shotpuller
after the patch i tried to run my rombot and got a ton of errors.. any idea what I need to do??

Re: RoM bot

Posted: Tue Aug 25, 2009 4:11 pm
by Administrator
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.

Re: RoM bot

Posted: Tue Aug 25, 2009 4:20 pm
by Wobit
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