problem on auto repairing based on dura

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
tomerr90
Posts: 17
Joined: Wed Oct 07, 2009 4:21 pm

problem on auto repairing based on dura

#1 Post by tomerr90 » Mon Jan 25, 2010 10:52 am

Code: Select all

	<!-- # 16 --><waypoint x="-18218" z="6095">
		if( player.free_flag1 == true ) then 
			player.free_flag1 = false; 
			loadPaths("ret_k.xml");
		end
	</waypoint>

Code: Select all

	<onLeaveCombat><![CDATA[
		local dura = inventory:getMainHandDurability();
		printf("Durability:%s\n", dura);
		if( dura < 0.9 ) then
			player.free_flag1 = true;
		end
	]]></onLeaveCombat>
and when i try to run the bot it says "Failed to compile and run lua code for Onleavecombat in character profile".
By the way i think you should redo the auto repairing part of the bot because the time and the fight based auto repairing doesnt work either.
Thanks.
Edit: Fixed it, the problem seems to be in the condition, this part: <
i replaced it with "< (Enter number here)" and it compiled properly, i'll check how it works now and update you
Update:
Works like a charm :)
Update 2:
it seems the game sends the dura in percent like 0.95 or whatever so dont write the dura number write the percent

User avatar
VoiD
Posts: 11
Joined: Fri Jan 22, 2010 7:44 pm
Location: Deep space

Re: problem on auto repairing based on dura

#2 Post by VoiD » Mon Jan 25, 2010 1:00 pm

You sure it works with loadPaths("ret_k.xml"); instead of loadPaths("ret_k"); ? Mine works fine without the .xml, wonder if it works in both cases... :?
~(。◕‿‿◕。)~

tomerr90
Posts: 17
Joined: Wed Oct 07, 2009 4:21 pm

Re: problem on auto repairing based on dura

#3 Post by tomerr90 » Mon Jan 25, 2010 1:07 pm

yea it does.
weird it shouldnt work without the .xml

User avatar
VoiD
Posts: 11
Joined: Fri Jan 22, 2010 7:44 pm
Location: Deep space

Re: problem on auto repairing based on dura

#4 Post by VoiD » Mon Jan 25, 2010 2:35 pm

Well I reused the examples in the demo for the most basic of commands... For example u have in your demo2.xml:
loadPaths("demo3");

Guess they made an if() and they added an .xml if it wasn't there... :?
~(。◕‿‿◕。)~

InadequateCoder
Posts: 33
Joined: Fri Jan 22, 2010 1:23 am

Re: problem on auto repairing based on dura

#5 Post by InadequateCoder » Mon Jan 25, 2010 7:40 pm

I had the same problem so I did the same thing. ;)

And it works with and without the .xml I believe.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests