Cyplops stronghold and zurhidon negotiator

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Cyplops stronghold and zurhidon negotiator

#21 Post by kanta » Sun Aug 07, 2011 11:16 am

Well, I've done something similar to what botje has done. My problem is I don't have an AoE. So I began my journey into the frustrating realm of targeting...

I started off with the following code in my profile <onPreSkillCast>:

Code: Select all

    		zneg = player:findNearestNameOrId("Zurhidon Negotiator")
    		if zneg then
    		player:target(zneg)
    		player:update()
    		player:fight();
    	end;
This seemed to work fairly well then I thought about it and took it a step further. I thought "why not make a function to detect what instance I'm in and have it automatically detect which target(s) I need to look for". So I came up with this function:

Code: Select all

--=<< Mob check for profile onPreSkillCast >>=--

function psmc()
-- Origin
	local zoneid = RoMScript("GetZoneID()")
		if zoneid == 116 then
		printf("Looking for dark blood bug().\n")
    		bug = player:findNearestNameOrId("Dark Blood Bug")
    		if bug then
    		player:target(bug)
    		player:update()
    		player:fight();
    	end;
-- Cyclops Stronghold
		elseif zoneid == 252 then
		printf("Looking for zurhidon negotiator().\n")
    		zneg = player:findNearestNameOrId("Zurhidon Negotiator")
    		if zneg then
    		player:target(zneg)
    		player:update()
    		player:fight();
    	end;
		end;
end;
Then in the profile <onPreSkillCast> I only have to put

Code: Select all

<onPreSkillCast><![CDATA[
-- This event receives the skill your going to cast and is accessible using arg1
-- Ex arg1.Name is the name of the skill
-- Add lua code you want to execute here
		psmc();
]]></onPreSkillCast>
This is working quite well. So well, in fact, that when I tested the waypoint and gathered up the Protectors to summon Negotiator..... It wouldn't target/kill the Protectors because it was constantly trying to retarget on Negotiator. :oops:
Well, since I have no AoE skill to use I had to come up with something to kill the little buggers because there was no way I wanted to mess up my previous code that was working so well. So I put the following into my waypoint once I had all 4 gathered up:

Code: Select all

	<!-- # 91 --><waypoint x="5378" z="3159" y="47">
		__WPL:setForcedWaypointType("TRAVEL")
	</waypoint>
	<!-- # 92 --><waypoint x="5565" z="3351" y="47">	</waypoint>
	<!-- # 93 --><waypoint x="5618" z="3310" y="47">	</waypoint>
	<!-- #  5 --><waypoint x="5735" z="3327" y="47">	</waypoint>
	<!-- #  6 --><waypoint x="5833" z="3367" y="47">	</waypoint>
	<!-- #  7 --><waypoint x="5836" z="3187" y="47">	</waypoint>
	<!-- #  8 --><waypoint x="5842" z="3003" y="47">	</waypoint>
	<!-- #  9 --><waypoint x="5738" z="2989" y="47">	</waypoint>
	<!-- # 10 --><waypoint x="5577" z="2975" y="47">	</waypoint>
	<!-- # 11 --><waypoint x="5451" z="3146" y="47">
		__WPL:setForcedWaypointType("NORMAL")
      repeat
      player:findNearestNameOrId("Zurhidon Protector")
      player:target("Zurhidon Protector")
      player:fight();
      until player:findNearestNameOrId("Zurhidon Negotiator")
      yrest(4000);
	</waypoint>
This is now working perfectly. But.... I'm running into a new problem.... I'm killing Negotiator too fast :twisted: ... He's not getting to use the Protectors to heal himself so the fight gets reset. Any ideas?
Scout/Knight/Rogue 70/66/66

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

Re: Cyplops stronghold and zurhidon negotiator

#22 Post by rock5 » Sun Aug 07, 2011 11:56 am

This isn't in answer to your question but how about this to simplify things?

Code: Select all

