WP file to camp WBs

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Froote
Posts: 17
Joined: Sun Aug 24, 2014 5:53 am

WP file to camp WBs

#1 Post by Froote » Fri Oct 03, 2014 7:52 pm

Hi

I am currently working on a waypointfile that camps near a WB spawning point and alarms another player if he saws the boss spawning.
It is currently made to camps Wodjin, Hackman, Mandara and Lagusen.

But i have an issue while i was testing it.
Anyhow i tried to fix it, to write some "--" to delete some lines, an error instantly occcurs when i load the WPF :

2014-10-04 02:39:07 - ...iquettes/micromacro/scripts/rom/classes/waypointlist.lu
a:84: Failed to compile and run Lua code for waypointlist onLoad event.

This is the following script.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onload>
	
	--=== User Option ===--
	
	local Main = "";
	-- Set the name of the character you want to whisp.
	
	--===================--
	
	local function evalClickable(address)
		return memoryReadByte(getProc(), address + 0x2F0) ~= 0
	end
	
	local Boss = nil;
	local BossNormal = nil;
	local BossFurax = nil;
	local Pilier = nil;
	local Alarme = soundLoad(getExecutionPath() .. "/alarm.wav");
	
	local ZoneID = getZoneId();
	
	if ZoneID = 15 then
		Boss = "Wodjin";
		BossNormal = 103580;
		BossFurax = 107183;
	elseif ZoneID = 16 then
		Boss = "Hackman";
		BossNormal = 103583;
		BossFurax = 107185;
	elseif ZoneID = 19 then
		Boss = "Mandara";
		BossNormal = 104705;
		BossFurax = 107792;
	elseif ZoneID = 21 then
		Boss = "Lagusen";
		Pilier = player:findNearestNameOrId(118923)
	end
	
	while Boss == "Lagusen" 
		if evalClickable(Pilier.address) then
			sendMacro( "SendChatMessage('" .. Boss .. " pop !!', 'WHISPER' , 0 ,'" .. Main .. "')" );
			soundPlay(Alarme);
			yrest(50000);
		end
		yrest(10000);
	end
	
	while Boss ~= nil
		if player:findNearestNameOrId(BossNormal,BossFurax) then
			sendMacro( "SendChatMessage('" .. Boss .. " pop !!', 'WHISPER' , 0 ,'" .. Main .. "')" );
			soundPlay(Alarme);
			yrest(50000);
		end
		yrest(10000);
	end
	
</onload>
</waypoints>

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: WP file to camp WBs

#2 Post by rock5 » Fri Oct 03, 2014 11:33 pm

I see a mistake we all make. Where you are checking the zone you are using = instead of ==.

In the future, to find a bug in a long onload try moving the whole contents of the onload into an lua file, eg. temp.lua, then load the lua in your onload, eg.

Code: Select all

<onload>
    include("waypoints/temp.lua")
</onload>
It will function the same but when you get an error it will indicate which line it is. So it will be easier to debug.
  • 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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: WP file to camp WBs

#3 Post by noobbotter » Mon Oct 06, 2014 7:24 am

In the future, to find a bug in a long onload try moving the whole contents of the onload into an lua file, eg. temp.lua, then load the lua in your onload, eg.
Oh, man. That will save me so much time in the future. Wish I had known that before.

Froote
Posts: 17
Joined: Sun Aug 24, 2014 5:53 am

Re: WP file to camp WBs

#4 Post by Froote » Tue Oct 07, 2014 7:18 am

I love the tip <3

i feel a bit embarrassed for this mistake :S, i fixed my code and i saw it wasn't the only mistake i did.

While testing i found that the pillar for Lagusen is not clickable like a chest. It opens a window as if you speak to a NPC. So i removed the R5 evalClickable function (but very helpful when needed :D).
I also found that Mandara has specific IDs while she doesn't aggro anyone (as if we have 2 Mandara : while she doesn't aggro, you can't attack her, like a NPC). I got the 63 lvl Mandara NPC ID, but the resentful Mandara still misses.

I create a new topic to post the WPfile.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests