Stop Movement on Boss Detection

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Stop Movement on Boss Detection

#21 Post by rock5 » Mon Aug 15, 2011 2:11 am

Looks like it is running from something other than a mob. Maybe we should add a mob type check. Cgange the eval function to

Code: Select all

    function eliteEval(address)
		local target = CPawn(address)
		
		-- Check if mob
		if target.Type ~= PT_MONSTER then
			return false
		end
		
		-- Check hp against elite factor
		if( player.MaxHP * settings.profile.options.AUTO_ELITE_FACTOR > target.MaxHP ) then
		   return false
		end
		
		return true
	end
I changed it around a bit so it will be easier to add more checks if needed.
  • 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

whome
Posts: 58
Joined: Fri Jun 17, 2011 2:51 am

Re: Stop Movement on Boss Detection

#22 Post by whome » Mon Aug 15, 2011 3:18 am

Thanks Rock for the help! Unfortunately when I used your code it got this error....

Code: Select all

Loaded waypoint path 8_Ostriches.xml
No return path with default naming 1-9SS/8_Ostriches_return.xml found.
We use the normal waypoint path 8_Ostriches.xml now.
GM detection started
Moving to waypoint #1, (4046, 7804)
[string "   elites()   "]:1: attempt to call global 'elites' (a nil value)
when I used this however, it worked.... at least it ran away, but it didnt stay away for long enough. It detected, ran away, then reseumed after it looped through several times. This is what I used...

Code: Select all

     function eliteEval(address)
            local target = CPawn(address)
            if( target.MaxHP > player.MaxHP * settings.profile.options.AUTO_ELITE_FACTOR ) then
               return true
            end
            return false
            end

            function elites()
            mob = player:findNearestNameOrId("Bronze Shell Scooray",nil,eliteEval)
            if mob then
	    print("Running away from "..(mob.Name or "<no name>"))
            __WPL:setWaypointIndex(1); -- put what you want to do here if elite nearby
            end
      end
Can I enter a pause somewhere for a set time?

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

Re: Stop Movement on Boss Detection

#23 Post by rock5 » Mon Aug 15, 2011 5:24 am

whome wrote:[string " elites() "]:1: attempt to call global 'elites' (a nil value)
I didn't say to delete the elites() function. I said to replace the eval function.

Code: Select all

<onload>
	function eliteEval(address)
		local target = CPawn(address)
		
		-- Check if mob
		if target.Type ~= PT_MONSTER then
			return false
		end
		
		-- Check hp against elite factor
		if( player.MaxHP * settings.profile.options.AUTO_ELITE_FACTOR > target.MaxHP ) then
		   return false
		end
		
		return true
	end

	function elites()
		mob = player:findNearestNameOrId("Bronze Shell Scooray",nil,eliteEval)
		if mob then
			print("Running away from "..(mob.Name or "<no name>"))
			__WPL:setWaypointIndex(1); -- put what you want to do here if elite nearby
		end
	end
</onLoad>
  • 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

whome
Posts: 58
Joined: Fri Jun 17, 2011 2:51 am

Re: Stop Movement on Boss Detection

#24 Post by whome » Mon Aug 15, 2011 5:45 am

Doh, sorry, im such a dud when it comes to this stuff....... You guys are such whizzes :mrgreen: I am learning a little by little, slowly, slowly. Thanks for all the help anyway.... Ill give the new stuff a go and post only if I need. Thanks heaps :)

Post Reply

Who is online

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