Adding statement to waypoint file won't work

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
InadequateCoder
Posts: 33
Joined: Fri Jan 22, 2010 1:23 am

Adding statement to waypoint file won't work

#1 Post by InadequateCoder » Mon Feb 01, 2010 9:58 pm

I can't figure out what part isn't working. I know it has something to do with what parts of lua work in the xml files but I can't figure out which part isn't working. It's a standard conditional statement where it checks if you have a quest weapon. I figured it could be added for chains later so I'd work it in now.

Code: Select all

		local stupidweapon = string.find(sendMacro("mainweaponName();"), "Mayor", 1, true);
		if ( player.Level > 4 and stupidweapon == nil ) then
			printf("We shall find holy grenade!");
			loadPaths("getlvl5weapon");
		else
			printf("With this grenade we shall blast our enemies to smitherines.")
		end	

Where I added to my personal addon:

Code: Select all

function mainweaponName()
	local name, _1, icon, _2, rank, _3, tp_to_upgrade, energy_type, usable = GetSkillDetail(_tab,_slot);
	if (name == nil) then
		DEFAULT_CHAT_FRAME:AddMessage("ERROR - Mainhand weapon not found.");
	else
		return name;
	end
end
The first code section is added to a waypoint's code and the second is to my personal addon (I know, I repeated that). Any help would be much appreciated, thanks in advance.

ADDED NOTE: Still working on methods of targeting the mailbox. What I've found is there is a function called OBB_ChangeTraget (no it's not spelt wrong). This function works off of target ID's but it looks like they removed the code that will pull the target ID's for you. Also I'm not sure if targeting by ID will help but I am sure the SpeakFrame commands work with the mailbox.

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

Re: Adding statement to waypoint file won't work

#2 Post by Administrator » Mon Feb 01, 2010 11:40 pm

So what's the problem? Actually explaining what is displayed and what isn't would be an awfully good start. I'm not sure why you didn't provide a full copy of the waypoint script, either.

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

Re: Adding statement to waypoint file won't work

#3 Post by InadequateCoder » Tue Feb 02, 2010 12:37 pm

Administrator wrote:So what's the problem? Actually explaining what is displayed and what isn't would be an awfully good start. I'm not sure why you didn't provide a full copy of the waypoint script, either.
I'm not sure why either :o but I will when I get back to that comp. It keeps giving me an error to compile. I tried puttting in extra prints to see if I can tell where it's failing but it just keeps saying error to compile at that waypoint.

Gimme a few minutes to edit in my waypoints file. I currently have the if-statements commented out.

EDIT: Here's the modified l5-7_beet.xml

Code: Select all

<waypoints type="NORMAL">
	<!-- # 1 --><waypoint x="-1782" z="-6115">player:restrnd(10, 2, 10);</waypoint>
	<!-- # 2 --><waypoint x="-1999" z="-6254">player:restrnd(10, 2, 10);</waypoint>
	<!-- # 3 --><waypoint x="-2058" z="-6448">player:restrnd(10, 2, 10);</waypoint>
	<!-- # 4 --><waypoint x="-2154" z="-6437">player:restrnd(10, 2, 10);</waypoint>
	<!-- # 5 --><waypoint x="-2312" z="-6589">player:restrnd(10, 2, 10);</waypoint>
	<!-- # 6 --><waypoint x="-2365" z="-6613">player:restrnd(10, 2, 10);</waypoint>
	<!-- # 7 --><waypoint x="-2653" z="-6479">player:restrnd(10, 2, 10);</waypoint>
	<!-- # 8 --><waypoint x="-2671" z="-6252">player:restrnd(10, 2, 10);</waypoint>
	<!-- # 9 --><waypoint x="-2363" z="-5974">player:restrnd(10, 2, 10);</waypoint>
	<!-- #10 --><waypoint x="-2171" z="-5999">player:restrnd(10, 2, 10);</waypoint>
	<!-- #11 --><waypoint x="-1951" z="-5949"></waypoint>
	<!-- #12 --><waypoint x="-2033" z="-5765">player:restrnd(10, 2, 10);</waypoint>
	<!-- #13 --><waypoint x="-2005" z="-5345">
		local stupidweapon = string.find(sendMacro("mainweaponName();"), "Mayor", 1, true);
		if ( player.Level > 4 and stupidweapon == nil ) then
			printf("We shall find holy grenade!");
			loadPaths("getlvl5weapon");
		else
			printf("With this grenade we shall blast our enemies to smitherines.")
		end
   		if( player.Level > 6 ) then
			loadPaths("1-10Pioneers/l7t_7-9_boar");
	  	end
	</waypoint>
	<!-- #14 --><waypoint x="-1715" z="-5414">player:restrnd(10, 2, 10);</waypoint>
	<!-- #15 --><waypoint x="-1630" z="-5444">player:restrnd(10, 2, 10);</waypoint>
	<!-- #16 --><waypoint x="-1486" z="-5272">player:restrnd(20, 2, 10);</waypoint>
	<!-- #17 --><waypoint x="-1531" z="-5136">player:restrnd(10, 2, 10);</waypoint>
	<!-- #18 --><waypoint x="-1596" z="-5049">player:restrnd(10, 2, 10);</waypoint>
	<!-- #19 --><waypoint x="-1976" z="-4932">player:restrnd(10, 2, 10);</waypoint>
	<!-- #20 --><waypoint x="-1986" z="-5147">player:restrnd(10, 2, 10);</waypoint>
	<!-- #21 --><waypoint x="-2096" z="-5208">player:restrnd(10, 2, 10);</waypoint>
	<!-- #22 --><waypoint x="-2094" z="-5298">player:restrnd(20, 2, 10);</waypoint>
	<!-- #23 --><waypoint x="-2167" z="-5382">player:restrnd(10, 2, 10);</waypoint>
	<!-- #24 --><waypoint x="-2195" z="-5531">player:restrnd(10, 2, 10);</waypoint>
	<!-- #25 --><waypoint x="-2069" z="-5729">player:restrnd(10, 2, 10);</waypoint>
	<!-- #26 --><waypoint x="-1919" z="-5956">
		local stupidweapon = string.find(sendMacro("mainweaponName();"), "Mayor", 1, true);
		if ( player.Level > 4 and stupidweapon == nil ) then
			printf("We shall find holy grenade!");
			loadPaths("getlvl5weapon");
		else
			printf("With this grenade we shall blast our enemies to smitherines.")
		end
   		if( player.Level > 6 ) then
			loadPaths("1-10Pioneers/l7t_7-9_boar");
	  	end
	</waypoint>
</waypoints>

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

Re: Adding statement to waypoint file won't work

#4 Post by Administrator » Tue Feb 02, 2010 2:07 pm

Works fine for me. The problem must be in your addon. For one thing, I don't see _tab or _slot defined anywhere. And, if they were, those are terrible variable names for global variables.

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

Re: Adding statement to waypoint file won't work

#5 Post by InadequateCoder » Wed Feb 03, 2010 4:33 pm

Administrator wrote:Works fine for me. The problem must be in your addon. For one thing, I don't see _tab or _slot defined anywhere. And, if they were, those are terrible variable names for global variables.
Thank you, though it should have been painfully obvious to me I guess my lack of rest the last few days left me an idiot. That function is to get skill info not item info. :oops:

I apologize for the wasting your time with this. I honestly don't know how I could have confused that. :shock:

Post Reply

Who is online

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