Failed to compile

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Failed to compile

#1 Post by MiesterMan »

I tested all of the code I put in this file with the commandline waypoint and it worked fine. When I added it to the waypointfile I kept getting this error:

Code: Select all

11:12pm - scripts\rom\bot.lua:760: Failed to compile and run Lua code for waypoint #1
I tried moving it to a seperate file and looking at it as pure lua but I couldn't find anything wrong with it. If you can see what I did wrong please let me know.

0_Human_Quest.xml:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<!-- #  1 --><waypoint x="-4049" z="-8281" y="242">	
		if RoMScript("CheckQuest(420660);") == 0 then
			repeat 
				player:target_NPC("Laif Cindai");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(1,1);");
				yrest(500);
				RoMScript("AcceptQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420660);") == 1;
		end; <!-- Quest:  Report In - Accept -->
	</waypoint>
	<!-- #  2 --><waypoint x="-3765" z="-8473" y="205">	</waypoint>
	<!-- #  3 --><waypoint x="-3700" z="-8676" y="224">
		if RoMScript("CheckQuest(420660);") == 1 then
			repeat 
				player:target_NPC("Leighton");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(3,1);");
				yrest(500);
				RoMScript("CompleteQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420660);") == 2;
		end;
		if RoMScript("CheckQuest(420661);") == 0 then 
			repeat
				player:target_NPC("Leighton");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(1,1);");
				yrest(500);
				RoMScript("AcceptQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420661);") == 1;
		end; <!-- Quest:  Report In - Complete, Claiming Weapons - Accept -->
	</waypoint>
	<!-- #  4 --><waypoint x="-3766" z="-8550" y="216">	</waypoint>
	<!-- #  5 --><waypoint x="-3802" z="-8527" y="218">
		if RoMScript("CheckQuest(420661);") == 1 then 
			repeat 
				player:target_NPC("Mallor");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(3,1);");
				yrest(500);
				RoMScript("CompleteQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420661);") == 2;
		end;
		if RoMScript("CheckQuest(420662);") == 0 then 
			repeat 
				player:target_NPC("Mallor");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(1,1);");
				yrest(500);
				RoMScript("AcceptQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420662);") == 1;
		end; <!-- Quest:  Claiming Weapons - Complete, Claiming Armor - Accept -->
	</waypoint>
	<!-- #  6 --><waypoint x="-3775" z="-8558" y="218">
		if RoMScript("CheckQuest(420662);") == 1 then 
			repeat 
				player:target_NPC("Shamp");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(3,1);");
				yrest(500);
				RoMScript("CompleteQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420662);") == 2;
		end;
		if RoMScript("CheckQuest(420663);") == 0 then 
			repeat 
				player:target_NPC("Shamp");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(1,1);");
				yrest(500);
				RoMScript("AcceptQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420663);") == 1;
		end; <!-- Quest:  Claiming Armor - Complete, Claim Your Potions - Accept -->
	</waypoint>
	<!-- #  7 --><waypoint x="-3775" z="-8668" y="224">
		if RoMScript("CheckQuest(420663);") == 1 then 
			repeat 
				player:target_NPC("Reideen");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(3,1);");
				yrest(500);
				RoMScript("CompleteQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420663);") == 2;
		end;
		if RoMScript("CheckQuest(420665);") == 0 then 
			repeat 
				player:target_NPC("Reideen");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(1,1);");
				yrest(500);
				RoMScript("AcceptQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420665);") == 1;
		end; <!-- Quest:  Claim Your Potions - Complete, Complete Preparations - Accept -->
	</waypoint>
	<!-- #  8 --><waypoint x="-3718" z="-8673" y="224">	
		if RoMScript("CheckQuest(420665);") == 1 then
			repeat 
				player:target_NPC("Leighton");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(3,1);");
				yrest(500);
				RoMScript("CompleteQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420665);") == 2;
		end;
		if RoMScript("CheckQuest(420666);") == 0 then 
			repeat 
				player:target_NPC("Leighton");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(1,1);");
				yrest(500);
				RoMScript("AcceptQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420666);") == 1;
		end;
		if RoMScript("CheckQuest(420712);") == 0 then 
			repeat 
				player:target_NPC("Leighton");
				yrest(1000);
				RoMScript("OnClick_QuestListButton(1,1);");
				yrest(500);
				RoMScript("AcceptQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420712);") == 1;
		end; <!-- Quest:  Complete Preparations - Complete, Testing Your Skills - Accept, Posting Quests - Accept -->
	</waypoint>
	<!-- #  9 --><waypoint x="-3709" z="-8509" y="205">	
		if RoMScript("CheckQuest(420712);") == 1 then 
			repeat 
				player:harvest(110583);
				yrest(1000);
				RoMScript("OnClick_QuestListButton(3,1);");
				yrest(500);
				RoMScript("CompleteQuest();");
				yrest(500);
			until RoMScript("CheckQuest(420712);") == 2;
		end; <!-- Quest:  Posting Quests - Complete -->
	</waypoint>
	<!-- # 10 --><waypoint x="-3756" z="-8513" y="208">
		inventory:useItem("Weapon Package");
		yrest(1000);
		inventory:useItem("Armor Package");
		yrest(1000);
		inventory:useItem("Potion Package");
		yrest(1000);
	</waypoint>
	<!-- # 11 --><waypoint x="-3857" z="-8245" y="226">	
		if 4 > inventory:itemTotalCount("Mushroom Cap") then
			loadPaths("Quest_Testing_Your_Skills_420666");
		else
	</waypoint>
</waypoints>
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Failed to compile

#2 Post by lisa »

When I make up more complex code for in WP I first make it as a userfunction, that way you actually get error messages telling you what is wrong. If code is in a WP it just says failed to complie.
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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Failed to compile

#3 Post by MiesterMan »

Ah, good idea! It'll probably circumvent the probelm and I won't have to stuff so much code in the file. :D
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Failed to compile

#4 Post by rock5 »

I think the problem is, between <waypoint> and </waypoint> there should only be lua code. "<!-- Quest: Report In - Accept -->" is an xml comment.

Either change it to an lua comment "-- Quest: Report In - Accept --" or move it outside the waypoint tags.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Failed to compile

#5 Post by MiesterMan »

I origianlly had it as a lua comment and changed it to an XML comment hoping it would fix the problem (for all of them). In the end though, I changed those to cprintf's so it's a lua command again.

It took some doing but I got it fixed. If nothing else, the lua if statement in the last waypoint was messed up. :oops:

But I hope that thing about comments isn't true. You should be able to embed elements and comments and stuff, else it wouldn't be a problem to use "<" instead of &lt or whatever it is.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Failed to compile

#6 Post by rock5 »

Looks like you're right. Just tested it. No error.

I'd use lua comments in lua and xml comments in xml anyway.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Post Reply