targetting aggresive

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

targetting aggresive

#1 Post by kuripot » Mon Nov 25, 2013 9:58 pm

this use to target the given name or ID

Code: Select all

		local target = player:getTarget()
		local _tb = false
		local spawnboss = player:findNearestNameOrId(999999)
		if spawnboss then
			player:target(spawnboss)
how about targetting any aggresive enemy?

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: targetting aggresive

#2 Post by Bill D Cat » Mon Nov 25, 2013 11:43 pm

Attacking all mobs would be easy by setting the waypoint type to "NORMAL".

I'm guessing that is not what you want. It looks like you want to only attack the red named aggressive mobs, and not the yellow named passive mobs. I just wanted to get some clarification before I tried to code anything.

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: targetting aggresive

#3 Post by kuripot » Mon Nov 25, 2013 11:53 pm

even not a waypoint?? it is only the onload??
like this?? even no aggro detected?

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
	startGMDetect()
		changeProfileOption("EGGPET_ENABLE_ASSIST", "false")
		changeProfileSkill("SCOUT_AUTOSHOT", "AutoUse", true);
		changeProfileOption("AUTO_ELITE_FACTOR", 100000)
		changeProfileOption("MAX_TARGET_DIST", 180);
		changeProfileOption("COMBAT_DISTANCE", 170);

function woodenarrow()
      if inventory:getAmmunitionCount() == 0 then
      inventory:useItem(210304)
      end
end
function spam()
   local timetowait = 43200  --43200 sec. = 12 Hours
   local starttime = os.time()
   repeat


		local target = player:getTarget()
		local _tb = false
		local spawnboss = player:findNearestNameOrId(106770)
		if spawnboss then
			player:target(spawnboss)
		if target.HP > 0 then
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,17)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,20)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,9)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,14)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,13)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
	 player:update();
     if inventory:getAmmunitionCount() == 0 then
     	 inventory:useItem(210304)
		end  
             end 
	end
   until os.time() - starttime >= timetowait
   cprintf(cli.lightred, "Time out!\n")
   RoMScript("QuitGame()");
end

</onLoad>
</waypoints>

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: targetting aggresive

#4 Post by Bill D Cat » Tue Nov 26, 2013 12:55 am

I notice that most of your code is inside a function called spam(), and yet there is nothing else in the <onload> section that calls that function to be executed. So you either need to add a single line at the end that just calls the function, or remove the "function spam()" declaration and corresponding "end". I'm not sure what the line "local _tb = false" is doing in there, as the variable is not referenced anywhere else in the file.

And finally, you check your current target first, then look for spawnboss and target it if available, but then check the HP of your original target? I think the last line should be "if spawnboss.HP > 0 then". Rock5 could tell us if I'm wrong, but I think "target" is one pawn, and "spawnboss" is a different one in this context.

Code: Select all

   local target = player:getTarget()
   local _tb = false
   local spawnboss = player:findNearestNameOrId(106770)
   if spawnboss then
      player:target(spawnboss)
      if target.HP > 0 then

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: targetting aggresive

#5 Post by kuripot » Tue Nov 26, 2013 1:10 am

ows.. sorry i link wrong..

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
	startGMDetect()
		changeProfileOption("EGGPET_ENABLE_ASSIST", "false")
		changeProfileSkill("SCOUT_AUTOSHOT", "AutoUse", true);
		changeProfileOption("AUTO_ELITE_FACTOR", 100000)
		changeProfileOption("MAX_TARGET_DIST", 180);
		changeProfileOption("COMBAT_DISTANCE", 170);

function woodenarrow()
      if inventory:getAmmunitionCount() == 0 then
      inventory:useItem(210304)
      end
end
function spam()
   local timetowait = 43200  --43200 sec. = 12 Hours
   local starttime = os.time()
   repeat


		local target = player:getTarget()
		local _tb = false
		local spawnboss = player:findNearestNameOrId(106770)
		if spawnboss then
			player:target(spawnboss)
		if target.HP > 0 then
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,17)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,20)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,9)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,14)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,13)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
	 player:update();
     if inventory:getAmmunitionCount() == 0 then
     	 inventory:useItem(210304)
		end  
             end 
	end
   until os.time() - starttime >= timetowait
   cprintf(cli.lightred, "Time out!\n")
   RoMScript("QuitGame()");
end

</onLoad>
	<!-- #  4 --><waypoint x="3062" z="-14982" y="290">spam()	</waypoint>
</waypoints>


this code ok... but in this code he target the specific ID. i want to target any agreesive.. even no agroo dettected

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: targetting aggresive

#6 Post by Bill D Cat » Wed Nov 27, 2013 4:35 am

