Thread Tools Display Modes
05-08-06, 08:37 AM   #1
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
Shag's ColdFusionShell

This is the official discussion thread for the ColdFusionShell AddOn.

http://www.wowinterface.com/download...fo.php?id=4946
  Reply With Quote
05-09-06, 09:30 AM   #2
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
Additional functions

This section contains additional functions to what the default LUA-Environment already provides.

Localization
Code:
L(s) -- returns localized string
Spells
Code:
SpellReady(s) -- returns true if the spell is not on cooldown
  -- does not check for mana or reagents.
CastSpell(s, onSelf) -- alias for CastSpellByName()

Inventory/Containers
Code:
local item = ItemCreate(pattern) -- returns a handle to the item
item:Type() -- returns "Container" or "Inventory" or nil if item doesn't exist
item:IsReady() -- item not on cooldown
item:IsLocked() -- item can be moved/equiped
item:Use() -- use the item
item:Equip(slot) -- slot is optional, if not specified then autoequips the item
    -- all possible slot strings can be found here
ItemUse(itemList) -- uses the first item that is not on cooldown
    -- and returns its name
Buffs/Debuffs
Code:
BuffActive(unit, buff) -- checks if the unit has an active buff
DebuffActive(unit, debuff) -- checks if the unit has an active debuff
Misc
Code:
Announce(msg) -- announce msg to SAY, RAID or PARTY chat
Debug(msg) -- prints msg to the default chatframe
ShapeshiftForm() -- returns localized shapeshift form name

Last edited by wereHamster : 05-10-06 at 07:08 AM.
  Reply With Quote
05-10-06, 12:38 AM   #3
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
Sample scripts

This section will contain sample scripts to give you an idea what can and can't be done.

Hunter

one-button grinding
(works for lvl 10-20 hunters, don't know what higer-level hunters do )
Code:
-- when we start attacking, at 90%
-- to give the pet time to build up initial aggro
local attackThreshold = 90
-- when we start zerging, eg. using arcane shot
local zergThreshold = 40

-- if the pet is in combat, target its target
if (UnitAffectingCombat("pet")) then
    TargetUnit("pettarget")
end

-- if our current target is invalid, clear it an look for enemies
if (UnitIsDead("target") or not UnitCanAttack("player", "target")) then
    ClearTarget()
    TargetNearestEnemy()
end

-- if we have a target, send the pet
-- if not print a message that we haven't found anything to attack
if (UnitExists("target")) then
    PetAttack()
else
    Debug("Nothing to attack")
    return
end

-- cast Hunter's Mark
if (not DebuffActive("target", "Hunter's Mark")) then
    CastSpell("Hunter's Mark")
    return
end

-- don't attack as long as the pet hasn't built up initial aggro
if (UnitHealth("target") > attackThreshold) then
    return
end

-- do we have aggro? cast Concussive Shot
-- but only if the target has > 20%
-- don't waste mana if that target is dead soon
if (UnitIsUnit("player", "targettarget") and SpellReady(L"ConcussiveShot")
    and UnitHealth("target") > 20) then
    CastSpell(L"ConcussiveShot")
    return
end

-- zerg the target down if its health is below zergThreshold
-- otherwise renew Serpent Sting or do Auto Shoot
if (UnitHealth("target") < zergThreshold and SpellReady(L"ArcaneShot")) then
    CastSpell(L"ArcaneShot")
elseif (not DebuffActive("target", L"SerpentSting")) then
    CastSpell(L"SerpentSting")
else
    CastSpell("Auto Shot")
end

Priest

DesperatePrayer/PowerWordShield/HealingPotion/Healthstone
aka the I-DON'T-WANT-TO-DIE button

Code:
local dp, pws = L"DesperatePrayer", L"PowerWordShield"

if (SpellReady(dp)) then
    CastSpell(dp)
    return
end

if (SpellReady(pws) and not DebuffActive("player", "Weakened Soul")) then
    CastSpell(pws, true)
    return
end

local itemList = {
    "Major Healing Potion",
    "Healthstone",
}

local usedItem = ItemUse(itemList)
if (usedItem) then
    Announce("Used "..usedItem)
end

Grinding protection
simple macro to protect you when grinding
Code:
if (DebuffActive("player", L"WeakenedSoul")) then
    CastSpell(L"Renew", true)
else
    CastSpell(L"PowerWordShield", true)
end

Warrior

Overpower/Revenge

Code:
if (ShapeshiftForm() == L"BattleStance") then
   CastSpell(L"Overpower")
elseif (ShapeshiftForm() == L"DefensiveStance") then
   CastSpell(L"Revenge")
elseif (ShapeshiftForm() == L"BerserkerStance") then
   CastSpell(L"Overpower")
end
Combat opening

Code:
if (ShapeshiftForm() ~= L"BattleStance") then
    CastSpell(L"BattleStance")
end

if (SpellReady(L"Charge")
    and UnitExists("target")
    and UnitCanAttack("player", "target")) then
    CastSpell(L"Charge")
elseif (SpellReady(L"Bloodrage")) then
    CastSpell(L"Bloodrage")
elseif (not BuffActive("player", L"BattleShout")
         and UnitMana("player") > 10) then
    CastSpell(L"BattleShout")
elseif (UnitMana("player") > 15) then
    CastSpell(L"HeroicStrike")
end

Equip trinkets

Code:
local item = ItemCreate("Onyxia Blood Talisman")
item:Equip("Trinket0Slot")

local item = ItemCreate("Force of Will")
item:Equip("Trinket1Slot")

Last edited by wereHamster : 05-11-06 at 01:58 AM.
  Reply With Quote
05-10-06, 12:42 AM   #4
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
reserved for future additions
  Reply With Quote
05-20-06, 04:11 PM   #5
gnosis3d
A Deviate Faerie Dragon
 
gnosis3d's Avatar
Join Date: May 2006
Posts: 11
I am not seeing any information on the Rank of spells/abilities cast. Is it the best always? Can you extend it out ie. (WingClip,Rank2) for it to work?

Syntax please. ;-)

FYI - Much potential. Very interested as a hunter. Using a modified range version for melee as well. VERY nice.

-Gnosis
  Reply With Quote
05-20-06, 05:59 PM   #6
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
Originally Posted by gnosis3d
I am not seeing any information on the Rank of spells/abilities cast. Is it the best always? Can you extend it out ie. (WingClip,Rank2) for it to work?
CastSpell() has the exact same syntax as CastSpellByName(), so you can use:
Code:
CastSpell("Wing Clip(Rank 2)")
and without rank, it casts the highest rang.

Last edited by wereHamster : 05-20-06 at 06:04 PM.
  Reply With Quote
11-18-06, 11:04 AM   #7
travman67
A Kobold Labourer
 
travman67's Avatar
Join Date: Nov 2006
Posts: 1
Cfs

I am having a lot of fun with this but cannot make any headway...I have really no programming, coding, or scripting experience so I am sure this contributes to my failures, but I can also see a lot of promise.

Thanks for the diversion!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Released AddOns » Shag's ColdFusionShell


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off