Thread Tools Display Modes
01-12-06, 11:06 AM   #1
Garavix
A Kobold Labourer
Join Date: Jan 2006
Posts: 1
Help with a simple (not to me) ingame /script command

Okie, first off thanks for looking at the thread. Basically i wanna make a button that casts shadowform, and if shadowform is already up i want it to cast Power Word: Fort. SO heres waht i tried
/script if (not string.find(UnitBuff("player", 1), "Shadowform")) then CastSpellByName("Shadowform"); else CastSpellByName("Power Word: Fortitude");end

What is the index in the unitbuff command supposed to be?

thanks in advance

-Cenarus
  Reply With Quote
01-12-06, 04:06 PM   #2
Jacend
An Aku'mai Servant
 
Jacend's Avatar
Join Date: Jan 2006
Posts: 4
First off, I belive you can only cast shadow spells while in Shadoform.. so that might be your problem Second off, about UnitBuff:

http://www.wowwiki.com/API_UnitBuff

Hope that helps!
  Reply With Quote
01-12-06, 04:17 PM   #3
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
/script if (not string.find(UnitBuff("player", 1), "Shadowform")) then CastSpellByName("Shadowform"); else CastSpellByName("Power Word: Fortitude");end
The macro is the right idea but it will only work if Shadowform is in the first buff slot. The index (1 in that macro) is the buff slot.

To check if Shadowform is up you need to check all buff slots.

/script local i,found,buff for i=1,24 do buff=UnitBuff("player",i) if buff and string.find(UnitBuff("player",i),"Shadowform") then found=1 end end; if not found then CastSpellByName("Shadowform") else CastSpellByName("Power Word: Fortitude") end
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Help with a simple (not to me) ingame /script command

Thread Tools
Display Modes

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