Thread Tools Display Modes
06-07-06, 03:02 PM   #21
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
Originally Posted by gnosis3d
Is there a way to do UnitHealth of the player in a percent? This would make the script viable throughout all levels.
Code:
UnitHealth("player")/UnitHealthMax("player")
and same with UnitMana(...)
  Reply With Quote
06-08-06, 06:44 AM   #22
Astrocanis
A Black Drake
Join Date: Mar 2005
Posts: 84
Storage

Where is the code that I type into CFS stored? I would like to be able to edit the files while offline (at work) and test them in the compiler when I get home at night.
  Reply With Quote
06-08-06, 06:49 AM   #23
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
Originally Posted by Astrocanis
Where is the code that I type into CFS stored?
per-character saved-variables

WTF\Account\[acc]\[realm]\[char]\SavedVariables\ColdFusionShell.lua

Last edited by wereHamster : 06-08-06 at 06:52 AM.
  Reply With Quote
06-08-06, 07:15 AM   #24
Astrocanis
A Black Drake
Join Date: Mar 2005
Posts: 84
Wow! Fast response.

Thanks!
  Reply With Quote
06-18-06, 08:22 PM   #25
Astrocanis
A Black Drake
Join Date: Mar 2005
Posts: 84
I hope this question doesn't seem too stupid. I am trying to capture my current stance (BattleStance, BerserkerStance and DefensiveStance) and, after completing a give action upon a keypress return to my original stance. I added the following:

local myStance
local bStance, zStance = L"BattleStance", L"BerserkerStance"

Later in the program I assign either bStance or zStance to myStance

myStance = bStance (for example)

Then I try to return to my original stance:

CastSpell(myStance)

This does not work, for some reason. What am I doing wrong?

edit: ok - figured that out. Is there anyway to store the state of a variable across macro activations?

Last edited by Astrocanis : 06-18-06 at 08:28 PM.
  Reply With Quote
06-20-06, 04:01 AM   #26
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
Originally Posted by Astrocanis
ok - figured that out. Is there anyway to store the state of a variable across macro activations?
All global variables should be persistent across script executions. But note that the global variables are not visible in the global environment, eg. if you create a global variable 'myStance' in your script, you won't see it when using Iriel's '/dump myStance'.
All scripts run in a special environment and all global variables you make are stored in the table 'ColdFusionShell', so use '/dump ColdFusionShell' or '/dump ColdFusionShell.myStance' to find out if the variable really exists.

If you haven't understood a word.. simply remove the 'local' before 'myStance'
  Reply With Quote
07-07-06, 11:24 AM   #27
Astrocanis
A Black Drake
Join Date: Mar 2005
Posts: 84
Originally Posted by Shag
All global variables should be persistent across script executions. But note that the global variables are not visible in the global environment, eg. if you create a global variable 'myStance' in your script, you won't see it when using Iriel's '/dump myStance'.
All scripts run in a special environment and all global variables you make are stored in the table 'ColdFusionShell', so use '/dump ColdFusionShell' or '/dump ColdFusionShell.myStance' to find out if the variable really exists.

If you haven't understood a word.. simply remove the 'local' before 'myStance'
Thanks Shaq. By the way - this is a truly marvelous piece of coding. I am hoping that you have the energy to continue maintaining it! I have become totally addicted to it and would be saddened / moderately destroyed if it stopped working for me.