function psmc(mobname, zone)
	local zoneid = RoMScript("GetZoneID()")
	if zoneid == zone then
		printf("Looking for %s\n", mobname)
		local mob = player:findNearestNameOrId(mobname)
		if mob then
			player:target(mob)
			player:update()
			player:fight();
		end;
	end
end
  • 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

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Cyplops stronghold and zurhidon negotiator

#23 Post by kanta » Sun Aug 07, 2011 12:04 pm

I thought about something like that but I prefer to only have one command needed. With the code you are suggesting, you would need to put one at least one entry per instance that you farm, assuming only one mob needs special targeting rules. Also, if anything special needs to be done, such as in my case, it seems I'm going to have to replace player:fight() with some sort of custom skill rotation for Negotiator.
Scout/Knight/Rogue 70/66/66

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

Re: Cyplops stronghold and zurhidon negotiator

#24 Post by rock5 » Sun Aug 07, 2011 12:16 pm

kanta wrote:I thought about something like that but I prefer to only have one command needed. With the code you are suggesting, you would need to put one at least one entry per instance that you farm
You could use it like this,

Code: Select all

function psmc()
	local subFunction(mobname, zone)
		local zoneid = RoMScript("GetZoneID()")
		if zoneid == zone then
			printf("Looking for %s\n", mobname)
			local mob = player:findNearestNameOrId(mobname)
			if mob then
				player:target(mob)
				player:update()
				player:fight();
			end;
		end
	end
	
	subFunction("Dark Blood Bug",116)
	subFunction("Zurhidon Negotiator",252)
end
kanta wrote:Also, if anything special needs to be done, such as in my case, it seems I'm going to have to replace player:fight() with some sort of custom skill rotation for Negotiator.
Good point. Fair enough.
  • 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

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Cyplops stronghold and zurhidon negotiator

#25 Post by kanta » Sun Aug 07, 2011 12:28 pm

I'd love to be able to use that coding. So much cleaner than what I'm going to need to use. I think for the majority of players using the bot they can use your function and be fine with it. Less coding they would need to deal with, less chance for error. I can see this being used for more than just boss fights now that I think of it. It could be used in pretty much any zone to prioritize mob targeting. Maybe for that sort of use I can just change the label for one of the functions and use it that way.
Scout/Knight/Rogue 70/66/66

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Cyplops stronghold and zurhidon negotiator

#26 Post by kanta » Sun Aug 07, 2011 1:48 pm

Just found a problem with my coding of

Code: Select all

   <!-- # 11 --><waypoint x="5451" z="3146" y="47">
      __WPL:setForcedWaypointType("NORMAL")
      repeat
      player:findNearestNameOrId("Zurhidon Protector")
      player:target("Zurhidon Protector")
      player:fight();
      until player:findNearestNameOrId("Zurhidon Negotiator")
      yrest(4000);
   </waypoint>
If, for whatever reason, the "until player:findNearestNameOrId("Zurhidon Negotiator")" command doesn't get detected my character will just stand at that waypoint until the end of time. Trying to do something like

Code: Select all

	<!-- # 11 --><waypoint x="5451" z="3146" y="47">
		__WPL:setForcedWaypointType("NORMAL")
   local startwait = os.clock()
      repeat
      player:findNearestNameOrId("Zurhidon Protector")
      player:target("Zurhidon Protector")
      player:fight()
      until player:findNearestNameOrId("Zurhidon Negotiator") or ( 50 > (os.clock() - startwait) )
      yrest(4000)
	</waypoint>
But this doesn't seem to solve the problem. It breaks the repeat loop so I have my doubts that the bot will reliably kill all the protectors to summon negotiator.

**UPDATE**

Think I found my error. It should be this way

Code: Select all

until player:findNearestNameOrId("Zurhidon Negotiator") or (os.clock() - startwait) >= 20
Scout/Knight/Rogue 70/66/66

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 1 guest