ENs - Buff/Debuff Bar ScannerEUOX VERSION 45 oEUO Version 4.6c Beta Revision Date: Sept-2011 Public Release: 10/06
Theses Subs will move, change direction and scan the Buff/Debuff Icon bar in a fraction of a second in what ever direction it is facing and on whatever background it is over. The script is adaptive and will learn the new position/direction of the bar if it is moved or rotated, it is also multiclient aware, allowing you to scan buffbars over multiple clients from a single script without reloading the bars each time . This script uses OCR so the bufficon image must be visible on all clients being scanned.
Script is also availible from http://www.easyuo.com/forum/viewtopic.php?t=26234&postdays=0&postorder=asc&start=0Euo Version 42 and aboveYou need 2 files Scanbuffbar.text and scanbuffbar-Subs.txt
BuffBar Icons recognized by Category: MAGERY - NightSight, ReactiveArmour, Agility, Cunning, Protection, Strength, Bless, Incognito, MagicReflection, Invisibility, Polymorph, Clumsy, Feeblemind, Weaken, Poison, Curse, Paralyze, MassCurse,
SPECIAL MOVES - MortalStrike, TalonStrike, BleedAttack, PsychicAttack, Block, Feint, DualWield, HitLowerAttack, DefenseMastery, ForceArrow, HitLowerDefense, Dismount, Disarm
GARGOYLE - Flying, Berserk
SPELLWEAVING - GiftOfRenewal, Attunement, GiftOfLife, ArcaneEmpowerment, EtherealVoyage, EssenseOfWind, Thunderstorm, ImmolatingWeapon, ReaperForm
CHIVALRY - DivineFury, EnemyOfOne, ConsecrateWeapon, EOODebuff
NINJITSU - AnimalForm
MYSTICISM - Sleep , StoneForm, SpellPlague, EnchantBuff
NECROMANCY -CurseBloodOath, CasterBloodOath, CorpseSkin, EvilOmen, MindRot, PainSpike, Strangle, LichForm, VampiricEmbrace, WaithForm, HorrificBeast, CurseWeapon, PoisonImmunityResistance
ITEM BUFFS - FishPie, SpellFocusing, FocusingWeapons, ProtectiveWard, OrangePetals, RoseOfTrinsic, GrapesOfWrath, ManaPhase, SplinteringEffect, WeaponWard, Healing, Disguised,
ITEM Eodon Potions - JukariBurnPoultice, KurakAmbushersEssense, SakkhraProphylaxisPotion, BarrabHemolymphConcentrate, BarakoDraftOfMight, UraliTranceTonic
BUSHIDO - HonorableExecution, Confidence, Evasion, CounterAttack, LightningStrike, MomentumStrike, Honored, Perfection
MISC SKILL -Hidden/Stealthing , Meditation, Veterinary, AcceleratedSkillGain, FastSkillGain
MISC - CityTradeDeal
PVP - CriminalStatus, HeatOfBattleStatus, StatLoss
SPECIAL ATTACK - RageDebuff, MedusaStone, AureofNausea, WebDebuff, CorruptionDebuff, DiseaseDebuff, FearDebuff, FireDebuff, GazeOfDespair, HiryuDebuff, AnemiaDebuff, HowlOfCacophony
BARD PEACEMAKING - Resilience, Preservance
BARD PROVOCATION - Inspire, Invigorate
BARD DISCORDANCE - Tribulation,TribulationCaster, Despair,DespairCaster
MASTERY - DeathRayBuff, MysticWeapon, Conduit, ManaShield, EnchantedSummoning, AnticipateHit, Warcry, Intuition, Shadow, WhiteTigerForm, PlayingTheOdds, Thrust, ShieldBash, Bodyguard, HeightenSenses, Rampage, FistsOfFury, Knockout, FocusedEye, Toughness, ElementalFury, CalledShot, Boarding, Whispering, CombatTraining, Tolerance, InjectedStrike, Potency, WarriorsGift, HolyFistDebuff
Notes On Icons:When wanting to discover if a Buff/Deduff is on the bar, use the exact labeling as above and Add a _ to the front and back eg _EnemyOfOne_
- Fishpie - Sadly thier is only 1 fishpie icon for all pie types.
- ProtectiveWard - 1 Icon for both Spell Ward and Weapons Ward (From Ruined Sash of Warding)
- ArcaneEmpowerment and AcceleratedSkillGain - share the same icon.
Pots - use the magery buffs.
How to use... Call C:\Easyuo\ScanBuffBar.txt ; { x y Direction (UP/DOWN/LEFT/RIGHT) }
1. Firstly Download the ScanBuffBar.txt File and Save it in your C:\EasyUo Directory
2 .Then in your script call the scanner like one of the examples below:
;Call ScanBuffBar 1 493 UP ; Moves bar below main screen facing UP
;Call ScanBuffBar 1 493 ; Moves Bar to 1 493
;Call ScanBuffBar LEFT ; Makes Bar Face Left
Call ScanBuffBar ; Leaves the bar in Current postion.
Example of code usage: Arms/Disarms when BloodOathed
set %Armed #True
Repeat
Call ScanBuffBar ; Presumes file is in same location as euo
set !oathed _CurseBloodOath_ in %BuffBarIconNames
If ( !oathed && %Armed ) || ( ( ! !oathed ) && ( ! %Armed ) )
{
event macro 24 2 ; dis/Arm right change to 24 1 for left
set %armed ! %Armed
}
; Displaying Some Statistics
setuotitle %BuffBarCalls - BAR: %BuffbarDirection - Icons: %BuffBarIconsFound - %BuffBarIconNames
Wait 5
Until #CharGhost = YES || #CliLogged = 0
halt
Scripts Using BuffBar LAME - Le (semi)Automated Mob Eradicator. (For sampires) On Easyuo.comAnti Blood Oath on Easyuo.comC2 healer On SCriptuo.comLAME 3.0 - Le (semi)Automated Mob Eradicator - On Scriptuo.comMaddog's Automator On SCriptuo.comPosting scripts that rely on these subs:If you have a script that you want to post that uses these subs you are more than welcome to do so as long as you state in the header of your script/posts that your script requires ENs ScanBuffBar subs that can be downloaded form this URL
http://www.easyuo.com/forum/viewtopic.php?t=28548 or
http://www.scriptuo.com/index.php?topic=1508.msg11033#msg11033 This avoids much confusion of versions. The Buffbarscanner is frequently updated and having users download from the source is the best method. (Including the code in your file will quickly out date your code as the buff bar does frequently change, and downloading and overwriting the old version is alot simpler than having to edit every script that realies on these subs.)
DONOT include the subs in your code file or as an attachement.
DO send me a pm with the link to you post so i can have a look and post the link here
Creation At the time of writting these subs the Buff/Debuff bar was/is a relatively new thing, something I had started to visually use alot. So when it was suggested on the threads below, it gave me the kick needed to write the code.
http://www.easyuo.com/forum/viewtopic.php?p=247400&highlight=#247400 http://www.easyuo.com/forum/viewtopic.php?p=247402&highlight=#247402 Credits/Thanks - Their have been many contributors to this script over the many years it has been hosted and worked on. Thank you to everyone who has contributed encouragement, ideas, suggestions, heads up on new icons and in any other way.
A Note On Script SpeedFor 98% of all scripts that will use these buffbar sub it matters very little at what speed you detect the icons on the bar. How can I say that. Does it matter if you detect that your char is dismounted in 3ms or 33ms. For most scripts it does not. It takes many factors longer to remount than the difference in this detection time. The same goes for almost all the other icons (eg casting a spell or eating an apple). Once you achieve scan speeds of over 10x a second (long ago passed) it really makes little odds in actual usage. The one exception to this is for scripts that control multiple characters at once, eg extreme fully automated multi-char PVP bot army's under a single scripts control, in these cases faster is always better. These subs support such usage if that's is your play style preference.
These subs perform near identical speeds which ever way the bar is facing and no matter what background it is placed on. The difference with scanning on a black background is insignificant. Currently these subs will scan the entire bar no matter how many or how few icons, depending on the speed of your computer, lag etc.. anywhere from 1-4ms per scan Average of 2ms
Optimum Speed:
Currently thier are 3 things that you can do to slightly increase the scan times. (1) and (2) below changes will make a change to the initial scan; but over time the difference the changes make will be close to zero. Do it if you so wish. personally i dont bother. (3) has a more permanent effect but is only needed for very fast scripts that scan the bar many times a second.
(1) Increase the LPC in your calling script, this actually makes significant difference on the first call.
(2) The order of the icons in the setup script does not make any difference.
(3) For EasyUO (not OpenEUO)Instead of calling scanbuffbar directly place the below code in your script and it will call the scan routines as needed... this will reduce scan speeds to an average of 0-1ms per scan, if calling the buffbar very frequently. If you dont call the bar a min of 2+x a second then this step is just not needed.[spoiler=speed]
Sub ScanBuffBar
Set %BuffBarOLDLPC #LPC
Set #LPC 20000
set %BuffBarCalls %BuffBarCalls + 1
namespace push
namespace local ENs_BuffBarSubs . #charid
set !newString2
for !lc 0 !LoopCount
{
savePix !x2 . !lc !y2 . !lc %BuffBarPixelLoc
set !newstring2 !newstring2 , _ , #pixcol
}
if %0 > 0 || !newstring2 <> !oldstring2 || !newstring2 = _0_0_0
gosub EN_BB_AdvanceScan %0 %1 %2 %3
set %BuffBarIconsFound !BuffBarIconsFound
set %BuffBarIconNames !BuffBarIconNames
set %BuffbarDirection !BuffbarDirection
namespace pop
Set #LPC %BuffBarOLDLPC
return
sub EN_BB_AdvanceScan
set %BuffBar2ndScan %BuffBar2ndScan + 1
SavePix !ButtonX1 . !Cnt !ButtonY1 . !Cnt %BuffBarPixelLoc
if %1 > 0 || #pixcol <> !BuffBarKnownButtonCol1 || !newstring2 = _0_0_0
call ScanBuffBar-Subs OpenBuffBar %1 %2 %3 %4
set !BuffBarIconsFound 0
set !BuffBarIconNames _
set !oldString2 _ , !BuffBarKnownButtonCol1 , _ , !BuffBarKnownButtonCol2
set !Cnt 2
Repeat
savePix !x2 . !Cnt !y2 . !Cnt %BuffBarPixelLoc
set !oldstring2 !oldstring2 , _ , #pixcol
set !debug #pixcol
If !Cnt . !debug > 1 || ! . !debug = N/A 2
savePix !x1 . !Cnt !y1 . !Cnt %BuffBarPixelLoc
set !debug !debug , _ , #pixcol
If ! . !debug <> N/A 2
set !BuffBarIconNames !BuffBarIconNames , _ , ! . !debug , _
set !BuffBarIconsFound !BuffBarIconsFound + 1
; If ! . !debug = N/A
; set %BuffBarDebug !debug
set !Cnt !Cnt + 1
until ! . !debug = N/A && !Cnt >= !BuffBarTolerance
set !loopcount !Cnt - 1
if !loopCount < !BuffBarTolerance
set !loopcount !BuffBarTolerance
set !x20 !BuffBarButtonPosX1
set !y20 !BuffBarButtonPosY1
set !x21 !BuffBarButtonPosX2
set !y21 !BuffBarButtonPosY2
return
[/spoiler]
A Note On Speed TestingWith this script I've done alot of speed testing over the years. To do comparable speed testing between versions, their are a few important things to do in order to compare apples to apples, I probably have more rules I'll add them as i remember them. In order of importance (1), (2) and (3) being the main ones.
(1) LPC of versions must be the same
(2) the scenario of the test must be the same (ie both called or both gosub 'ed)
(3) the status of the buffbar at the start must be the same .. ie open for both or closed for both. Placing it in a random start position for each run is also helpful
(4) the difference in icon positioning in the lists must be the same. If 5th and 10th icon or 1st and 2nd etc. If the icon order in the 2 versions have changed then the icons tested on each script must be different or the orders matched. This doesn't make a difference in this script but in other peoples attempted copies it does.
Usage: See script for detailed license agreement.
(C) 2006-2011 All Rights Reserved JosephAJ Commercial usage requires written permission from the author.
NOTE: My scripts or any derivative of them are *not* for use in other players scripts!