Help plz....
first i have no exp with coding
i found a warriorrogue diyce but cant get it to work and i cant find the thread that i got it from
i added it to the diyce file in my addons folder also added file name to the .toc file wher the preade ones are but cant get it to work or even load. below is the code. ty for your time in advance
g_lastaction = ""
function CustomAction(action)
if CD(action) then
if IsShiftKeyDown() then Msg("- "..action) end
g_lastaction = action
CastSpellByName(action)
return true
else
return false
end
end
function WarriorRogue(arg1, potslot, arg3, ragepot, foodslot)
local Skill = {}
local i = 0
local combat = GetPlayerCombatState()
local enemy = UnitCanAttack("player","target")
local rage = UnitMana("player")
local energy = UnitSkill("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local front = UnitIsUnit("player", "targettarget")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(12)
local phealth = PctH("player")
local LockedOn = UnitExists("target")
local ammo = (GetEquipSlotInfo(10) ~= nil)
potslot = potslot or 0
ragepot = ragepot or 0
foodslot = foodslot or 0
--Ammo Check and Equip
if (ammo == false) then
local HaveAmmo = false
local daggers = ""
for i=1,60 do
local x,y,name = GetBagItemInfo(i)
if (string.find(name, " Blade")) then --[[This will equip the daggers bought in Dalanis.
Change this name to whatever current throwing dagger you use.]]
HaveAmmo = true
daggers = name
end
end
if (HaveAmmo == true) then
i=i+1; Skill
= { name = "Item: "..daggers, use = (not ammo) } --Equip daggers if have
elseif ((g_cnt%100) == 0) then
SendChatMessage(DEFAULT_CHAT_FRAME:AddMessage"I need to get throwing daggers!")
end
g_cnt = g_cnt + 1
end
i=i+1; Skill[i] = { name = "Survival Instinct", use = (phealth < .33) }
i=i+1; Skill[i] = { name = "Action: "..potslot, use = (phealth < .70) }
i=i+1; Skill[i] = { name = "Action: "..foodslot, use = (enemy and (not (string.find(pbuffs,"Caviar Sandwich")))) } --[[ This is the food the housemaid gives you.
Change the name here to suit whatever food item you use.]]
if enemy and (not melee) then
i=i+1; Skill[i] = { name = "Surprise Attack", use = true }
i=i+1; Skill[i] = { name = "Shadow Step", use = (energy >= 20) }
i=i+1; Skill[i] = { name = "Throw", use = true }
elseif enemy and melee then
i=i+1; Skill[i] = { name = "Feint", use = ((_target == UnitName("target")) and (_type == "DODGE")) }
i=i+1; Skill[i] = { name = "Blasting Cyclone", use = ((rage >= 35) and (not string.find(tbuffs,"Thunder Stun")) and (not string.find(tbuffs,"Surprise Attack Effect"))) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((energy >= 20) and (not string.find(tbuffs,"Excessive Bleeding"))) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((energy >= 20) and (rage <=9) and (not CD("Probing Attack"))) }
i=i+1; Skill[i] = { name = "Blind Stab", use = (front and (energy >= 20) and (not string.find(tbuffs,"Blind"))) }
i=i+1; Skill[i] = { name = "Enraged", use = (rage < 50) }
i=i+1; Skill[i] = { name = "Slash", use = ((rage >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
if (string.find(tbuffs,"Weakened")) then
i=i+1; Skill[i] = { name = "Custom: Splitting Chop", use = ((rage >= 15) and (g_lastaction ~= "Splitting Chop")) }
i=i+1; Skill[i] = { name = "Custom: Thunder", use = ((rage >= 15) and (g_lastaction ~= "Thunder")) }
end
if (string.find(tbuffs,"Vulnerable")) then
i=i+1; Skill[i] = { name = "Keen Attack", use = ((energy >= 20) and ((rage <= 9) or (not CD("Splitting Chop")) or (not CD("Thunder")))) }
i=i+1; Skill[i] = { name = "Open Flank", use = ((rage >= 10)) }
end
i=i+1; Skill[i] = { name = "Probing Attack", use = (rage >= 20) }
-- i=i+1; Skill[i] = { name = "Blood Dance", use = (enemy and (phealth >= 0.
) }
i=i+1; Skill[i] = { name = "Shadowstab", use = (energy >= 20) }
i=i+1; Skill[i] = { name = "Attack", use = ((PctH("target") == 1)) }
i=i+1; Skill[i] = { name = "Slash", use = (rage >= 40) }
i=i+1; Skill[i] = { name = "Action: "..ragepot, use = ((arg3 == "rage") and combat and (rage <= 30)) }
end
i=i+1; Skill[i] = { name = "Attack", use = (tDead or (not combat and not enemy)) }
MyCombat(Skill,arg1)
if (tDead) or (not LockedOn) or (not enemy) then
TargetNearestEnemy()
end
end