I am a professional programmer (Oracle - Java - C# - C - C++) with about 20 years of experience and I do appreciate what you've done for us.

Thank you.
  Reply With Quote
07-11-06, 10:58 AM   #28
gnosis3d
A Deviate Faerie Dragon
 
gnosis3d's Avatar
Join Date: May 2006
Posts: 11
Hunter

I took what you did with the hunter spam, and expanded it slightly. Also, it is 3 seperate peices as to be used in all situations, not just grinding a single mob 1 and another. Mostly, I use this for PvP.

Each one always checks health and will do the appropriate action. I do not include Feign Death here, but I have debated it. With a little tweaking, this can fit any hunter's needs dependent on play-style.

Pet Attack: Checks health... sends pet in, checks for targets etc.
Code:
local itemList = {
    "Greater Healing Potion",
    "Healthstone",
}
if (UnitHealth("player") < 300) then ItemUse(itemList)
if (UnitAffectingCombat("pet")) then TargetUnit("pettarget")
end
if (UnitIsDead("target") or not UnitCanAttack("player", "target")) then
	ClearTarget()
	TargetNearestEnemy()
end
if (UnitExists("target")) then PetAttack()
else Debug("Nothing to attack")
	return
end
Range Attack: Checks health... If target is under 20% health it will slow them... if above 40% it will Hunter's Mark (under that amount, it is probably too close to death and just a waste of mana)... Finally checks for Serpent sting, applies and moves onto AutoShot and Arcane Shot. Due to Aimed Shot being a long cast, I use it seperately.
Code:
local itemList = {
    "Greater Healing Potion",
    "Healthstone",
}
if (UnitHealth("player") < 300) then ItemUse(itemList)
elseif SpellReady("Concussive Shot") and (UnitHealth("target") > 20) and (not BuffActive("target", "Concussive Shot")) then CastSpell("Concussive Shot")
elseif (not DebuffActive("target", "Hunter's Mark")) and (UnitHealth("target") < 40) then CastSpell("Hunter's Mark")
elseif SpellReady("Serpent Sting") and (not BuffActive("target", "Serpent Sting")) then CastSpell("Serpent Sting")
elseif SpellReady("Arcane Shot") then CastSpell("Arcane Shot")
else CastSpell("Auto Shot")
end
Melee Attack: Pretty much a melee version of the above Ranged Attack code. Checks health... slows if under 20%... does Mongoose Bite if available, if not it Attacks and does Raptor Strike when available.
Code:
local itemList = {
    "Greater Healing Potion",
    "Healthstone",
}
if (UnitHealth("player") < 300) then ItemUse(itemList)
elseif SpellReady("Wing Clip") and (UnitHealth("target") > 20) and (not DebuffActive("target", "Wing Clip")) then CastSpell("Wing Clip")
elseif SpellReady("Mongoose Bite") then CastSpell("Mongoose Bite")
elseif SpellReady("Raptor Strike") then CastSpell("Raptor Strike")
else CastSpell("Attack")
end

Mad props to Shag for the examples. Couldn't have continued this without it.

Last edited by gnosis3d : 07-16-06 at 05:54 PM.
  Reply With Quote
07-12-06, 01:00 AM   #29
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
gnosis3d, in the melee script, shouldn't that be 'DebuffActive("target", "Wing Clip")' ? I'm not a hunter but I thought 'Wing Clip' is a debuff.

Anyway, for all warriors out there, and especially tanks, this script will help you tanking mobs that do fear:

It changes to berserker stance IF berserker range is ready, casts berserker rage and then switches back to defensive stance.
Just execute it three times and if berserker rage was ready you're fear-immune and back in the def. stance:

Code:
if (ShapeshiftForm() == "Defensive Stance" and SpellReady("Berserker Rage")) then
    CastShapeshiftForm(3)
elseif (SpellReady("Berserker Rage")) then
    CastSpell("Berserker Rage")
else
    CastShapeshiftForm(2)
end
  Reply With Quote
07-16-06, 05:55 PM   #30
gnosis3d
A Deviate Faerie Dragon
 
gnosis3d's Avatar
Join Date: May 2006
Posts: 11
Originally Posted by Shag
gnosis3d, in the melee script, shouldn't that be 'DebuffActive("target", "Wing Clip")' ? I'm not a hunter but I thought 'Wing Clip' is a debuff.
Fixed it ingame, and forgot about forums. Fixed in forums. Thanks.

One thing... Auto Shot won't fire. Never turns it on. Any ideas?
  Reply With Quote
07-25-06, 01:48 PM   #31
Rollak
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 36
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
Just as an FYI about this Warrior Revenge / Overpower macro. Overpower cannot be cast while in Berserker Stance . It can only be cast while in Battle Stance.
  Reply With Quote
11-18-06, 11:04 AM   #32
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