Page 1 of 1

Modification: skip taget by level / Min Level / Max Level

Posted: Fri Jul 03, 2009 6:15 am
by d003232
With the new harvesting function I just startet new chars in the beginner are. While harvesting I also want to level up the char a little. After a view rounds of harvesting and killing it is not so usefull to still kill LvL 1 Fungies. So I did a small modification to check min/max level for the targets.

Insert two new default values in settings.lua line 38:

Code: Select all

			LOGOUT_SHUTDOWN = false,
			TARGET_LEVELDIF_BELOW = 999,			-- modif
			TARGET_LEVELDIF_ABOVE = 999,			-- modif
		}, hotkeys = {}, skills = {}, friends = {},
Insert following lines in player.lua at line 726 after the 'end;' and befor the '-- PK protect':

Code: Select all

			return false;
		end;

-- Begin of Modif
if( ( target.Level - self.Level ) > settings.profile.options.TARGET_LEVELDIF_ABOVE  or
    ( self.Level - target.Level ) > settings.profile.options.TARGET_LEVELDIF_BELOW ) then
	if ( self.Battling == false ) then   -- if we don't have aggro then
		return false;         -- he is not a valid target
	end;
	if( self.Battling == true  and         -- we have aggro
		target.TargetPtr ~= self.Address ) then   -- but not from that mob
		return false;         
	end;
end;
-- End of Modif

		-- PK protect
and use the new options in your profile:

Code: Select all

	<option name="TARGET_LEVELDIF_BELOW" value="2" />
	<option name="TARGET_LEVELDIF_ABOVE" value="3" />	

Have fun

Re: Modification: skip taget by level / Min Level / Max Level

Posted: Fri Jul 03, 2009 6:28 am
by Administrator
Maybe it would be better to not check directly by level, but by level difference. So, one option for how many levels below your level to attack a monster, and one for how many levels above. For example, 5 below and 3 above when you're level 10 would let you attack any monsters level 5 to 13. This would prevent you from having to edit your profile every time you level up. What do you think?

Re: Modification: skip taget by level / Min Level / Max Level

Posted: Fri Jul 03, 2009 7:26 am
by d003232
Administrator wrote:Maybe it would be better to not check directly by level, but by level difference.
Thats really good! I don't like to check so much options after every change of my botting area. By doing that way it is also possible
  • at harvesting only attack mobs that could be more dangerous and have a greater aggro range
  • by using negative values to deactivate the targeting function (means another way of traveling mode without need to change the waypoint file)
I changed the coding above.

Re: Modification: skip taget by level / Min Level / Max Level

Posted: Fri Jul 03, 2009 7:31 am
by 3cmSailorfuku
d003232 wrote:
Administrator wrote:Maybe it would be better to not check directly by level, but by level difference.
Thats really good! I don't like to check so much options after every change of my botting area. By doing that way it is also possible
  • at harvesting only attack mobs that could be more dangerous and have a greater aggro range
  • by using negative values to deactivate the targeting function (means another way of traveling mode without need to change the waypoint file)
I changed the coding above.
Just use Uberflex Autocombat, it will attack aggroing mobs while on your harvest route, it looks a bit weird though.

I believe though that if you wish to implent such a feature, the bot needs to know what monsters are aggresive & supportive or else it will skip monsters who are about to attack.

Re: Modification: skip taget by level / Min Level / Max Level

Posted: Wed Jul 08, 2009 12:30 pm
by Administrator
Ok, I just finally got around to testing this out, and everything works fine. I've committed it to SVN.