Thread Tools Display Modes
02-01-06, 05:25 PM   #1
Sabre
A Kobold Labourer
Join Date: Nov 2005
Posts: 1
In need of assistance

I was just wondering if anyone could help me out with this scripting and code. I've been working my way through it slowly but struggling. ATM HasAmmo is working as I want it too but the Range type and shoot macro doesn't seem to be working.

For some reason WoW doesn't seem to recognize a crossbow as a crossbow but just as a bow. So it keeps throwig up and error when I go to shoot but shoots anyways. I'm using this in conjunction with Flexbar. Posted this up there aswell but got no response.

Any help would be appreciated.

Sabre

advanced button=12 state='on'
show button=12 on='GainTarget' target=['neutral' 'hostile'] if='not affectingCombat<"player"> and unitIsAlive<"target"> and inRange<ID(120)>'
hide button=12 on='LostTarget'
show button=12 on='NowInRange' target=ID(120) if='not affectingCombat<"player"> and unitIsAlive<"target">'
hide button=12 on='OutOfRange' target=ID(120)
hide button=12 on='StartCombat'
show button=12 on='EndCombat' if='unitExists<"target"> and (targetIsNeutral<"target"> or targetIsHostile<"target">)'
runmacro on='LeftButtonClick' target=12 macro='Pull'
runscript on='RightButtonClick' target=12 script='Shoot'

"HasAmmo"
FBConditions["hasammo"] =
function(target)
local curAmmo = GetInventoryItemCount("player", CharacterAmmoSlot:GetID());
if curAmmo>1 then return true else return false end
end

"RangedType"
FBConditions["rangedtype"] =
function(target)
if not target then return false end
if type(target) ~= "table" then
target = { target }
end

local index, value
for index, value in pairs(target) do
if type(value) == "string" then
value = string.lower(value)

FlexBarTooltip:SetInventoryItem("player", GetInventorySlotInfo("RangedSlot"));
FlexBarTooltip:Hide();
local text = FlexBarTooltipTextRight3:GetText();
if text and (string.lower(text) == value) then
return true
end
end
end
return false
end

"Pull"
/rs ~-~ || %T IS MY TARGET || ~-~
/s ~-~ || %T IS MY TARGET || ~-~
/ra ~-~ || %T IS MY TARGET || ~-~

"Shoot"
/if rangedtype<"crossbow"> and hasammo<>
/fbcast Shoot Crossbow
/else
/end
/if rangedtype<"bow"> and hasammo<>
/fbcast Shoot Bow
/else
/end
/if rangedtype<"gun"> and hasammo<>
/fbcast Shoot Gun
/else
/end
/if not hasammo<>
/echo #blue You dont have any ammo! Gah!
/else
/end
__________________
Sabre
[Guild Leader of Banimal]

Cocaine is one hell of a drug.
[flash width=400 height=120 loop=true]http://users.hcinternet.com.au/~bweston/files/sabre.swf[/flash]
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » In need of assistance


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