[Scripters] How to use Get_AbilityVia

free(?!) clues!

[Scripters] How to use Get_AbilityVia

Postby Kannkor » 08 Aug 2024, 23:43

First things first, what is Get_AbilityVia
It is the capability to be able to ask Ogrebot to find you an ability based on any export information. For example, you could ask it for a root, and it would go find out what roots you have, that meet a bunch of criteria, and give you the best ability or all the results.

Usage: ${OgreBotAPI.Get_AbilityVia[<key/value pairs>|<options>]}
This will return to you 0 if no abilities are found, or an abilityid (int64) of the best ability it selected.
Example: This will get you an ability that has a concentration cost of 1
Code: Select all
echo ${OgreBotAPI.Get_AbilityVia["ConcentrationCost","=","1"]}


Usage: OgreBotAPI:Spew_Get_AbilityVia[<key/value pairs>|<options>]
This will spew out all the abilities it found to the console
Example: This will display in the console all the abilities with a concentration cost of 1, regardless if they are actually available or not
Code: Select all
OgreBotAPI:Spew_Get_AbilityVia["ConcentrationCost","=","1",SkipAbilityAvailable]


Usage: OgreBotAPI:Get_AbilityVia[index:int64 reference, <key/value pairs>|<options>]
This will populate an index:int64 you pass it that you can do whatever you wish with it.
Example: Same as above, except you can iterate it as you see fit
Code: Select all
   variable index:int64 MyAbilities
   OgreBotAPI:Get_AbilityVia["MyAbilities","ConcentrationCost","=","1",SkipAbilityAvailable]
   echo MyAbilities: ${MyAbilities.Used}


What does "<key/value pairs>|<options>" mean?
Key/Value pairs are actually always in 3's.
The first is always the member (or Attribute from the export). Note: These are CASE SENSITIVE. This means "isroot" is not the same as "IsRoot".
The second is always the comparison operator. The following are supported. = (does a string equal, which works for numbers also), >, >=, <, <=.
The third is the value to compare it too. In the examples above, it was "1". Could be TRUE/FALSE, or any other value found in the export.

If it's in the export, it should be automatically available, including any future additions.


The following Options are available also. These are either single values, or a key/value pair (2).
NPCRequired
-> Means an NPC is required. It will use your target/implied target
ActorID <id>
-> Will compare against the ActorID provided instead of your target
SkipActorChecks
-> By default, it the ability it finds requires an NPC target, it will check your target. This skips that check
SkipAbilityAvailable
-> By default, it checks to make sure any ability it selects is actually available via a .TimeUntilReady <= 0 and .IsReady check. This skips that check
ignore <Attribute Name>
-> By default, it will check if the abilities it is selecting, meet what matches up in your GUI of Ogrebot. For example, if you had "No Threat Position Increases" checked, and asked for a "IsASingleTargetHostile" "=" "TRUE", it would NOT select any rescues. If you add "ignore" "IsThreatPositionIncrease" it would ignore that check, and allow it to select them.
-> Note: You do NOT need to ignore members you are searching for. For example, it understands if you are asking for a "IsThreatPositionIncrease", you likely don't care if it's disabled in Ogrebot GUI.
IgnoreGUI
-> This will ignore Ogrebot GUI entirely. Meaning if you had [x] No Roots selected, it won't care and if a root meets your criteria, it will be selected.
HonorGUI
-> This will honor what is in OgreBot GUI no matter what. For example, if you asked for a "IsThreatPositionIncrease" but you had No Threat Position Increases" checked, it would not find any results ever, since it will honor OgreBot GUI over what you are asking.
offensive
-> Will only cast offensive abilities that require an NPC target. If you didn't specify one using actorid from above, it will use your current target/implied target
Kannkor
 
Posts: 361
Joined: 06 Nov 2013, 11:49

Return to Guides & Strats

Who is online

Users browsing this forum: No registered users and 7 guests

cron