The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: Unknown | March 29, 2008 @ 10:19am
PHP Code
[
Download
]
;-----------------------------------------------| ; Shaman Routine by Swolbyn v0.7 | ;-----------------------------------------------/ ; ; - Added a checkbox for spamming pull spell on casters ; - Hopefully fixed a bug that would cause you to stand there constantly trying to target instead of fighting ; - Cleaned up GUI a little. ; ; - Fixed if a creature dies in water, you would endlessly stand there jumping, not looting. ; - Added Swimming checks in buff pulse, if your toon is swimming it will jump and try to ; move towards the current target to melee range. To Prevent drowning. ; - Various tweaks to combat and pull logic ; ; - Removed flee, when I turned it on it was bugging stuff up big time. ; - Many combat tweaks ; - Added Shamanistic Focus Support ; - Under Spells tab you can choose "Save Shocks For Shamanistic Focus" ; When this is selected you will not use shocks regularly unless you have the focused effect after a crit attack ; - Immunities and Running Mobs Redesign ; - Now Mob Immunities and fleeing creatures are stored in MobData.xml in the routines folder ; ; - Reinarcation code reworked some. Still a little flaky there is a rare occurance when you reincarnate and then die quickly after that it doesn't detect you are dead again thus sitting at graveyard. It's rare. but happens. Due to this I have implemented a checkbox on main class configuration tab you can turn it off or on as you like. ; - Further adjustments to the attacking routines. FINALLY if a caster is shooting at you from afar, you'll shoot at him from afar. until he runs too close for your ranged spells, then you run to melee range as well. Works quite nicely. ; - Immunities should finally work. Took a bit of work this was a bitch :) ; ; - Reincarnation logic modifications ; - Further tweaks to combat / pull logic ; ; - Completely overhauled the Pull routine. Much smoother now. ; - Added in Disease Cleansing Totem logic to Mimic Poison Totem Logic ; - Added in the ressurection logic. (needs testing, not sure if it works) ; - Fixed some typos i found in the shielding logic ; - Fixed the Water Walking logic ; ; Thanks to all the many shaman routine writers out there in the openbot forums! ; This bot is a giant merged hybrid of shamany goodness. It includes some modified ; functions from all the many different bots that I have come across; as well as some ; custom stuff that I wrote in (and continue to do so) as I botted my shaman ; and notice changes that I wish to see. ; ; GUI kept from APOC's shaman routine, just took out some checkboxes that I found ; useless, i've integrated the logic into the system so there was no need for checkboxes. ; ; Overall my goal with this bot was to make it smarter. Less configuration is needed ; for certain aspects of it. ; ; You milage may vary. But I basically set it to use random shocks. I put my primary ; totem for combat set. leave the other totem boxes blank. (I used magma totem). ; Bot will automatically throw down stoneclaw totems on adds and uses the primary ; totem (magma for me) if the danger lvl is high enough or there's adds. This results ; in easier fights not wasting mana on totems. ; ; Curing poison and disease has been reworked. Will attempt to throw down a cure ; Totem if poisoned too soon after the first cure poison (20 seconds). ; ; I will continue updating the bot as I level and gain access to higher lvl spells. ; My shaman is currently in the 30's so if you are trying to bot higher lvl stuff ; You *may* find the luxury items not working. (Ex. I don't have dual wield or ; elementals to test yet.) I will get to them as I level and discover them. :) ; objectdef oClass inherits oBase { /**************************************/ /************ VARIABLES ***************/ variable bool UsePull = TRUE variable bool SpamPull = FALSE variable string PullSpell = "None" variable int RestHP = 50 variable int RestMP = 50 variable int StandHP = 80 variable int StandMP = 80 variable string EarthTotem = "" variable string FireTotem = "" variable string AirTotem = "" variable string WaterTotem = "" variable bool UseEarthElementa = FALSE variable bool UseFireElemental = FALSE variable bool UseEarthShock = FALSE variable bool UseFlameShock = FALSE variable bool UseFrostShock = FALSE variable bool RandomShock = FALSE variable bool SaveShocks = FALSE variable int ConserveMana = 40 variable bool UseLBolt = FALSE variable bool UseChainLight = FALSE variable string MainHand = "None" variable string OffHand = "None" variable string Shield = "None" variable bool ShieldOnPull = FALSE variable bool DW = FALSE variable int HealWave = 20 variable int LHealWave = 50 variable int GOTN = 60 variable bool Output = TRUE variable int MaxCastRange = 20 variable int MaxShockRange = 20 variable bool HasEarthTotem = FALSE variable bool HasFireTotem = FALSE variable bool HasWaterTotem = FALSE variable bool HasAirTotem = FALSE variable bool UseReincarnation = FALSE variable bool UseHPot = FALSE variable bool UseMPot = FALSE variable bool UseBandages = FALSE variable int HPot = 25 variable int MPot = 25 variable int Bandage = 25 variable int restWaitTimer = 0 variable int buffWaitTimer = 0 variable int healWaitTimer = 0 variable int curePoisonTimer = 0 variable int cureDiseaseTimer = 0 variable int jumpTimer = 0 variable int PotTimer = 0 variable int DangerMedium = 15 variable int DangerHigh = 30 variable int DangerVeryHigh = 45 variable int DangerLevel = 0 variable int Dangerlvl = 0 variable int BuffNum = 0 variable bool debuffStatus = FALSE variable string RealmChar = "${ISXWoW.RealmName}_${Me.Name}_${Me.Class}" variable bool MeleeOnly = FALSE variable bool RunnerDealtWith = FALSE variable bool Revived = FALSE variable int ReincarnateCount = 0 variable int BackupAttempts = 0 variable string MobDataStorage = "./routines/MobData.xml" variable set MobDataImmunities variable set MobDataRunners variable collection:index:string RandomCast variable collection:int RandomCastCount /**************************************/ /***********Init & Shutdown************/ method Initialize() { LavishSettings:AddSet["MobData"] LavishSettings["MobData"]:Import["${MobDataStorage}"] This:LoadConfig This:InitShamanGUI if ${Me.Action["Gift of the Naaru"].Usable} { UIElement -toggle GOTN@Heals@Pages@ClassGUI UIElement -toggle lblGOTN@Heals@Pages@ClassGUI } This:SetDistances This:CreateUIErrorStrings This:SetTotems This:InitRandoms This:InitTriggers This.MobDataImmunities:Clear This.MobDataRunners:Clear This:LoadList["MobData","MobDataImmunities"] This:LoadList["MobData","MobDataRunners"] Bot:AddPulse["Class","Pulse",10,TRUE,TRUE] UIElement[ClassGUI].FindChild[Console]:Echo["^_^=================================^_^"] UIElement[ClassGUI].FindChild[Console]:Echo[" Swolbyn's Shaman Routine v0.7"] UIElement[ClassGUI].FindChild[Console]:Echo["^_^=================================^_^"] } method Shutdown() { This:SaveConfig This:RemoveTriggers This:ExportList["MobData","MobDataImmunities"] This:ExportList["MobData","MobDataRunners"] LavishSettings["MobData"]:Export["${MobDataStorage}"] } method Pulse() { ExecuteQueued } method SetDistances() { if ${This.GetSpellRange[30, "elemental"]} { This.MaxCastRange:Set[${This.GetSpellRange[30, "elemental"]}] This:CustOutput["Setting New MaxRange to ${This.MaxCastRange}"] This.MaxShockRange:Set[${This.GetSpellRange[20, "elemental"]}] This:CustOutput["Setting New MaxShockRange to ${This.MaxShockRange}"] } } member GetSpellRange(int base, string spellTree) { if ${spellTree.Equal[elemental]} return ${Math.Calc[${base}*(1+(0.1*${Me.Talent[Storm Reach]}))-1].Round} return ${base} } /**************************************/ /**********UI Error Strings************/ variable collection:string UIErrorMsgStrings method CreateUIErrorStrings() { This.UIErrorMsgStrings:Set["You are facing the wrong way!","backward"] This.UIErrorMsgStrings:Set["Target too close","backward"] This.UIErrorMsgStrings:Set["You are too far away!","forward"] This.UIErrorMsgStrings:Set["Out of range.","forward"] } variable bool needUIHook = TRUE method UIErrorMessage(string Id, string Msg) { if ${This.UIErrorMsgStrings.Element[${Msg}](exists)} && !${Bot.PauseFlag} && ${This.crazyWaitTimer} < ${LavishScript.RunningTime} { if ${Msg.Equal["Target too close"]} || (${Target.Distance} < 5 && ${Me.InCombat}) || ${This.UIErrorMsgStrings.Element[${Msg}].Equal["forward"]} && !${Me.Casting} { This:Debug[${Msg}] This:CustOutput["Moving ${This.UIErrorMsgStrings.Element[${Msg}]} - UI Error: ${Msg}"] Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] This.attackWaitTimer:Set[${This.InMilliseconds[25]}] This.pullWaitTimer:Set[${This.InMilliseconds[25]}] move ${This.UIErrorMsgStrings.Element[${Msg}]} 1000 return } } } /**************************************/ /*********External Mob Data************/ method LoadList(string dataType, string loadingList) { variable iterator i if !${LavishSettings[${dataType}].FindSet[${loadingList}](exists)} LavishSettings[${dataType}]:AddSet[${loadingList}] LavishSettings[${dataType}].FindSet[${loadingList}]:GetSettingIterator[i] i:First while ${i.IsValid} { ${loadingList}:Add[${i.Key}] i:Next } } method ExportList(string dataType, string loadingList) { variable iterator i LavishSettings[${dataType}].FindSet[${loadingList}]:Clear ${loadingList}:GetIterator[i] i:First while ${i.IsValid} { LavishSettings[${dataType}].FindSet[${loadingList}]:AddSetting[${i.Key},${i.Key}] i:Next } } /**************************************/ /**************Triggers****************/ method InitTriggers() { AddTrigger DetectRunner "[Event:@eventid@:CHAT_MSG_MONSTER_EMOTE](\"%%s attempts to run away in fear!\",\"@Mob@\",@*@" AddTrigger DetectImmune "[Event:@eventid@:CHAT_MSG_SPELL_SELF_DAMAGE](\"Your @FailedSpell@ failed. @Mob*@ is immune.@*@" } method RemoveTriggers() { RemoveTrigger DetectRunner RemoveTrigger DetectImmune } function DetectRunner(string Line, int eventid, string Mob) { if !${This.MobDataRunners.Contains[${Mob}]} { This:CustOutput["Added ${Mob} to the runner list"] This.MobDataRunners:Add[${Mob}] } } function DetectImmune(string Line, int eventid, string FailedSpell, string Mob) { variable string MobId MobId:Set[${Mob}#${FailedSpell}] if !${This.MobDataImmunities.Contains[${MobId}]} { This:CustOutput["Added ${MobId} to the mob immune list"] This.MobDataImmunities:Add[${MobId}] } } /**************************************/ /***********Character States***********/ member isRunner() { if ${This.MobDataRunners.Contains[${Target.Name}]} return TRUE return FALSE } member isImmune(string SpellName) { if ${This.MobDataImmunities.Contains[${Target.Name}#${SpellName}]} return TRUE return FALSE } member isPoisoned() { BuffNum:Set[1] while ${BuffNum} < 16 { BuffNum:Inc if ${Me.Buff[${BuffNum}].DispelType.Equal["Poison"]} { return TRUE } } return FALSE } member isDiseased() { BuffNum:Set[1] while ${BuffNum} < 16 { BuffNum:Inc if ${Me.Buff[${BuffNum}].DispelType.Equal["Disease"]} { return TRUE } } return FALSE } /**************************************/ /************Reincarnation*************/ member NeedDead() { if !${This.Revived} && ${This.ReincarnateCount} < 10 && (${Me.Dead} || ${Me.Ghost}) && ${This.UseReincarnation} { return TRUE } else { return FALSE } } method DeadPulse() { This:Output["Bad Shaman! you died?!"] Bot.RandomPause:Set[25] This.ReincarnateCount:Inc if ${This.CanUseAnkh} { if ${WoWScript[StaticPopup1:IsVisible()]} { This:CustOutput["Reincarnation REPOPPING!"] This.Revived:Set[TRUE] This.ReincarnateCount:Set[0] WoWScript UseSoulstone() WoWScript RepopMe() } } return } member CanUseAnkh() { if ${Navigator.PointIsSafe[${Me.X},${Me.Y},${Me.Z}]} { if ${Item[-inventory,"Ankh"](exists)} && ${Spell[Reincarnation](exists)} && !${Spell[Reincarnation].Cooldown} { This:CustOutput["We can use Reincarnation here."] return TRUE } else { This:CustOutput["Can't self res!"] } } else { This:CustOutput["Not a safe spot to use Reincarnation"] } return FALSE } /**************************************/ /****************Rest******************/ member NeedRest() { if ${Me.InCombat} || ${Targeting.realAgg} return FALSE if ${This.LootFirst} return FALSE if ${Me.Buff[Resurrection Sickness](exists)} return TRUE if ${Me.PctHPs} < ${This.RestHP} return TRUE if ${Me.PctMana} < ${This.RestMP} return TRUE if ${Me.PctHPs} < ${This.StandHP} && ${Me.Sitting} return TRUE if ${Me.PctMana} < ${This.StandMP} && ${Me.Sitting} return TRUE return FALSE } method RestPulse() { if ${Me.InCombat} || ${Targeting.realAgg} return if ${Me.Casting} return if ${Movement.Speed} || ${Movement.Forward} || ${Movement.Backward} { Toon:Stop return } if ${Me.Buff[Resurrection Sickness](exists)} { Toon:Sitdown return } if !${Me.Dead} && !${Me.Ghost} This:Revived:Set[FALSE] if ${This.ShouldCallTotems} { Toon:CastSpell["Totemic Call"] This:CustOutput["Calling my totems back"] return } if ((${Me.PctMana} >= ${This.StandMP}) && (${Me.PctHPs} >= ${This.StandHP})) && ${Me.Sitting} { Toon:Standup This:Output["Standing."] return } This:debuffAll if !${Consumable.HasFood} && ${Me.PctHPs} < ${RestHP} && !${Me.Buff[Drink](exists)} && !${Me.Casting} && ${This.buffWaitTimer} < ${LavishScript.RunningTime} { if ${Toon.canCast["Lesser Healing Wave"]} { Toon:CastSpell["Lesser Healing Wave"] This:CustOutput["Casting Lesser Healing Wave - Rest"] This.buffWaitTimer:Set[${This.InSeconds[20]}] return } elseif ${Toon.canCast[Healing Wave]} { Toon:CastSpell["Healing Wave"] This:CustOutput["Casting Healing Wave - Rest"] This.buffWaitTimer:Set[${This.InSeconds[20]}] return } } if ${Me.PctHPs} < ${This.Bandage} && ${Toon.canBandage} && !${Me.Sitting} && ${This.UseBandages} { Toon:Bandage This:CustOutput["Bandaging...."] return } if ${Me.PctHPs} < ${This.RestHP} && ${Consumable.HasFood} && !${Me.Buff["Food"](exists)} && !${Me.Swimming} && !${Me.InCombat} && !${Me.Casting} && !${This.isPoisoned} && !${This.isDiseased} && !${Me.Sitting} { Consumable:useFood This:CustOutput["Eating..."] return } if ${Me.PctMana} < ${This.RestMP} && ${Consumable.HasDrink} && !${Me.Buff["Drink"](exists)} && !${Me.Swimming} && !${Me.InCombat} && !${Me.Casting} && !${This.isPoisoned} && !${This.isDiseased} && !${Me.Sitting} { Consumable:useDrink This:CustOutput["Drinking..."] return } if ${Me.PctMana} < ${This.RestMP} && ${Toon.canCast[M"ana Spring Totem"]} && !${This.OwnedTotemsCheck["Mana Spring Totem"]} && ${This.HasWaterTotem} && !${Consumable.HasDrink} && !${Me.Buff["Drink"](exists)} && !${Me.Swimming} && !${Me.InCombat} && !${Me.Casting} { Toon:CastSpell["Mana Spring Totem"] This:CustOutput["Casting Mana Spring Totem"] } if ${Me.PctMana} >= ${This.StandMP} && ${Me.PctHPs} >= ${This.StandHP} && !${Me.Casting} && !${Me.Buff["Resurrection Sickness"](exists)} { Toon:Standup This:CustOutput["Done Resting!"] return } } /**************************************/ /****************Buff******************/ member NeedBuff() { if ${Me.InCombat} || ${Targeting.realAgg} return FALSE if ${Me.Swimming} && !${Object[-dead,-range 0-5](exists)} return TRUE if ${Mount.IsMounted} return FALSE if ${Me.Swimming} && ${Toon.canCast[Water Walking]} && ${Item[-inventory,"Fish Oil"](exists)} && !${Me.Buff[Water Walking](exists)} { This:CustOutput["Swimming, need water walking"] return TRUE } if ${Me.Swimming} && !${Me.Race.Find["Undead"]} && ${Toon.canCast["Water Breathing"]} && ${Item[-inventory,"Shiny Fish Scales"](exists)} && !${Me.Buff["Water Breathing"](exists)} { This:CustOutput["Swimming, need water breathing"] return TRUE } if ${Toon.canUseScroll} { This:CustOutput["Need a scroll buff"] return TRUE } if !${Me.Equip[mainhand].Enchantment[${This.MainHand}](exists)} && ${Toon.canCast["${This.MainHand} Weapon"]} && ${This.buffWaitTimer} < ${LavishScript.RunningTime} && !${This.MainHand.Equal[None]} { This:CustOutput["Need Mainhand Buff - ${This.MainHand}"] return TRUE } if !${Me.Equip[offhand].Enchantment[${This.OffHand}](exists)} && ${Toon.canCast["${This.OffHand} Weapon"]} && ${This.DW} && !${This.OffHand.Equal[None]} { This:CustOutput["Need Offhand Buff - ${This.OffHand}"] return TRUE } if !${Me.Buff[${Shield}](exists)} && ${This.canBuff[${This.Shield}]} return TRUE return FALSE } method BuffPulse() { if ${Me.Swimming} { if ${This.jumpTimer} < ${LavishScript.RunningTime} { wowpress JUMP This.jumpTimer:Set[${This.InSeconds[5]}] } if ${Target(exists)} { Toon:ToMelee } return } if ${Me.InCombat} || ${Targeting.realAgg} return if ${Me.Casting} return if ${Me.Sitting} Toon:Standup if ${Movement.Speed} || ${Movement.Forward} || ${Movement.Backward} { Move -stop return } if ${Me.Swimming} && ${Toon.canCast["Water Walking"]} && ${Item[-inventory,"Fish Oil"](exists)} && !${Me.Buff["Water Walking"](exists)} { Toon:CastSpell[Water Walking] This:CustOutput["Casting Water Walking"] return } if ${Me.Swimming} && !${Me.Race.Find["Undead"]} && ${Toon.canCast["Water Breathing"]} && ${Item[-inventory,"Shiny Fish Scales"](exists)} && !${Me.Buff["Water Breathing"](exists)} { Toon:CastSpell[Water Breathing] This:CustOutput["Casting Water Breathing"] return } if ${Toon.canUseScroll} { Toon:UseScroll This:CustOutput["Using a scroll"] return } if !${Me.Equip[mainhand].Enchantment[${This.MainHand}](exists)} && ${Toon.canCast[${This.MainHand} Weapon]} && ${This.buffWaitTimer} < ${LavishScript.RunningTime} && !${This.MainHand.Equal[None]} { Toon:CastSpell["${This.MainHand} Weapon"] This:CustOutput["Casting ${This.MainHand} Weapon"] This.buffWaitTimer:Set[${This.InSeconds[20]}] return } if !${Me.Equip[offhand].Enchantment[${This.OffHand}](exists)} && ${Toon.canCast[${This.OffHand} Weapon]} && ${This.DW} && !${This.OffHand.Equal[None]} { Toon:CastSpell["${This.OffHand} Weapon"] This:CustOutput["Casting ${This.OffHand} Weapon"] return } if !${Me.Buff["${Shield}"](exists)} && ${This.canBuff["${This.Shield}"]} { Toon:CastSpell["${This.Shield}"] return } } /**************************************/ /**************Pull Buff***************/ member NeedPullBuff() { if !${Me.Buff["${This.Shield}"](exists)} && ${This.canBuff["${This.Shield}"]} && !${This.isImmune["${This.Shield}"]} return TRUE return FALSE } method PullBuffPulse() { if ${Me.Sitting} Toon:Standup if ${Movement.Speed} || ${Movement.Forward} || ${Movement.Backward} { Toon:Stop return } if !${Me.Buff["${This.Shield}"](exists)} && ${This.canBuff["${This.Shield}"]} && !${This.isImmune["${This.Shield}"]} { Toon:CastSpell["${This.Shield}"] This:CustOutput["Casting ${This.Shield}"] return } return } /**************************************/ /*************Combat Buff**************/ member NeedCombatBuff() { if ${Me.Sitting} Toon:Standup if ${Me.PctHPs} < ${This.GOTN} && ${Toon.canCast["Gift of the Naaru"]} return TRUE if ${This.canBuff["${This.Shield}"]} && ${Target.PctHPs} > 30 && !${This.isImmune["${This.Shield}"]} return TRUE if ${Toon.canCast["Shamanistic Rage"]} && ${Me.PctMana} < 30 && ${Target.PctHPs} > 85 return TRUE if ${Toon.canCast["Elemental Mastery"]} && ${Me.PctMana} < 30 return TRUE ;if ${Toon.canCast["Mana Spring Totem"]} && ${Me.PctMana} < 30 && ${This.HasWaterTotem} ; return TRUE if ${Toon.canCast["Heroism"]} && ${Me.PctHPs} < 30 && ${Target.PctHPs} > 70 return TRUE if ${Toon.canCast["Bloodlust"]} && ${Me.PctHPs} < 30 && ${Target.PctHPs} > 70 return TRUE return FALSE } method CombatBuffPulse() { if ${Me.Sitting} Toon:Standup if ${Toon.canCast["Nature's Swiftness"]} { Toon:CastSpell["Nature's Swiftness"] return } if ${Me.PctHPs} < ${This.GOTN} && ${Toon.canCast["Gift of the Naaru"]} && !${Me.Casting} { Toon:CastSpell["Gift of the Naaru"] This:CustOutput["Casting Gift of the Naaru"] return } if ${This.canBuff["${This.Shield}", ${Me.GUID}]} && !${Me.Buff["${This.Shield}"](exists)} && !${Me.Casting} && !${This.isImmune["${This.Shield}"]} { Toon:CastSpell["${Shield}"] This:CustOutput["Casting ${Shield}"] return } if ${Toon.canCast["Elemental Mastery"]} && ${Me.PctMana} < 30 { Toon:CastSpell["Elemental Mastery"] This:CustOutput["Casting Elemental Mastery!!!"] return } ;if ${Toon.canCast["Mana Spring Totem"]} && ${Me.PctMana} < 30 && !${This.OwnedTotemsCheck["Mana Spring Totem"]} && ${This.HasWaterTotem} ;{ ; Toon:CastSpell["Mana Spring Totem"] ; This:CustOutput["Casting Mana Spring Totem!!!"] ; return ;} if ${Toon.canCast["Heroism"]} && ${Me.PctHPs} < 30 && ${Target.PctHPs} > 70 { Toon:CastSpell["Heroism"] This:CustOutput["Casting Heroism!!!"] return } if ${Toon.canCast["Bloodlust"]} && ${Me.PctHPs} < 30 && ${Target.PctHPs} > 70 { Toon:CastSpell["Bloodlust"] This:CustOutput["Casting Bloodlust!!!"] return } } /**************************************/ /****************Pull******************/ method PullPulse() { if ${Me.Sitting} Toon:Standup if !${Toon.ValidTarget[${Target.GUID}]} || ${Target.Dead} || !${Target(exists)} { Toon:NeedTarget[1] return } Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] if ${Me.Casting} || ${Me.GlobalCooldown} return if !${Me.Attacking} && ${Target.Distance} <= ${Toon.MaxMelee} { WoWScript AttackTarget() This:CustOutput["Turning on autoattack"] return } if ${Target.PctHPs} > 95 && ${Target.Target.GUID.NotEqual[${Me.GUID}]} && ${Target.Target.GUID.NotEqual[${Me.Pet.GUID}]}) || ${Toon.TargetIsNew} { ; Creature is 100% life, assuming new target resetting runner logic This.RunnerDealtWith:Set[FALSE] This.BackupAttempts:Set[0] } if ${Me.PctHPs} < ${This.HealWave} && ${Toon.canCast["Healing Wave"]} && !${Me.Casting} && ${This.healWaitTimer} < ${LavishScript.RunningTime} { Toon:CastSpell["Healing Wave"] This:CustOutput["Casting Healing Wave"] This.healWaitTimer:Set[${This.InSeconds[4]}] return } if ${Me.PctHPs} < ${This.LHealWave} && ${Toon.canCast["Lesser Healing Wave"]} && !${Me.Casting} && ${This.healWaitTimer} < ${LavishScript.RunningTime} { Toon:CastSpell["Lesser Healing Wave"] This:CustOutput["Casting Lesser Healing Wave"] This.healWaitTimer:Set[${This.InSeconds[4]}] return } if ${Target.Distance} < ${Toon.MinRanged} || ${This.isImmune["${This.PullSpell}"]} && !${Me.Casting} { WoWScript AttackTarget() This:CustOutput["Turning on autoattack"] Toon:ToMelee return } if !${This.UsePull} { if !${Toon.withinMelee} { Toon:ToMelee This:CustOutput["Melee Pulling ${Target.Name}"] return } } if ${This.UsePull} { if ${Toon.withinRanged} { if ${Movement.Speed} || ${Movement.Forward} || ${Movement.Backward} { Toon:Stop return } if (${Target.Distance} >= ${Toon.MinRanged} && ${Me.PctMana} > ${This.ConserveMana}) && (((${Target.PctHPs} > 95 && ${Target.Target.GUID.NotEqual[${Me.GUID}]} && ${Target.Target.GUID.NotEqual[${Me.Pet.GUID}]}) || ${Toon.TargetIsNew}) || (${This.SpamPull})) { if ${Toon.canCast["${This.PullSpell}"]} { Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] Toon:CastSpell["${This.PullSpell}"] This:CustOutput["Pulling With: ${This.PullSpell}"] return } } } elseif !${Me.Casting} { if ${Target.Distance} > ${Toon.MaxRanged} { This:CustOutput["Target too far away. Moving closer."] Toon:ToRanged } elseif ${Target.Distance} < ${Toon.MinRanged} { WoWScript AttackTarget() This:CustOutput["Turning on autoattack"] This:AttackPulse } } } Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] return } /**************************************/ /***************Attack*****************/ method AttackPulse() { if ${Me.Sitting} Toon:Standup if !${Toon.ValidTarget[${Target.GUID}]} || ${Target.Dead} || !${Target(exists)} { Toon:NeedTarget[1] } if !${Toon.TargetIsBestTarget} || ${Target.IsTotem} Toon:BestTarget Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] if !${Me.Attacking} && ${Target.Distance} <= ${Toon.MaxMelee} { WoWScript AttackTarget() This:CustOutput["Turning on autoattack"] } if ${Target.Distance} >= ${Toon.MinRanged} && ${Me.PctMana} > ${This.ConserveMana} && ${This.SpamPull} { This:PullPulse } This:SetDanger if ${This.HaveAdds} && ${Toon.canCast["War Stomp"]} && !${Me.Casting} { Toon:CastSpell["War Stomp"] } Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] This:debuffAll if ${Target.Distance} < ${Toon.MinMelee} && ${This.BackupAttempts} < 6 && !${Me.Casting} { This:Output["Backing up... wtf"] This.BackupAttempts:Inc Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] Navigator:MoveBackward[200] return } if ${Target.Distance} > ${Toon.MaxMelee} && !${Me.Casting} { This:Output["Chasing down ${Target.Name}"] Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] wowpress -hold moveforward return } else { Toon:Stop } if ${Target.Dead} return if !${This.RunnerDealtWith} && ${Target.PctHPs} < 40 && ${This.isRunner} { Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] if ${Toon.canCast["Frost Shock"]} && !${This.isImmune["Frost Shock"]} { Toon:CastSpell["Frost Shock"] This:CustOutput["Casting Frost Shock on a runner"] This.RunnerDealtWith:Set[TRUE] return } if ${Toon.canCast["Earthbind Totem"]} && !${This.OwnedTotemsCheck["Earthbind Totem"]} && ${This.HasEarthTotem} { Toon:CastSpell["Earthbind Totem"] This:CustOutput["Casting Earthbind Totem to catch a runner"] This.RunnerDealtWith:Set[TRUE] return } } if ${Me.PctHPs} < ${This.HealWave} && ${Toon.canCast["Healing Wave"]} && !${Me.Casting} && ${This.healWaitTimer} < ${LavishScript.RunningTime} { Toon:CastSpell["Healing Wave"] This:CustOutput["Casting Healing Wave"] This.healWaitTimer:Set[${This.InSeconds[4]}] return } if ${Me.PctHPs} < ${This.LHealWave} && ${Toon.canCast["Lesser Healing Wave"]} && !${Me.Casting} && ${This.healWaitTimer} < ${LavishScript.RunningTime} { Toon:CastSpell["Lesser Healing Wave"] This:CustOutput["Casting Lesser Healing Wave"] This.healWaitTimer:Set[${This.InSeconds[4]}] return } if ${Me.PctHPs} < ${This.HPot} && ${This.UseHPot} && ${Consumable.HasHPot} && ${This.PotTimer} < ${LavishScript.RunningTime} { Consumable:useHPot This:CustOutput["Quaffing a health pot"] This.PotTimer:Set[${This.InSeconds[120]}] return } if ${Me.PctMana} < ${This.MPot} && ${This.UseMPot} && ${Consumable.HasMPot} && ${This.PotTimer} < ${LavishScript.RunningTime} { Consumable:useMPot This:CustOutput["Quaffing a mana pot"] This.PotTimer:Set[${This.InSeconds[120]}] return } if ${Target.Dead} return if ${Dangerlvl} >= 1 { if ${Target.PctHPs} > 50 || ${This.HaveAdds} { Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] if ${This.HaveAdds} && ${Toon.canCast["Stoneclaw Totem"]} && !${This.OwnedTotemsCheck["Stoneclaw Totem"]} && ${This.HasEarthTotem} { Toon:CastSpell["Stoneclaw Totem"] This:CustOutput["Casting Stoneclaw Totem because of Add!"] return } if ${This.canCastTotem["Earth"]} && ${This.HasEarthTotem} { Toon:CastSpell["${This.EarthTotem}"] This:CustOutput["Casting ${This.EarthTotem}"] return } if ${This.canCastTotem[Air]} && ${This.HasAirTotem} { Toon:CastSpell["${This.AirTotem}"] This:CustOutput["Casting ${This.AirTotem}"] return } if ${This.canCastTotem["Fire"]} && ${This.HasFireTotem} { Toon:CastSpell["${This.FireTotem}"] This:CustOutput["Casting ${This.FireTotem}"] return } if ${This.canCastTotem["Water"]} && ${This.HasWaterTotem} { Toon:CastSpell["${This.WaterTotem}"] This:CustOutput["Casting ${This.WaterTotem}"] return } if ${This.AirTotem.Equal["Random"]} && ${Me.PctMana} > 10 && ${This.HasAirTotem} { Toon:CastRandom["AirTotems"] This:CustOutput["Casting a random Air Totem"] This.AirTotemTimer:Set[${This.InSeconds[80]}] return } if ${This.EarthTotem.Equal["Random"]} && ${Me.PctMana} > 10 && ${This.HasEarthTotem} { Toon:CastRandom["EarthTotems"] This:CustOutput["Casting a random Earth Totem"] This.EarthTotemTimer:Set[${This.InSeconds[80]}] return } if ${This.WaterTotem.Equal["Random"]} && ${Me.PctMana} > 10 && ${This.HasWaterTotem} { Toon:CastRandom["WaterTotems"] This:CustOutput["Casting a random Water Totem"] This.WaterTotemTimer:Set[${This.InSeconds[80]}] return } if ${This.FireTotem.Equal["Random"]} && ${Me.PctMana} > 10 && ${This.HasFireTotem} { Toon:CastRandom["FireTotems"] This:CustOutput["Casting a random Fire Totem"] This.FireTotemTimer:Set[${This.InSeconds[80]}] return } } } if ${Target.Dead} return if ${This.HaveAdds} && ${Toon.canCast["Shamanistic Rage"]} { Toon:CastSpell["Shamanistic Rage"] This:CustOutput["Casting Shamanistic Rage!!!"] return } Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] if ${This.HaveAdds} && ${Toon.canCast["Chain Lightning"]} && ${Me.PctMana} > ${This.ConserveMana} && !${This.MeleeOnly} && ${This.UseChainLight} { Toon:CastSpell["Chain Lightning"] This:CustOutput["Casting Chain Lightning due to an add!"] return } if ${Toon.canCast["Earth Shock"]} && !${This.isImmune["Earth Shock"]} && ${Target.Casting(exists)} { This:StopCast This:CustOutput["Silencing ${Target} - Attack"] Toon:CastSpell["Earth Shock"] } if ${Toon.canCast["Stormstrike"]} && !${Target.Buff["Stormstrike"](exists)} && ${Target.Distance} < ${This.MaxShockRange} { Toon:CastSpell["Stormstrike"] This:CustOutput["Casting Stormstrike"] return } if ${Target.Dead} { WoWScript ClearTarget() return } Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}] if !${This.SaveShocks} || (${This.SaveShocks} && ${Me.Buff["Focused"](exists)}) { if ${Toon.canCast["Earth Shock"]} && !${This.isImmune["Earth Shock"]} && ${Target.Buff["Stormstrike"](exists)} && ${Target.Distance} < ${This.MaxShockRange} { Toon:CastSpell["Earth Shock"] This:CustOutput["Casting Earth Shock on Stormstruck ${Target}!"] return } if ${This.RandomShock} && !${Target.Buff["Stormstrike"](exists)} && ${Target.Distance} < ${This.MaxShockRange} { if (${Me.PctMana} > ${This.ConserveMana}) || ${This.SaveShocks} { This:CastRandom[Shocks,"Target"] return } } if ${This.canCast["Flame Shock"]} && !${This.isImmune["Flame Shock"]} && ${This.UseFlameShock} && !${This.RandomShock} && !${Target.Buff["Stormstrike"](exists)} && ((${Me.PctMana} > ${This.ConserveMana}) || ${This.SaveShocks}) && ${Target.Distance} < ${This.MaxShockRange} { Toon:CastSpell["Flame Shock"] This:CustOutput["Casting Flame Shock"] return } if ${Toon.canCast["Earth Shock"]} && !${This.isImmune["Earth Shock"]} && ${This.UseEarthShock} && !${This.RandomShock} && ((${Me.PctMana} > ${This.ConserveMana}) || ${This.SaveShocks}) && ${Target.Distance} < ${This.MaxShockRange} { Toon:CastSpell["Earth Shock"] This:CustOutput["Casting Earth Shock"] return } if ${Toon.canCast["Frost Shock"]} && !${This.isImmune["Frost Shock"]} && ${This.UseFrostShock} && !${This.RandomShock} && !${Target.Buff["Stormstrike"](exists)} && ((${Me.PctMana} > ${This.ConserveMana}) || ${This.SaveShocks}) && ${Target.Distance} < ${This.MaxShockRange} { Toon:CastSpell["Frost Shock"] This:CustOutput["Casting Frost Shock"] return } if ${Toon.canCast["Lightning Bolt"]} && !${This.isImmune["Lightning Bolt"]} && ${This.UseLBolt} && ${Me.PctMana} > ${This.ConserveMana} && !${This.MeleeOnly} { Toon:CastSpell["Lightning Bolt"] This:CustOutput["Casting Lightning Bolt"] return } } } /**************************************/ /***************Totems*****************/ method SetTotems() { if ${Item[-items,-inventory,"Earth Totem"](exists)} { This.HasEarthTotem:Set[TRUE] This:CustOutput["We have an Earth Totem in our bags, we can use them now!"] } else { This.HasEarthTotem:Set[FALSE] This:CustOutput["No Earth Totem found! Not using them."] } if ${Item[-items,-inventory,"Fire Totem"](exists)} { This.HasFireTotem:Set[TRUE] This:CustOutput["We have an Fire Totem in our bags, we can use them now!"] } else { This.HasFireTotem:Set[FALSE] This:CustOutput["No Fire Totem found! Not using them."] } if ${Item[-items,-inventory,"Water Totem"](exists)} { This.HasWaterTotem:Set[TRUE] This:CustOutput["We have an Water Totem in our bags, we can use them now!"] } else { This.HasWaterTotem:Set[FALSE] This:CustOutput["No Water Totem found! Not using them."] } if ${Item[-items,-inventory,"Air Totem"](exists)} { This.HasAirTotem:Set[TRUE] This:CustOutput["We have an Air Totem in our bags, we can use them now!"] } else { This.HasAirTotem:Set[FALSE] This:CustOutput["No Air Totem found! Not using them."] } return } member canCastTotem(string totemType) { if ${Toon.canCast[${This.${totemType}Totem}]} && !${This.OwnedTotemsCheck[${This.${totemType}Totem}]} && !${This.${totemType}Totem.Equal["Random"]} && !${This.${totemType}Totem.Equal["None"]} return TRUE return FALSE } member OwnedTotemsCheck(string totem) { if ${Unit[-units, -owner, -range 0-20, "${totem}"](exists)} { return TRUE TotemList:Clear } return FALSE } member ShouldCallTotems() { if ${This.OwnedTotemsCheck["totem"]} && !${This.OwnedTotemsCheck["Mana Spring Totem"]} && !${This.OwnedTotemsCheck["Poison Cleansing Totem"]} && !${Me.Target(exists)} && ${Toon.canCast["Totemic Call"]} return TRUE return FALSE } /**************************************/ /*************Aggro & Adds*************/ method SetDanger() { variable guidlist Aggros Aggros:Search[-units,-nearest,-aggro,-alive,-targetingme,-range 0-40] This.DangerLevel:Set[${DangerLevel} * 0.5] This.DangerLevel:Set[${DangerLevel} + ${Aggros.Count}*6.5] This.DangerLevel:Set[${DangerLevel} + ((100 - ${Me.PctMana})*0.10)] if ${Target.Level} > ${Me.Level} { This.DangerLevel:Set[${DangerLevel} + ((${Target.Level} - ${Me.Level})*2)] } elseif ${Me.Level} > ${Target.Level} { This.DangerLevel:Set[${DangerLevel} + ((${Target.Level} - ${Me.Level})*1)] } if ${Target.Classification.Equal[Elite]} || ${Target.Classification.Equal[RareElite]} This.DangerLevel:Set[${DangerLevel} + 20] if ${Target.PctHPs} < 25 This.DangerLevel:Set[${DangerLevel} - 10] if ${DangerLevel} < 0 This.DangerLevel:Set[0] UIElement[DangerLevel@Titlebar@ClassGUI]:SetValue[${DangerLevel}] if ${DangerLevel} >= ${DangerVeryHigh} { This:CustOutput["Danger - Very High ${DangerLevel}"] This.Dangerlvl:Set[3] return } elseif ${DangerLevel} > ${DangerHigh} { This:CustOutput["Danger - High ${DangerLevel}"] This.Dangerlvl:Set[2] return } elseif ${DangerLevel} > ${DangerMedium} { ;This:CustOutput["Danger - Medium ${DangerLevel}"] This.Dangerlvl:Set[1] return } else { ;This:CustOutput["Danger - Low ${DangerLevel}"] This.Dangerlvl:Set[0] return } } member HaveAdds() { variable guidlist AggroList AggroList:Clear AggroList:Search[-units,-nearest,-nopets,-aggro,-alive,-range 0-30] if ${AggroList.Count} >= 2 { return TRUE } else { return FALSE } } /**************************************/ /***********Spells & Casting***********/ method InitRandoms() { This:SetRandoms["Earth Shock","Shocks"] This:SetRandoms["Flame Shock","Shocks"] This:SetRandoms["Frost Shock","Shocks"] This:SetRandoms["Lightning Bolt","Attacks"] This:SetRandoms["Chain Lightning","Attacks"] This:SetRandoms["Lightning Shield","Shields"] This:SetRandoms["Water Shield","Shields"] This:SetRandoms["Earth Shield","Shields"] This:SetRandoms["Earthbind Totem","EarthTotems"] This:SetRandoms["Stoneskin Totem","EarthTotems"] This:SetRandoms["Stoneclaw Totem","EarthTotems"] This:SetRandoms["Strength of Earth Totem","EarthTotems"] This:SetRandoms["Tremor Totem","EarthTotems"] This:SetRandoms["Searing Totem","FireTotems"] This:SetRandoms["Fire Nova Totem","FireTotems"] This:SetRandoms["Magma Totem","FireTotems"] This:SetRandoms["Totem of Wrath","FireTotems"] This:SetRandoms["Windwall Totem","AirTotems"] This:SetRandoms["Grounding Totem","AirTotems"] This:SetRandoms["Grace of Air Totem","AirTotems"] This:SetRandoms["Wrath of Air Totem","AirTotems"] This:SetRandoms["Healing Stream Totem","WaterTotems"] This:SetRandoms["Mana Spring Totem","WaterTotems"] } method SetRandoms(string SpellName, string RandomSet) { if ${Spell[${SpellName}](exists)} { This:AddRandom[${RandomSet},${SpellName}] } else { This:CustOutput["Couldn't add ${SpellName} into ${RandomSet} because we don't have the spell!"] } } method AddRandom(string spellGroup, string spellName) { if !${This.RandomCast.Element[${spellGroup}](exists)} && ${Bot.Started} { This.RandomCast:Set[${spellGroup}] This.RandomCastCount:Set[${spellGroup},0] } This.RandomCast.Element[${spellGroup}]:Insert[${spellName}] This.RandomCastCount.Element[${spellGroup}]:Inc } member CastRandom(string spellGroup, string checkBuff=NULL) { variable int attempts = 0 variable int spellNum = 1 spellNum:Inc[${Math.Rand[${This.RandomCastCount.Element[${spellGroup}]}]}] do { if ${spellNum} > ${This.RandomCastCount.Element[${spellGroup}]} { spellNum:Inc } if ${Toon.canCast[${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}]} && !${This.isImmune[${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}]} { if ${checkBuff.Equal[Target]} || ${checkBuff.Equal[Me]} { if !${${checkBuff}.Buff[${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}](exists)} { Toon:CastSpell[${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}] This:Output["Casting Random Buff#${spellNum}:${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}"] return TRUE } } else { Toon:CastSpell[${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}] This:Output["Casting Random#${spellNum}:${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}"] return TRUE } } spellNum:Inc } while ${attempts:Inc} <= ${This.RandomCastCount.Element[${spellGroup}]} return FALSE } method CastRandom(string spellGroup, string checkBuff=NULL) { if !${This.CastRandom[${spellGroup},${checkBuff}]} { This:Debug[RandomCast ${spellGroup} failed] } } member canBuff(string buffName, string theGUID=NULL, string spellName=NULL) { if ${spellName.Equal["NULL"]} spellName:Set[${buffName}] if ${theGUID.Equal["NULL"]} theGUID:Set[${Me.GUID}] if !${Object[${theGUID}].Buff["${buffName}"](exists)} && ${Toon.canCast["${spellName}"]} return TRUE return FALSE } member ShouldConserveMana() { if ${Me.PctMana} > ${This.ConserveMana} return TRUE return FALSE } method debuffAll() { if ${Me.PctMana} < 15 || ${Me.Casting} return BuffNum:Set[1] while ${BuffNum} < 16 { BuffNum:Inc if ${Target.Buff.DispelType.Equal["Magic"]} && !${Target.Buff.Harmful} { if ${Toon.canCast["Purge"]} && !${Me.Casting} { This:CustOutput["Purging a buff on ${Target}"] Toon:CastSpell["Purge"] return } } if ${Me.Buff[${BuffNum}].Harmful} { if ${Me.Buff[${BuffNum}].DispelType.Equal["Disease"]} { if ${Toon.canCast["Cure Disease"]} && ${This.cureDiseaseTimer} < ${LavishScript.RunningTime} { This:CustOutput["Curing a disease"] Toon:CastSpell["Cure Disease"] This.cureDiseaseTimer:Set[${This.InSeconds[20]}] return } elseif ${Toon.canCast["Disease Cleansing Totem"]} && !${This.OwnedTotemsCheck["Disease Cleansing Totem"]} && ${This.HasWaterTotem} { Toon:CastSpell["Disease Cleansing Totem"] This:CustOutput["Casting Disease Cleansing Totem"] } } if ${Me.Buff[${BuffNum}].DispelType.Equal["Poison"]} { if ${Toon.canCast["Cure Poison"]} && ${This.curePoisonTimer} < ${LavishScript.RunningTime} { This:CustOutput["Curing a poison"] Toon:CastSpell["Cure Poison"] This.curePoisonTimer:Set[${This.InSeconds[20]}] return } elseif ${Toon.canCast["Poison Cleansing Totem"]} && !${This.OwnedTotemsCheck["Poison Cleansing Totem"]} && ${This.HasWaterTotem} { Toon:CastSpell["Poison Cleansing Totem"] This:CustOutput["Casting Poison Cleansing Totem"] } } } } return } member LootFirst() { if ${Me.Sitting} || ${Me.Casting} return FALSE if ${Unit[-dead,-lootable,-range 0-10](exists)} return TRUE if ${Toon.HasSkill["Skinning"]} { if ${Unit[-dead,-skinnable,-range 0-10](exists)} && ${Item[-inventory,"Skinning Knife"](exists)} return TRUE } if ${LavishScript.RunningTime} <= ${State.LOOTState_Loot_Wait_Until} return TRUE return FALSE } /**************************************/ /*************Other Misc***************/ method CustOutput(string myMessage) { if ${This.Output} UIElement[ClassGUI].FindChild[Console]:Echo["${Time.Time24}: ${myMessage}"] return } /**************************************/ /***********GUI Load & Save************/ method SaveConfig() { Config:SetSetting["${RealmChar}","UsePull",${This.UsePull}] Config:SetSetting["${RealmChar}","SpamPull",${This.SpamPull}] Config:SetSetting["${RealmChar}","PullSpell",${This.PullSpell}] Config:SetSetting["${RealmChar}","RestMP",${This.RestMP}] Config:SetSetting["${RealmChar}","RestHP",${This.RestHP}] Config:SetSetting["${RealmChar}","StandMP",${This.StandMP}] Config:SetSetting["${RealmChar}","StandHP",${This.StandHP}] Config:SetSetting["${RealmChar}","EarthTotem",${This.EarthTotem}] Config:SetSetting["${RealmChar}","AirTotem",${This.AirTotem}] Config:SetSetting["${RealmChar}","FireTotem",${This.FireTotem}] Config:SetSetting["${RealmChar}","WaterTotem",${This.WaterTotem}] Config:SetSetting["${RealmChar}","UseEarthElemental",${This.UseEarthElemental}] Config:SetSetting["${RealmChar}","UseFireElemental",${This.UseFireElemental}] Config:SetSetting["${RealmChar}","UseEarthShock",${This.UseEarthShock}] Config:SetSetting["${RealmChar}","UseFlameShock",${This.UseFlameShock}] Config:SetSetting["${RealmChar}","UseFrostShock",${This.UseFrostShock}] Config:SetSetting["${RealmChar}","RandomShock",${This.RandomShock}] Config:SetSetting["${RealmChar}","SaveShocks",${This.SaveShocks}] Config:SetSetting["${RealmChar}","ConserveMana",${This.ConserveMana}] Config:SetSetting["${RealmChar}","UseLBolt",${This.UseLBolt}] Config:SetSetting["${RealmChar}","UseChainLight",${This.UseChainLight}] Config:SetSetting["${RealmChar}","MainHand",${This.MainHand}] Config:SetSetting["${RealmChar}","OffHand",${This.OffHand}] Config:SetSetting["${RealmChar}","DW",${This.DW}] Config:SetSetting["${RealmChar}","ShieldOnPull",${This.ShieldOnPull}] Config:SetSetting["${RealmChar}","HealWave",${This.HealWave}] Config:SetSetting["${RealmChar}","LHealWave",${This.LHealWave}] Config:SetSetting["${RealmChar}","GOTN",${This.GOTN}] Config:SetSetting["${RealmChar}","Output",${This.Output}] Config:SetSetting["${RealmChar}","UseReincarnation",${This.UseReincarnation}] Config:SetSetting["${RealmChar}","UseMPot",${This.UseMPot}] Config:SetSetting["${RealmChar}","UseHPot",${This.UseHPot}] Config:SetSetting["${RealmChar}","UseBandages",${This.UseBandages}] Config:SetSetting["${RealmChar}","MPot",${This.MPot}] Config:SetSetting["${RealmChar}","HPot",${This.HPot}] Config:SetSetting["${RealmChar}","Bandage",${This.Bandage}] Config:SetSetting["${RealmChar}","Shield",${This.Shield}] Config:SetSetting["${RealmChar}","MeleeOnly",${This.MeleeOnly}] } method LoadConfig() { This.UsePull:Set[${Config.GetSetting["${RealmChar}","UsePull"]}] This.SpamPull:Set[${Config.GetSetting["${RealmChar}","SpamPull"]}] This.PullSpell:Set[${Config.GetSetting["${RealmChar}","PullSpell"]}] This.RestMP:Set[${Config.GetSetting["${RealmChar}","RestMP"]}] This.RestHP:Set[${Config.GetSetting["${RealmChar}","RestHP"]}] This.StandMP:Set[${Config.GetSetting["${RealmChar}","StandMP"]}] This.StandHP:Set[${Config.GetSetting["${RealmChar}","StandHP"]}] This.EarthTotem:Set[${Config.GetSetting["${RealmChar}","EarthTotem"]}] This.AirTotem:Set[${Config.GetSetting["${RealmChar}","AirTotem"]}] This.WaterTotem:Set[${Config.GetSetting["${RealmChar}","WaterTotem"]}] This.FireTotem:Set[${Config.GetSetting["${RealmChar}","FireTotem"]}] This.UseEarthElemental:Set[${Config.GetSetting["${RealmChar}","UseEarthElemental"]}] This.UseFireElemental:Set[${Config.GetSetting["${RealmChar}","UseFireElemental"]}] This.UseEarthShock:Set[${Config.GetSetting["${RealmChar}","UseEarthShock"]}] This.UseFlameShock:Set[${Config.GetSetting["${RealmChar}","UseFlameShock"]}] This.UseFrostShock:Set[${Config.GetSetting["${RealmChar}","UseFrostShock"]}] This.RandomShock:Set[${Config.GetSetting["${RealmChar}","RandomShock"]}] This.SaveShocks:Set[${Config.GetSetting["${RealmChar}","SaveShocks"]}] This.ConserveMana:Set[${Config.GetSetting["${RealmChar}","ConserveMana"]}] This.UseLBolt:Set[${Config.GetSetting["${RealmChar}","UseLBolt"]}] This.UseChainLight:Set[${Config.GetSetting["${RealmChar}","UseChainLight"]}] This.MainHand:Set[${Config.GetSetting["${RealmChar}","MainHand"]}] This.OffHand:Set[${Config.GetSetting["${RealmChar}","OffHand"]}] This.DW:Set[${Config.GetSetting["${RealmChar}","DW"]}] This.ShieldOnPull:Set[${Config.GetSetting["${RealmChar}","ShieldOnPull"]}] This.HealWave:Set[${Config.GetSetting["${RealmChar}","HealWave"]}] This.LHealWave:Set[${Config.GetSetting["${RealmChar}","LHealWave"]}] This.GOTN:Set[${Config.GetSetting["${RealmChar}","GOTN"]}] This.Output:Set[${Config.GetSetting["${RealmChar}","Output"]}] This.UseReincarnation:Set[${Config.GetSetting["${RealmChar}","UseReincarnation"]}] This.UseMPot:Set[${Config.GetSetting["${RealmChar}","UseMPot"]}] This.UseHPot:Set[${Config.GetSetting["${RealmChar}","UseHPot"]}] This.UseBandages:Set[${Config.GetSetting["${RealmChar}","UseBandages"]}] This.MPot:Set[${Config.GetSetting["${RealmChar}","MPot"]}] This.HPot:Set[${Config.GetSetting["${RealmChar}","HPot"]}] This.Bandage:Set[${Config.GetSetting["${RealmChar}","Bandage"]}] This.Shield:Set[${Config.GetSetting["${RealmChar}","Shield"]}] This.MeleeOnly:Set[${Config.GetSetting["${RealmChar}","MeleeOnly"]}] } method InitShamanGUI() { if ${This.UsePull} UIElement[UsePull@Main@Pages@ClassGUI]:SetChecked if ${This.SpamPull} UIElement[SpamPull@Main@Pages@ClassGUI]:SetChecked if ${This.UseReincarnation} UIElement[UseReincarnation@Main@Pages@ClassGUI]:SetChecked if ${This.UseMPot} UIElement[UseMPot@Main@Pages@ClassGUI]:SetChecked if ${This.UseHPot} UIElement[UseHPot@Main@Pages@ClassGUI]:SetChecked if ${This.UseBandages} UIElement[UseBandages@Main@Pages@ClassGUI]:SetChecked if ${This.MeleeOnly} UIElement[MeleeOnly@Main@Pages@ClassGUI]:SetChecked if ${This.UseEarthElemental} UIElement[EarthElemental@Totems@Pages@ClassGUI]:SetChecked if ${This.UseFireElemental} UIElement[FireElemental@Totems@Pages@ClassGUI]:SetChecked if ${This.UseEarthShock} UIElement[EarthShock@Spells@Pages@ClassGUI]:SetChecked if ${This.UseFlameShock} UIElement[FlameShock@Spells@Pages@ClassGUI]:SetChecked if ${This.UseFrostShock} UIElement[FrostShock@Spells@Pages@ClassGUI]:SetChecked if ${This.RandomShock} UIElement[RandomShock@Spells@Pages@ClassGUI]:SetChecked if ${This.SaveShocks} UIElement[SaveShocks@Spells@Pages@ClassGUI]:SetChecked if ${This.UseLBolt} UIElement[LightBolt@Spells@Pages@ClassGUI]:SetChecked if ${This.UseChainLight} UIElement[UseChainLight@Spells@Pages@ClassGUI]:SetChecked if ${This.DW} UIElement[DW@Buffs@Pages@ClassGUI]:SetChecked if ${This.ShieldOnPull} UIElement[ShieldOnPull@Buffs@Pages@ClassGUI]:SetChecked if ${This.Output} UIElement[EnableOutput@Other@Pages@ClassGUI]:SetChecked variable int i = 1 for (i:Set[1] ; ${i} <= ${UIElement[PullSpell@Main@Pages@ClassGUI].Items} ; i:Inc) { if ${This.PullSpell.Equal["${UIElement[PullSpell@Main@Pages@ClassGUI].Item[${i}].Text}"]} UIElement[PullSpell@Main@Pages@ClassGUI]:SelectItem[${i}] } for (i:Set[1] ; ${i} <= ${UIElement[EarthTotem@Totems@Pages@ClassGUI].Items} ; i:Inc) { if ${This.EarthTotem.Equal["${UIElement[EarthTotem@Totems@Pages@ClassGUI].Item[${i}].Text}"]} UIElement[EarthTotem@Totems@Pages@ClassGUI]:SelectItem[${i}] } for (i:Set[1] ; ${i} <= ${UIElement[WaterTotem@Totems@Pages@ClassGUI].Items} ; i:Inc) { if ${This.WaterTotem.Equal["${UIElement[WaterTotem@Totems@Pages@ClassGUI].Item[${i}].Text}"]} UIElement[WaterTotem@Totems@Pages@ClassGUI]:SelectItem[${i}] } for (i:Set[1] ; ${i} <= ${UIElement[FireTotem@Totems@Pages@ClassGUI].Items} ; i:Inc) { if ${This.FireTotem.Equal["${UIElement[FireTotem@Totems@Pages@ClassGUI].Item[${i}].Text}"]} UIElement[FireTotem@Totems@Pages@ClassGUI]:SelectItem[${i}] } for (i:Set[1] ; ${i} <= ${UIElement[AirTotem@Totems@Pages@ClassGUI].Items} ; i:Inc) { if ${This.AirTotem.Equal["${UIElement[AirTotem@Totems@Pages@ClassGUI].Item[${i}].Text}"]} UIElement[AirTotem@Totems@Pages@ClassGUI]:SelectItem[${i}] } for (i:Set[1] ; ${i} <= ${UIElement[MainHand@Buffs@Pages@ClassGUI].Items} ; i:Inc) { if ${This.MainHand.Equal["${UIElement[MainHand@Buffs@Pages@ClassGUI].Item[${i}].Text}"]} UIElement[MainHand@Buffs@Pages@ClassGUI]:SelectItem[${i}] } for (i:Set[1] ; ${i} <= ${UIElement[OffHand@Buffs@Pages@ClassGUI].Items} ; i:Inc) { if ${This.OffHand.Equal["${UIElement[OffHand@Buffs@Pages@ClassGUI].Item[${i}].Text}"]} UIElement[OffHand@Buffs@Pages@ClassGUI]:SelectItem[${i}] } for (i:Set[1] ; ${i} <= ${UIElement[Shield@Buffs@Pages@ClassGUI].Items} ; i:Inc) { if ${This.Shield.Equal["${UIElement[Shield@Buffs@Pages@ClassGUI].Item[${i}].Text}"]} UIElement[Shield@Buffs@Pages@ClassGUI]:SelectItem[${i}] } if ${This.RestMP} != ${UIElement[RestMP@Main@Pages@ClassGUI].Value} UIElement[RestMP@Main@Pages@ClassGUI]:SetValue[${This.RestMP}] if ${This.RestHP} != ${UIElement[RestHP@Main@Pages@ClassGUI].Value} UIElement[RestHP@Main@Pages@ClassGUI]:SetValue[${This.RestHP}] if ${This.StandMP} != ${UIElement[StandMP@Main@Pages@ClassGUI].Value} UIElement[StandMP@Main@Pages@ClassGUI]:SetValue[${This.StandMP}] if ${This.StandHP} != ${UIElement[StandHP@Main@Pages@ClassGUI].Value} UIElement[StandHP@Main@Pages@ClassGUI]:SetValue[${This.StandHP}] if ${This.ConserveMana} != ${UIElement[ConserveMana@Main@Pages@ClassGUI].Value} UIElement[ConserveMana@Main@Pages@ClassGUI]:SetValue[${This.ConserveMana}] if ${This.MPot} != ${UIElement[MPot@Main@Pages@ClassGUI].Value} UIElement[MPot@Main@Pages@ClassGUI]:SetValue[${This.MPot}] if ${This.HPot} != ${UIElement[HPot@Main@Pages@ClassGUI].Value} UIElement[HPot@Main@Pages@ClassGUI]:SetValue[${This.HPot}] if ${This.Bandage} != ${UIElement[Bandage@Main@Pages@ClassGUI].Value} UIElement[Bandage@Main@Pages@ClassGUI]:SetValue[${This.Bandage}] if ${This.HealWave} != ${UIElement[HealWave@Heals@Pages@ClassGUI].Value} UIElement[HealWave@Heals@Pages@ClassGUI]:SetValue[${This.HealWave}] if ${This.LHealWave} != ${UIElement[LHealWave@Heals@Pages@ClassGUI].Value} UIElement[LHealWave@Heals@Pages@ClassGUI]:SetValue[${This.LHealWave}] if ${This.GOTN} != ${UIElement[GOTN@Heals@Pages@ClassGUI].Value} UIElement[GOTN@Heals@Pages@ClassGUI]:SetValue[${This.GOTN}] } method ClassGUIChange(string Action) { switch ${Action} { case PullSpell if ${UIElement[PullSpell@Main@Pages@ClassGUI].SelectedItem.Value(exists)} This.PullSpell:Set[${UIElement[PullSpell@Main@Pages@ClassGUI].SelectedItem}] break case EarthTotem if ${UIElement[EarthTotem@Totems@Pages@ClassGUI].SelectedItem.Value(exists)} This.EarthTotem:Set[${UIElement[EarthTotem@Totems@Pages@ClassGUI].SelectedItem}] break case FireTotem if ${UIElement[FireTotem@Totems@Pages@ClassGUI].SelectedItem.Value(exists)} This.FireTotem:Set[${UIElement[FireTotem@Totems@Pages@ClassGUI].SelectedItem}] break case AirTotem if ${UIElement[AirTotem@Totems@Pages@ClassGUI].SelectedItem.Value(exists)} This.AirTotem:Set[${UIElement[AirTotem@Totems@Pages@ClassGUI].SelectedItem}] break case WaterTotem if ${UIElement[WaterTotem@Totems@Pages@ClassGUI].SelectedItem.Value(exists)} This.WaterTotem:Set[${UIElement[WaterTotem@Totems@Pages@ClassGUI].SelectedItem}] break case MainHand if ${UIElement[MainHand@Buffs@Pages@ClassGUI].SelectedItem.Value(exists)} This.MainHand:Set[${UIElement[MainHand@Buffs@Pages@ClassGUI].SelectedItem}] break case OffHand if ${UIElement[OffHand@Buffs@Pages@ClassGUI].SelectedItem.Value(exists)} This.OffHand:Set[${UIElement[OffHand@Buffs@Pages@ClassGUI].SelectedItem}] break case Shield if ${UIElement[Shield@Buffs@Pages@ClassGUI].SelectedItem.Value(exists)} This.Shield:Set[${UIElement[Shield@Buffs@Pages@ClassGUI].SelectedItem}] break /* checkboxes */ case UsePull if ${UIElement[UsePull@Main@Pages@ClassGUI].Checked} This.UsePull:Set[TRUE] if !${UIElement[UsePull@Main@Pages@ClassGUI].Checked} This.UsePull:Set[FALSE] break case SpamPull if ${UIElement[SpamPull@Main@Pages@ClassGUI].Checked} This.SpamPull:Set[TRUE] if !${UIElement[SpamPull@Main@Pages@ClassGUI].Checked} This.SpamPull:Set[FALSE] break case UseReincarnation if ${UIElement[UseReincarnation@Main@Pages@ClassGUI].Checked} This.UseReincarnation:Set[TRUE] if !${UIElement[UseReincarnation@Main@Pages@ClassGUI].Checked} This.UseReincarnation:Set[FALSE] break case UseHPot if ${UIElement[UseHPot@Main@Pages@ClassGUI].Checked} This.UseHPot:Set[TRUE] if !${UIElement[UseHPot@Main@Pages@ClassGUI].Checked} This.UseHPot:Set[FALSE] break case UseMPot if ${UIElement[UseMPot@Main@Pages@ClassGUI].Checked} This.UseMPot:Set[TRUE] if !${UIElement[UseMPot@Main@Pages@ClassGUI].Checked} This.UseMPot:Set[FALSE] break case UseBandages if ${UIElement[UseBandages@Main@Pages@ClassGUI].Checked} This.UseBandages:Set[TRUE] if !${UIElement[UseBandages@Main@Pages@ClassGUI].Checked} This.UseBandages:Set[FALSE] break case MeleeOnly if ${UIElement[MeleeOnly@Main@Pages@ClassGUI].Checked} This.MeleeOnly:Set[TRUE] if !${UIElement[MeleeOnly@Main@Pages@ClassGUI].Checked} This.MeleeOnly:Set[FALSE] break case EarthElemental if ${UIElement[EarthElemental@Totems@Pages@ClassGUI].Checked} This.UseEarthElemental:Set[TRUE] if !${UIElement[EarthElemental@Totems@Pages@ClassGUI].Checked} This.UseEarthElemental:Set[FALSE] break case FireElemental if ${UIElement[FireElemental@Totems@Pages@ClassGUI].Checked} This.UseFireElemental:Set[TRUE] if !${UIElement[FireElemental@Totems@Pages@ClassGUI].Checked} This.UseFireElemental:Set[FALSE] break case FlameShock if ${UIElement[FlameShock@Spells@Pages@ClassGUI].Checked} This.UseFlameShock:Set[TRUE] if !${UIElement[FlameShock@Spells@Pages@ClassGUI].Checked} This.UseFlameShock:Set[FALSE] break case EarthShock if ${UIElement[EarthShock@Spells@Pages@ClassGUI].Checked} This.UseEarthShock:Set[TRUE] if !${UIElement[EarthShock@Spells@Pages@ClassGUI].Checked} This.UseEarthShock:Set[FALSE] break case FrostShock if ${UIElement[FrostShock@Spells@Pages@ClassGUI].Checked} This.UseFrostShock:Set[TRUE] if !${UIElement[FrostShock@Spells@Pages@ClassGUI].Checked} This.UseFrostShock:Set[FALSE] break case RandomShock if ${UIElement[RandomShock@Spells@Pages@ClassGUI].Checked} This.RandomShock:Set[TRUE] if !${UIElement[RandomShock@Spells@Pages@ClassGUI].Checked} This.RandomShock:Set[FALSE] break case SaveShocks if ${UIElement[SaveShocks@Spells@Pages@ClassGUI].Checked} This.SaveShocks:Set[TRUE] if !${UIElement[SaveShocks@Spells@Pages@ClassGUI].Checked} This.SaveShocks:Set[FALSE] break case UseLBolt if ${UIElement[LightBolt@Spells@Pages@ClassGUI].Checked} This.UseLBolt:Set[TRUE] if !${UIElement[LightBolt@Spells@Pages@ClassGUI].Checked} This.UseLBolt:Set[FALSE] break case UseChainLight if ${UIElement[UseChainLight@Spells@Pages@ClassGUI].Checked} This.UseChainLight:Set[TRUE] if !${UIElement[UseChainLight@Spells@Pages@ClassGUI].Checked} This.UseChainLight:Set[FALSE] break case DW if ${UIElement[DW@Buffs@Pages@ClassGUI].Checked} This.DW:Set[TRUE] if !${UIElement[DW@Buffs@Pages@ClassGUI].Checked} This.DW:Set[FALSE] break case ShieldOnPull if ${UIElement[ShieldOnPull@Buffs@Pages@ClassGUI].Checked} This.ShieldOnPull:Set[TRUE] if !${UIElement[ShieldOnPull@Buffs@Pages@ClassGUI].Checked} This.ShieldOnPull:Set[FALSE] break case EnableOutput if ${UIElement[EnableOutput@Other@Pages@ClassGUI].Checked} This.Output:Set[TRUE] if !${UIElement[EnableOutput@Other@Pages@ClassGUI].Checked} This.Output:Set[FALSE] break /* sliders */ case RestMP if ${UIElement[RestMP@Main@Pages@ClassGUI].Value(exists)} This.RestMP:Set[${UIElement[RestMP@Main@Pages@ClassGUI].Value}] break case RestHP if ${UIElement[RestHP@Main@Pages@ClassGUI].Value(exists)} This.RestHP:Set[${UIElement[RestHP@Main@Pages@ClassGUI].Value}] break case StandHP if ${UIElement[StandHP@Main@Pages@ClassGUI].Value(exists)} This.StandHP:Set[${UIElement[StandHP@Main@Pages@ClassGUI].Value}] break case StandMP if ${UIElement[StandMP@Main@Pages@ClassGUI].Value(exists)} This.StandMP:Set[${UIElement[StandMP@Main@Pages@ClassGUI].Value}] break case ConserveMana if ${UIElement[ConserveMana@Main@Pages@ClassGUI].Value(exists)} This.ConserveMana:Set[${UIElement[ConserveMana@Main@Pages@ClassGUI].Value}] break case MPot if ${UIElement[MPot@Main@Pages@ClassGUI].Value(exists)} This.MPot:Set[${UIElement[MPot@Main@Pages@ClassGUI].Value}] break case HPot if ${UIElement[HPot@Main@Pages@ClassGUI].Value(exists)} This.HPot:Set[${UIElement[HPot@Main@Pages@ClassGUI].Value}] break case Bandage if ${UIElement[Bandage@Main@Pages@ClassGUI].Value(exists)} This.Bandage:Set[${UIElement[Bandage@Main@Pages@ClassGUI].Value}] break case HealWave if ${UIElement[HealWave@Heals@Pages@ClassGUI].Value(exists)} This.HealWave:Set[${UIElement[HealWave@Heals@Pages@ClassGUI].Value}] break case LHealWave if ${UIElement[LHealWave@Heals@Pages@ClassGUI].Value(exists)} This.LHealWave:Set[${UIElement[LHealWave@Heals@Pages@ClassGUI].Value}] break case GOTN if ${UIElement[GOTN@Heals@Pages@ClassGUI].Value(exists)} This.GOTN:Set[${UIElement[GOTN@Heals@Pages@ClassGUI].Value}] break } } }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.29 / 8
143 Votes
http://codebin.yi.org/153
page generated in 0.00 seconds