This is a tutorial on how to work the Targeting component of ElfBot NG.
The targeting system can be used by both advanced and regular users. It can perform the simplest tasks, but also act smarter with more complications if needed.
It can by used by itself or together with the cavebot and has been put in place to more effectively combat the various creatures in Tibia. It lets you input how each different monster needs to be attacked, approached and possibly guarded against.
To change fields like Count, Setting #, Danger, Attack type etc, you must click on the field and use your keyboard UP/DOWN arrow keys!
Adding a new monster
To start off, open the Targeting dialog from the main bot menu. Several options are now available for you, as displayed below.
We will begin by adding a new monster to the targeting list.
1. Click on in the listbox to indicate that you will be adding a new monster to the list. 2. In the 'Name' field, type the name of the monster, ex: Rotworm
You should see the entry with the monster name now appear in the list box now indicating that it was done properly.
For each monster, you can specify 4 different settings, which will depend on the monster's HP% ranges. For each HP% range, you can make the targeting system deal with the monster differently.
3. Leave the 'Setting #' field at 1 to fill the fields for setting #1 (we will only do one setting)
The count field lets you specify for how many monsters on screen will this setting be triggered for. To keep this tutorial simple, we will leave this at 'Any' to indicate that this setting will work for any amount of set monster on screen.
4. Leave the 'Count' field at 'Any' to indicate that targeting will choose this entry for any amount of the set monster on screen
Now we must fill the HP percentage range for which the following settings are to be used. To keep this tutorial simple, we will put from 0 to 100 in the HP% range box.
5. Place 0 to 100 in the HP% range box to indicate that the following settings are to be executed for any amount of hp that the monster may have (do not append the % sign)
If the monster does any special attacks such as waves or beams, place them here so that the stance you select can put them into consideration. Note that this function works only with certain stances that control that movement of your character (read stance descriptions below).
6. Select the special attack which the monster can use
The 'Danger Level field' lets you assign a custom value ranging from 0 to 10 to each monster setting. This value is used in two ways. It will be used by the target selection method which will be outlined below. The monster having the highest danger level will be given more priority to be selected depending on the amplitude of the 'Danger' slider. The danger level is also used in some stances. For instance, its used in the 'Distance Away' stance to preferably stay further away from the enemies with a higher 'Danger level' when circling around multiple enemies, escaping dead ends, etc. Something to take into account is that danger levels are relative to each other, meaning that they will only have a meaning if multiple varieties of them are involved.
7. Select an appropriate danger level for the monster. We can use 0 since only one monster is present in the list
Stances control the movement of your character while the current monster is being targeted. Several movement behaviors, called stances, are at your disposal:
Dist - Away
A rather complex stance for distance fighters such as paladins and mages. It will keep a certain distance specfied in the "Range Distance" from your target, avoid dead ends, and try to pick the best path when running from or after monsters. This stance avoids waves/beams if the monster is configured to have those attacks.
Dist - Wait
Same as "Dist - Away", but will wait in place for the monster to get in shootable range specified by the "Range Distance" option before acting.
Dist - Straight
Same as "Dist - Away", but will try running in a straight line and avoid running diagonal to the monster if possible.
Dist - WaitStraight
A combination of "Dist - Straight" and "Dist - Wait".
Dist - Lure
Same as "Dist - Away", but will try luring the monster towards the last 'U' (Lure) waypoint that was walked-through in the waypoint list.
Dist - WaitLure
A combination of "Dist - Lure" and "Dist - Wait".
Melee - Parry
A close combat stance that will prevent creatures from surrounding you. It will try to keep up to 2 creatures on you at all times. If more creatures close by on you, it will shuffle around them and try to only keep 2 on you at all times.
Melee - Reach
Allows you to reach the monsters you are targeting on the client side, making it possible to close in on monsters through element fields (such as poison fields).
Melee - Approach
Approaches targets in a careful way, avoiding hordes of monsters, element fields (fire, energy, poison), circles around monsters to get hit by less monsters, avoids waves/beams (in contrast to Melee - Reach which only approaches monsters by the shortest path)
Melee - Circle
Will engage in circling the enemy only when you are 1sq around him, avoiding waves and other creatures. Use 'chase' client mode to get near him.
Melee - ParryReach
Allows you to reach the monsters you are targeting on the client side, making it possible to close in on monsters through element fields (such as poison fields). This stance will try to only have up to two monsters attacking you at the same time.
Melee - ReachCircle
Will engage in circling the enemy only when you are 1sq around him, otherwise use the bot reach system to get close to him.
Melee - Strike
A stance from the old days, this faces your target and uses a strike spell on it. Useful for revealing invisible monsters.
Melee - ReachStrike
Will reach the enemy using the bot's reach mechanism if further away than 1sq, or do as Melee - Strike when nearby.
Will attempt to lose the target from the screen towards wherever it sees a potential escape route. Intended to be used if an unsafe number of monsters appear on screen in combination with other Stances when a safe number of monsters is on screen.
Will lure a target towards the last 'U' waypoint crossed on the waypoint path at a distance specified in the 'Range distance' option and stand there until the creature has died. To be used for luring creatures in team/multiclient hunts.
8. Select the desired stance to use with the current monster. Here we will use the 'Dist - Away' stance to fight the monster at a distance
It is not necessary to select a stance for example if you want to use the serverside 'Chase' mode which follows the monster without the need for your character to perform movements on it's own. That is the setting which you can choose on your Tibia Client to the right of your equipment. However, we will not be using serversided chase in this example.
9. Leave the 'Attack Mode' at 'No Change' to use the Offsensive/Defensive/Balanced and Chase/Stand settings as selected in the client.
Desired action defines the set of attacks to use on the monster. The first field lets you choose between 'No Action', 'Attack' and 'Follow' while the second field lets you specify a rune or instant spell that you would like to use on the monster.
10. Select the desired attacks to use with the current monster. Here we will use the 'Attack' and 'No action' combination to simply execute an attack on the monster.
In some cases, you may wish to use a ring when fighting the current monster; a sword ring when killing a dwarf, an energy ring when killing a Dragon Lord (or if more than one comes on screen), a stealth ring when killing a 'Demon Skeleton'. You choose. 'No change' will not remove or place any ring in your slot from the previous setting. 'No ring' will remove any ring that you may have in your ring slot, and selecting any other ring will equip it if it is currently in one of your open backpacks.
11. Select the ring you want to use when fighting this monster. We will select 'No change' because we wont be doing any ring work while fighting this monster.
Lastly, you can select 'Loot monster' to instruct the bot that this is a monster that you want to loot. More information on looting can be found in the cavebot tutorial.
12. Check 'Loot monster' as we want this monster to be looted.
The Targeting system opens a lot of possibilities in terms of strategy or practical use, and was constructed with such in mind. For example, with just a small amount of configuration, you can be sding demons, and using explosion runes when his hp is low to not waste an sd to deal minor damage. Just experiment.
An important aspect of targeting is target acquisition. Basically, this is about which target is going to be selected for attacking/stanceing out of all of the others. Six sliders are provided for you to specify the importance of key factors in target selection depending on your preferences, personal style or the current circumstances. The more a slider is situated to the right, the more importance will be granted to that factor. Make sure that at least one factor is to the right, or otherwise there won't appear to be any useful logic in how targets get acquired.
List Order: Target selection will be favored to the targets appearing the higher on the 'Monsters Definition' list.
Health: Targets selection will be favored to the targets having the least amount of hp percentage.
Proximity: Target selection will be favored to the targets being the closest to you.
Danger: Target selection will be favored to the targets for which you have specified the highest Danger level.
Random: Target selection will have a random element favoring some targets more than others.
Stick: Target selection will tend to stick on the target it has previously chosen. This is very sensitive and stickiness will be conserved for an even small slider position.
You may have to play around with these to understand exactly how it works. For example, using only proximity will attack the target closest to you; but if you combine a small element of health, the monster with the same distance but smaller HP% will be favored. If the health property is such to out measure the importance of proximity, then weaker targets will, even though they are further away, be favored. The sliders are fully relative to each other, meaning that having slider1 at 30 and slider2 at 20 is the same as having slider1 at 60 and slider2 at 40. There is just a lot of space available for positioning them all to allow more precise combinations.
Target must be reachable: will only consider selecting this target if you can reach that monster by foot Target must be shootable: will only consider selecting this target if a projectile aimed from you towards him will not be obstructed
Range distance is the distance to keep away from the target both horizontally and vertically when using a distance stance. This will most likely depend on the range of the weapon you are using.
Attack frequency is the frequency of execution of spells. Sometimes, you may want to use a rune less frequently than your exhaust rate permits, or just keep spamming it more often to make sure it didn't miss for some reason.
Ignore Other's monsters lets you specify that you want to ignore monsters located at a custom amount of squares around other players to avoid stealing them.
Sync spells with attacks lets you specify that you want to shoot the spell in "Desired Action" right after you perform an attack on the monster. This can be used for manual hunting aswell even if Targeting is off, as long as this option is checked and the settings for the target monster are defined. Set "Attack frequency" higher than 2000 ms to use this properly because if no attack is made within that time, the spell will be forcefully cast anyway.
Allow diagonal movement allow stances to move your character in diagonal directions if they find it more suitable to do so. Note that for some stances this increases the number of computations significantly and may lag your computer (specially in wide open areas, where there is more possibilities for movement).
As a practical side note, if you create an entry called 'Others', it will be used for any other monster not directly defined in the list. Hopefully this should save some time when dealing with monsters with very similar settings or if you don't want to add every monster to the list.
Another possibility is to make an entry called 'Invisible', which will be applied to all invisible creatures, or ones that go invisible momentarily once they are invisible (Note that the entry must be situated above the monsters that go invisible in the list of monsters, as explained in the "Multiple Counts" part of this tutorial). From there, it can be used in two ways. If a Hp% range is not specified (from 0 to 0), targeting will ignore the invisible monster and the cavebot will just move on. If a Hp% range is specified however (ie 0 to 100), the bot will use the settings contained in the Invisible entry on the invisible monster (shoot a LMM on invisible stalker?).
Tibia Update 8.41: The 'Invisible' method has no practical use anymore because the bot can not longer see invisible monsters directly. However it was not removed from here or the bot because it may still be useful on some OT servers.
Revealing Invisible Monsters
Since the Tibia Update 8.41, monsters go totally invisible on the client side and it is not possible to see where they are as before. Also, it is not possible to shoot missile runes on the square on which they are located directly. This causes a lot of problems when you want to bot or even becomes very annoying when hunting manually. However, a workaround has been created for this (you need at least version 4.2.1 of ElfBot).
Because the monsters sparkle every once in a while or shoot missiles, it is possible to tell where they are momentarily just as a normal player can and shoot an area effect spell/rune or a strike spell on them. This system has been implemented into the Targeting component and can be used by simply creating an entry called 'Reveal' which will target invisible monsters that sparkled or shot projectiles and assume they are still standing on that square for 2 seconds. Needless to say, you can configure how you want to target those invisible monsters, set their danger level, etc, just like you would do for any other monster. Note however that it is not possible to know the current hp% of an invisible monster so it's hp% is always assumed to be 100%, meaning that you will need 0-100% in the hp% range setting in order for this to work.
Here are 2 examples of Targeting settings set up to reveal invisible monsters. The first one uses an explosion spell on the square where the monster is assumed to be. This could just as well be a GFB/Avalanche/Thunderstorm/Stoneshower, a wave or a radial spell. The second setting shows how to reveal or kill invisible monsters with a strike spell. It's done by using the Strike stance combined with a strike spell.
That's what it might look like if it's set to use an Ice Wave to reveal an invisible monster:
Multiple creature counts
To have targeting act differently for different amounts of a creature on the screen, you can change the 'Count' field for each monster entry. A count of 'Any' means that the entry is valid for any amount of monsters on the screen. A count of '1' means that the entry will be chosen if only one monster of that name is on the screen, and an entry with a count of '2+' for instance will be chosen if two or more of said monster is on screen.
Note that the Targeting system scans the list from top to bottom and finds the first matching count for the creature you are (or rather will be) targeting (This goes for categories, explained below, as well). For example, if you have Mummy (Any count)
Mummy >> 2
The entry for 2 Mummies will never be reached because Mummy (Any count) is a valid match for any amount of Mummies, including 2. You would have needed to place Mummy >> 2 on top, and in case there is not 2 Mummies on screen, Targeting would pick the entry for Any amount of Mummies. The correct way for situating these two entries is:
Mummy >> 2
Mummy (Any count)
Area effect spells
Since version 4.1.8 of ElfBot NG, you are allowed to choose from a set of area effect spells to be used in your hunts. The bot does full calculations of creatures situating themselves in the effect area of the spell and if the desired count is satisfied, the spell will get cast. The bot will not cast the spell if other players are in spell range, unless the option 'Non-pvp mode' in Extras is checked.
To use Area Effect Spells, simply make an Entry with the desired count and the entry will be chosen if as much enemies are in the area of effect of the spell.
The Area effect spells are:
Splash Missile Runes:Great Fireball, Avalanche, Thunderstorm, Stone Shower, Explosion
The bot will calculate the best square and shoot an Explosion or Great Ball of chosen element if it can hit a desired number of monsters.
Instant Radial Spells:Divine Caldera, Ground Shaker, Fierce Berserk, Rage Of The Skies, Wrath Of Nature, Hell's Core, Eternal Winter
The bot will cast the selected spell if it can hit a desired number of monsters that are located in the area of the spell.
Instant Directional Spells:Energy Beam, Great Energy Beam, Fire Wave, Ice Wave, Energy Wave, Terra Wave
The bot will turn towards the direction where it can hit a desired amount of monsters and cast the directional spell. It is better not to use Serversided Chase for this type of spell because the bot will not be able to control the character as well (turning). Players with high latency might experience misses using this spell type.
There is one restriction for creating entries with Area Effect spells: the entry with the Area Effect spell must have only 1 setting with hp% range from 0 to 100. Not respecting this rule may work for what you are trying to do, but it may also produce undefined results.
Because of the addition of Area Effect Spells, it becomes practical to target different types of creatures simultaneously. For this reason, since version 4.1.8 it is also possible to group monsters under categories and target them together. For instance, it will become possible to shoot an Avalanche rune if any of the monster types that we designate are present in the area of effect of the spell in a count of 3 or more. (ie: Not just shooting an Avalance on 3 ghouls, but also to be able shoot it on a group of 1 ghoul, 1 crypt shambler, and 1 demon skeleton).
To add a monster entry to one or more category, simply list the desired category names in the 'Categories' field for that monster. Each category name is made out of 1 letter/number symbol. For instance, entering '1dab3$' in the 'Categories' field for a monster will put him into the categories 1, d, a, b, 3 and $. This is simply to allow a certain monster to belong to multiple categories (you can think of it as one for each element and you wanting to shoot different kinds of runes). Category names are case sensitive, which means that 'g' and 'G' are different category names.
To create a Targeting entry for a category of monsters, create an entry called 'Category n', where n is the 1-character name of the category for which you are creating settings for.
For example, if you have the letter 'i' in Categories for all your monsters affected by Ice damage and have created an entry called 'Category i' with a count of 3+, hp% from 0-100 and the Avalanche rune as 'Desired Action', your character will shoot that rune if there is a square on which it will hit at least 3 of those monsters. Otherwise, it will kill them separately by using the regular settings as defined for each monster.
If you have multiple entries (ie different counts: Mummy and Mummy << 1 on the screenshot) for the same monster, make sure that each of those has your desired categories listed. Also, you most likely (unless you know more than well what you are doing) are going to need to put the "Category ? >> ?" entry higher in the list than the monsters which are members of that category (just like in the screenshot), as explained in the "Multiple Counts" part of this tutorial.
Saving and running targeting
Finally, the 'Run Targeting' check box switches the targeting subsystem on and off. You can also use the hotkey command 'settargeting on/off' to do exactly the same.
After you're done, remember to save your settings to a file. Input a name (or choose one from the list) and hit 'Save' to save the settings to disk. Note that it is not required to save the settings to disk every time you make a change. Changes in Targeting or even Cavebot are applied right as they are changed (sometimes, you may need to lose focus of the field you were changing for it to apply).
And remember that targeting can also be used without the cavebot, even the stances for movement, so play around with it.