You can probably work something like this into your code to check to see if the mob is passive or aggressive.

Code: Select all

mob = player:getTarget()
if mob.Aggressive then
   -- It's a red named aggressive mob, so fight it.
else
   -- it's a yellow named passive mob, so ignore it.
end

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: targetting aggresive

#7 Post by kuripot » Wed Nov 27, 2013 6:49 am

one more thing...how can i scan the nearest aggresive mobs?? because in your code will only effect if i have a target.. what if i dont have yet a target and i want to find nearest aggressive mobs to target

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: targetting aggresive

#8 Post by kuripot » Wed Nov 27, 2013 7:08 am

this what i mean to say

Code: Select all

player:findNearestNameOrId(107772)
this is for specific Name or ID
i want to find nearestaggressive mobs

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

Re: targetting aggresive

#9 Post by rock5 » Wed Nov 27, 2013 7:30 am

What mobs are you talking about? Usually if you are botting an area and some mobs are red and some are yellow and you don't want to target the yellow, you would just add the yellow ones to your friends list in your profile or use lisas changeOptionFriendMob userfunction.
  • 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

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: targetting aggresive

#10 Post by kuripot » Wed Nov 27, 2013 8:02 am

this wp im using is for specific name.. and dont target anything rather than the name or id i specify in wp.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
   startGMDetect()
      changeProfileOption("EGGPET_ENABLE_ASSIST", "false")
      changeProfileSkill("SCOUT_AUTOSHOT", "AutoUse", true);
      changeProfileOption("AUTO_ELITE_FACTOR", 100000)
      changeProfileOption("MAX_TARGET_DIST", 180);
      changeProfileOption("COMBAT_DISTANCE", 170);

function woodenarrow()
      if inventory:getAmmunitionCount() == 0 then
      inventory:useItem(210304)
      end
end
function spam()
   local timetowait = 43200  --43200 sec. = 12 Hours
   local starttime = os.time()
   repeat


      local target = player:getTarget()
      local _tb = false
      local spawnboss = player:findNearestNameOrId(106770)
      if spawnboss then
         player:target(spawnboss)
      if target.HP > 0 then
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,17)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,20)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,9)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,14)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(4,13)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
         sendMacro("UseSkill(4,2)")
         sendMacro("UseSkill(2,2)")
    player:update();
     if inventory:getAmmunitionCount() == 0 then
         inventory:useItem(210304)
      end  
             end 
   end
   until os.time() - starttime >= timetowait
   cprintf(cli.lightred, "Time out!\n")
   RoMScript("QuitGame()");
end

</onLoad>
   <!-- #  4 --><waypoint x="3062" z="-14982" y="290">spam()   </waypoint>
</waypoints>

i want to use this in any aggresive mobs even no aggro dettected....

i use this

Code: Select all

sendMacro("UseSkill()")
beacause it is faster than cast_SKILL it is dosnt check gcd or the skill availability just spamming all UseSkill and if the skill is available it was cast whtever the situation..

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: targetting aggresive

#11 Post by kuripot » Sat Nov 30, 2013 7:11 am

this what im looking for

Code: Select all

TargetNearestEnemy()
but i dont know how to use


how can i apply on this code

Code: Select all

      local target = player:getTarget()
      local _tb = false
      local spawnboss = player:findNearestNameOrId(106770)
      if spawnboss then
         player:target(spawnboss)

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

Re: targetting aggresive

#12 Post by rock5 » Sat Nov 30, 2013 7:24 am

Let me see if I understand correctly. You want to target 106770 if it's there otherwise you want to target red aggressive mobs?

There is no option to target only red mobs which makes it difficult. player:findEnemy() gives a higher priority to aggressive mobs so is more likely to target aggressive mobs first. Is that what you want or do you want to absolutely ignore yellow mobs?
  • 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

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: targetting aggresive

#13 Post by kuripot » Sat Nov 30, 2013 8:14 am

this i want to do

Code: Select all

		local target = player:getTarget()
		local _tb = false
		local mobs = player:findEnemy()
		if mobs then
i will try this soon

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

Re: targetting aggresive

#14 Post by rock5 » Sat Nov 30, 2013 9:03 am

I don't really see the need for 2 variables 'mobs' and 'target'. Just find the enemy and target it if it exists. Also the syntax of the command is
  • player:findEnemy(aggroOnly, _id, evalFunc, ignore)
I would use the default eval function.

Code: Select all

local mobs = player:findEnemy(nil,nil,evalTargetDefault)
if mobs then
    player:target(mobs)
    etc...
  • 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

Who is online

Users browsing this forum: Bing [Bot] and 1 guest