You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

1,241

Monday, December 27th 2010, 6:34pm

Thank u six but I still fail :confused: I drop both them in and both of them the buffs go off fine but when i go to fire nothing happens..... what did i do wrong?
Come take a look at ----> http://romtop100.com

List of US ROM Guilds, Vote for your Favorite to help them move up the ranks, Favorite fan sites, Look for a guild or look for members, Guild Forums, Guild Galleries, and much more

[img][/img]

1,242

Monday, December 27th 2010, 8:54pm

Can someone look at this? It worked fine, then I added a few lines of code and it stopped working sort of.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
  i=i+1; Skill[i] = { name = "Silence", 	  use = (silenceThis) }
  i=i+1; Skill[i] = { name = "Fire Rose",     use = ((not friendly) and (not string.find(tbuffs,"Fire Rose III"))) }
  i=i+1; Skill[i] = { name = "Fire Rose Explosion",  use = ((not friendly) and (string.find(tbuffs,"Fire Rose III")) and (BP_BuffTimeLeft("target","Fire Rose III") <= 2)) }
  i=i+1; Skill[i] = { name = "Plasma Arrow",  use = ((not friendly) and (not pcrit) and (useShift)) }
  i=i+1; Skill[i] = { name = "Thunderclap",   use = ((not friendly) and (useShift) and (not string.find(tbuffs,"Thunderclap"))) }
  i=i+1; Skill[i] = { name = "Lightning",     use = ((not friendly) and (GetActionUsable(arg2)) and (not string.find(tbuffs,"Lightning"))) }
  i=i+1; Skill[i] = { name = "Electric Bolt",     use = ((not friendly) and (not string.find(tbuffs,"Electric Flow")) and (string.find(tbuffs,"Lightning"))) }
  i=i+1; Skill[i] = { name = "Fireball",      use = ((not friendly) and (GetActionUsable(arg4)))}
  i=i+1; Skill[i] = { name = "Meteor Shower", use = ((not friendly) and (GetActionUsable(arg3)) and (string.find(tbuffs,"Lightning")) and (not string.find(pbuffs,"Mind Attack"))}
  i=i+1; Skill[i] = { name = "Shot",          use = ((not friendly) and (string.find(pbuffs,"Fire Arrow")) and (GetActionUsable(arg5)))}
  i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (not string.find(tbuffs,"Lightning")))}
  i=i+1; Skill[i] = { name = "Flame",         use = (not friendly) }


It worked fine until I added these lines.

Source code

1
2
3
4
  i=i+1; Skill[i] = { name = "Fire Rose",     use = ((not friendly) and (not string.find(tbuffs,"Fire Rose III"))) }
  i=i+1; Skill[i] = { name = "Fire Rose Explosion",  use = ((not friendly) and (string.find(tbuffs,"Fire Rose III")) and (BP_BuffTimeLeft("target","Fire Rose III") <= 2)) }
  i=i+1; Skill[i] = { name = "Electric Bolt",     use = ((not friendly) and (not string.find(tbuffs,"Electric Flow")) and (string.find(tbuffs,"Lightning"))) }
 i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (not string.find(tbuffs,"Lightning")))}


It still works, but it wasn't casting Fire Rose. I moved it to #2 in the order run it in verbose mode and it just acts like I have no such skill called Fire Rose. Fire Rose Explosion is not working even if I manually add 3 Fire Roses to the target.

There's also some kind of ") expected near } error for line 58 (Meteor Shower) which suddenly showed up, but I don't see any missed ) or } there. Maybe I'm just missing it.

ETA: nvm, found the missing ')'. I added the Mind Attack debuff check last night since that's the first time I ever noticed you getting it when you cast Meteor Shower. That won't even work as scripted since I have to check player debuffs anyway.

ETA2: Fixing the ) error fixed the entire Fire Rose (Explosion) thing. That's even weirder since it had no problem casting other spells on the list above and below it.

1,243

Monday, December 27th 2010, 10:35pm

I was ask to post what i have so maybe I can get help. thanks everyone

-- DIY Combat Engine version 1.4

g_skill = {}

function Msg(outstr,a1,a2,a3)
DEFAULT_CHAT_FRAME:AddMessage(tostring(outstr),a1,a2,a3)
end

function ReadSkills()
g_skill = {}
local skillname,slot

Msg("- Reading Class Skills")
for page = 1,4 do
slot = 1
skillname = GetSkillDetail(page,slot)
repeat
local a1,a2,a3,a4,a5,a6,a7,a8,skillusable = GetSkillDetail(page,slot)
if skillusable then
g_skill[skillname] = { ['page'] = page, ['slot'] = slot }
end
slot = slot + 1
skillname = GetSkillDetail(page,slot)
until skillname == nil
end
end
ReadSkills() -- Read skills into g_skill table at login

function PctH(tgt)
return (UnitHealth(tgt)/UnitMaxHealth(tgt))
end

function PctM(tgt)
return (UnitMana(tgt)/UnitMaxMana(tgt))
end

function PctS(tgt)
return (UnitSkill(tgt)/UnitMaxSkill(tgt))
end

function CancelBuff(buffname)
local i = 1
local buff = UnitBuff("player",i)

while buff ~= nil do
if buff == buffname then
CancelPlayerBuff(i)
return true
end

i = i + 1
buff = UnitBuff("player",i)
end
return false
end

function BuffTimeLeft(tgt, buffname)
local cnt = 1
local buffcmd, bufftimecmd, buff

if UnitCanAttack("player", tgt) then
buffcmd = UnitDebuff
bufftimecmd = UnitDebuffLeftTime
else
buffcmd = UnitBuff
bufftimecmd = UnitBuffLeftTime
end

buff = buffcmd(tgt, cnt)

while buff ~= nil do
if string.find(buff, buffname) then
return bufftimecmd(tgt, cnt)
end
cnt = cnt + 1
buff = buffcmd(tgt, cnt)
end

return 0
end

function ChkBuff(tgt,buffname)
local cnt = 1
local buffcmd = UnitBuff

if UnitCanAttack("player",tgt) then
buffcmd = UnitDebuff
end
local buff = buffcmd(tgt,cnt)

while buff ~= nil do
if string.gsub(buff, "(%()(.)(%))", "%2") == buffname then
return true
end
cnt = cnt + 1
buff = buffcmd(tgt,cnt)
end
return false
end

function BuffList(tgt)
local cnt = 1
local buffcmd = UnitBuff
local buffstr = "/"

if UnitCanAttack("player",tgt) then
buffcmd = UnitDebuff
end
local buff = buffcmd(tgt,cnt)

while buff ~= nil do
buffstr = buffstr..buff.."/"
cnt = cnt + 1
buff = buffcmd(tgt,cnt)
end

return string.gsub(buffstr, "(%()(.)(%))", "%2")
end

function CD(skillname)
local firstskill = GetSkillDetail(2,1)
if (g_skill[firstskill] == nil) or (g_skill[firstskill].page ~= 2) then
ReadSkills()
end

if g_skill[skillname] ~= nil then
local tt,cd = GetSkillCooldown(g_skill[skillname].page,g_skill[skillname].slot)
return cd==0
elseif skillname == nil then
return false
else
Msg("Skill not available: "..skillname)
return false
end
end

function MyCombat(Skill, arg1)
local spell_name = UnitCastingTime("player")
local talktome = ((arg1 == "v1") or (arg1 == "v2"))
local action,actioncd,actiondef,actioncnt

if spell_name ~= nil then
if (arg1 == "v2") then Msg("- ['..spell_name..']", 0, 1, 1) end
return true
end

for x,tbl in ipairs(Skill) do
if Skill[x].use then
if string.find(Skill[x].name, "Action:") then
action = tonumber((string.gsub(Skill[x].name, "(Action:)( *)(%d+)(.*)", "%3")))
_1,actioncd = GetActionCooldown(action)
actiondef,_1,actioncnt = GetActionInfo(action)
if GetActionUsable(action) and (actioncd == 0) and (actiondef ~= nil) and (actioncnt > 0) then
if talktome then Msg("- "..Skill[x].name) end
UseAction(action)
return true
end
elseif string.find(Skill[x].name, "Custom:") then
action = string.gsub(Skill[x].name, "(Custom:)( *)(.*)", "%3")
if CustomAction(action) then
return true
end
elseif string.find(Skill[x].name, "Item:") then
action = string.gsub(Skill[x].name, "(Item:)( *)(.*)", "%3")
if talktome then Msg("- "..Skill[x].name) end
UseItemByName(action)
return true
elseif CD(Skill[x].name) then
if talktome then Msg("- "..Skill[x].name) end
CastSpellByName(Skill[x].name)
return true
end
end
end
if (arg1 == "v2") then Msg("- [IDLE]", 0, 1, 1) end

return false
end

function ScoutKnightRange(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local enemy = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(9) -- Change the 0 to your action bar slot # for Autoshot

i=i+1; Skill = { name = "Enhanced Armor", use = ((not combat) and (not string.find(pbuffs,"Enhanced Armor"))) }
i=i+1; Skill[i] = { name = "Frost Arrow", use = ((not combat) and (not string.find(pbuffs,"Frost Arrow"))) }
i=i+1; Skill[i] = { name = "Combo Shot", use = enemy }
i=i+1; Skill[i] = { name = "Autoshot", use = (enemy and (not ASon)) }
i=i+1; Skill[i] = { name = "Shot", use = enemy }
i=i+1; Skill[i] = { name = "Disarmament", use = (enemy and (not string.find(tbuffs,"Disarmament IV"))) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = (enemy and (focus >= 20)) }
i=i+1; Skill[i] = { name = "Wind Arrows", use = (enemy and (focus >= 15)) }
i=i+1; Skill[i] = { name = "Disarmament", use = enemy }

MyCombat(Skill,arg1)
end

function ScoutKnightMelee(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local enemy = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(9) -- Change the 0 to your action bar slot # for Autoshot

i=i+1; Skill[i] = { name = "Enhanced Armor", use = ((not combat) and (not string.find(pbuffs,"Enhanced Armor"))) }
i=i+1; Skill[i] = { name = "Frost Arrow", use = ((not combat) and (not string.find(pbuffs,"Frost Arrow"))) }
i=i+1; Skill[i] = { name = "Combo Shot", use = enemy }
i=i+1; Skill[i] = { name = "Autoshot", use = (enemy and (not ASon)) }
i=i+1; Skill[i] = { name = "Shot", use = enemy }
i=i+1; Skill[i] = { name = "Punishment", use = (enemy and string.find(tbuffs, "Light Seal III")) }
i=i+1; Skill[i] = { name = "Disarmament", use = (enemy and (not string.find(tbuffs,"/Disarmament I/"))) }
i=i+1; Skill[i] = { name = "Holy Strike", use = (enemy and (not string.find(tbuffs,"/Light Seal I/"))) }
i=i+1; Skill[i] = { name = "Disarmament", use = (enemy and (not string.find(tbuffs,"/Disarmament II/"))) }
i=i+1; Skill[i] = { name = "Holy Strike", use = (enemy and (not string.find(tbuffs,"/Light Seal II/"))) }
i=i+1; Skill[i] = { name = "Disarmament", use = (enemy and (not string.find(tbuffs,"/Disarmament III/"))) }
i=i+1; Skill[i] = { name = "Holy Strike", use = (enemy and (not string.find(tbuffs,"/Light Seal III/"))) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = (enemy and (focus >= 20)) }
i=i+1; Skill[i] = { name = "Wind Arrows", use = (enemy and (focus >= 15)) }
i=i+1; Skill[i] = { name = "Disarmament", use = enemy }

MyCombat(Skill,arg1)
end
Come take a look at ----> http://romtop100.com

List of US ROM Guilds, Vote for your Favorite to help them move up the ranks, Favorite fan sites, Look for a guild or look for members, Guild Forums, Guild Galleries, and much more

[img][/img]

1,244

Tuesday, December 28th 2010, 2:19pm

Hi All,

I created this following script for Rogue/Knight combo :
If there are some improvements to do, le me know where, please.

---------------
function RogueKnight(arg1, arg2)
local Skill = {}
local i = 0
--Player Data
local health = PctH("player")
local energy = UnitMana("player")
local mana = UnitSkill("player")
local pbuffs = BuffList("player")
local dbuffs = DebuffList("player")
local poisoned = string.find(dbuffs,"Poison")
local afraid = string.find(dbuffs,"Fear")
local horrified = string.find(dbuffs,"Horror")
local lion = string.find(pbuffs,"Lion's Protection")
local vanished = string.find(pbuffs,"Vanish")
local poison = string.find(pbuffs,"Poisonous")

--Combat State
local combat = GetPlayerCombatState()

--Target Data
local enemy = UnitCanAttack("player","target")
local tbuffs = BuffList("target")
local tspell,ttime,telapsed = UnitCastingTime("target")
local tDead = UnitIsDeadOrGhost()
local tBleed = string.find(tbuffs,"Bleed")
local tWound = string.find(tbuffs,"Grievous Wound")
local tDisarmed = string.find(tbuffs,"Disarmament IV")


--Check if still vanished then do nothing
if vanished then
return
end



--Cures
i=i+1; Skill = { name = "Poison Protection", use = (poisoned) }
i=i+1; Skill[i] = { name = "Courageous Guard", use = (afraid or horrified) }

--Premed
i=i+1; Skill[i] = { name = "Premeditation", use = ((not combat) and (not string.find(pbuffs,"Premeditation"))) }

--Hide
-- i=i+1; Skill[i] = { name = "Hide", use = ((not combat) and (string.find(pbuffs,"Premeditation")) and (not string.find(pbuffs,"Hide")) and enemy) }
--Healing
i=i+1; Skill[i] = { name = "Power of the Lion", use = (lion and (health < .80)) }
-- i=i+1; Skill[i] = { name = "Action: 21 (HPPot)", use = (health < .3) }
-- i=i+1; Skill[i] = { name = "Action: 22 (HoTPot)", use = (health < .65) }

--Common Buffs
i=i+1; Skill[i] = { name = "Enhanced Armor", use = ((not string.find(pbuffs,"Enhanced Armor")) and (mana > 62)) }
i=i+1; Skill[i] = { name = "Poison", use = ((not combat) and (not poison)) }
i=i+1; Skill[i] = { name = "Lion's Protection", use = ((not lion) and (mana > .05)) }
i=i+1; Skill[i] = { name = "Searing Light", use = ((not string.find(pbuffs,"Searing Light")) and (mana > .1)) }


-- Rare Buffs
-- if ((arg2 == "boss") and combat) then
-- i=i+1; Skill[i] = { name = "Assassins Rage", use = (true) }
-- i=i+1; Skill[i] = { name = "Blind Stab", use = ((energy >= 20) and (not tblind)) }
-- end

--Attacks from behind
if ((arg2 == "behind") and enemy) then
i=i+1; Skill[i] = { name = "Sneak Attack", use = ((not combat) and (energy >= 30)) }
i=i+1; Skill[i] = { name = "Blind Spot", use = ((energy >= 25) and (not string.find(tbuffs,"Blind Spot Bleed"))) }
end

--Main Attacks
if enemy then
i=i+1; Skill[i] = { name = "Shadowstab", use = ((energy >= 20) and (not tBleed)) }
i=i+1; Skill[i] = { name = "Low Blow", use = ((energy >= 30) and tBleed and (not tWound)) }
i=i+1; Skill[i] = { name = "Wound Attack", use = ((energy >= 35) and tBleed and tWound) }
i=i+1; Skill[i] = { name = "Disarmament", use = ((energy <= 20) and (mana > 62) and ((not tDisarmed) or (BuffTimeLeft("target","Disarmament") <= 2))) }
end

-- Normal Attack or Loot
-- i=i+1; Skill[i] = { name = "Attack", use = (enemy or tDead) }
MyCombat(Skill,arg1)
end

function DebuffList(tgt)
local cnt = 1
local buffcmd = UnitDebuff
local buffstr = "/"

if UnitCanAttack("player",tgt) then
buffcmd = UnitBuff
end
local buff = buffcmd(tgt,cnt)

while buff ~= nil do
buffstr = buffstr..buff.."/"
cnt = cnt + 1
buff = buffcmd(tgt,cnt)
end

return string.gsub(buffstr, "(%()(.*)(%))", "%2")
end
----------

1,245

Wednesday, December 29th 2010, 3:01pm

Hello,

So I have been working on a WardenScout diyce and I am trying to define which skills to use in and out of melee range. What I have created is below. My problem is that it will not recognize, nor execute the shot and vamp arrows. It always goes straight to thorny vine and as you can guess, if I am out of melee range, nothing happens. I have tried multiple ways of defining melee and non-melee range and I looked at the "DIYCE - how it works" post on this forum and decided to try that method. It still will not work.

I should also note that my melee range definition is using Power of the Wood Spirit skill, which is slot #8 on my action bar.

Any suggestions??? :( By all the research I have done, it should work.


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function WardenScout(arg1,arg2)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local mana = UnitSkill("player")/UnitMaxSkill("player")
local enemy = UnitCanAttack("player","target")
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local pet = UnitExists("playerpet")
local tspell,ttime,telapsed = UnitCastingTime("target")
local melee = GetActionUsable(8)
 
if (not UnitExists("target")) or UnitIsDeadOrGhost("target") or (PctH("player") <= .40) and (string.find(pbuffs,"Blood Arrow")) then CancelBuff("Blood Arrow")
end
i=i+1; Skill[i] = { ['name'] = "Elven Amulet", ['use'] = (combat and (PctH("player") <= .30) and (not string.find(pbuffs,"Elven Amulet"))) }
i=i+1; Skill[i] = { ['name'] = "Briar Shield", ['use'] = ((not combat) and (not string.find(pbuffs,"Briar Shield"))) }
--i=i+1; Skill[i] = { ['name'] = "Summon Chiron the Centaur", ['use'] = ((not combat) and (not pet)) }
i=i+1; Skill[i] = { ['name'] = "Item: Doom's Banquet", ['use'] = ((not combat) and (not string.find(pbuffs,"Doom's Banquet")) and (arg2 == "dps")) }
i=i+1; Skill[i] = { ['name'] = "Item: Hero Potion", ['use'] = ((not combat) and (not string.find(pbuffs,"Hero Potion")) and (arg2 == "dps")) } 
i=i+1; Skill[i] = { ['name'] = "Blood Arrow", ['use'] = (PctH("player") >= .80) and (not string.find(pbuffs,"Blood Arrow")) and (arg2 == "dps") }
i=i+1; Skill[i] = { ['name'] = "Savage Power", ['use'] = (not combat) and (not string.find(pbuffs,"Savage Power")) and (arg2 == "dps")}
i=i+1; Skill[i] = { ['name'] = "Throat Attack", ['use'] = enemy and (tspell ~= nil) and (ttime >= 0.8) and ((ttime - telapsed) >= 0.4) and (focus >= 15) }
 
if enemy and (not melee) then
i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = true } 
i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = (focus >= 20) } 
i=i+1; Skill[i] = { ['name'] = "Anti-Magic Arrow", ['use'] = (mana <= .70) }
 
elseif enemy and melee then
i=i+1; Skill[i] = { ['name'] = "Thorny Vine", ['use'] = true } 
i=i+1; Skill[i] = { ['name'] = "Charged Chop", ['use'] = true } 
i=i+1; Skill[i] = { ['name'] = "Power of the Wood Spirit", ['use'] = true } 
--i=i+1; Skill[i] = { ['name'] = "Wrist Attack", ['use'] = ((not string.find(tbuffs,"Wrist Attack")) and (focus >= 50)) }
--i=i+1; Skill[i] = { ['name'] = "Joint Blow", ['use'] = ((not string.find(tbuffs,"Joint Blow")) and(focus >= 50)) }
 
end 
 
MyCombat(Skill,arg1) 
end
Jacobmo 97Scout/97Warden/95Warrior/97Rogue/88D/85M
Allenmo 78S/77R/56P/1W/1K/1M - retired
Bteam all the way

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,246

Wednesday, December 29th 2010, 7:30pm

Just wanted to put this in real fast, and then I'll look into some of the code here:

PLEASE WRAP YOUR CODE IN [ CODE ] TAGS!!!

Edit:
Akala, give this a try for your code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function ScoutKnightRange(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local enemy = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(9) -- Change the # to your action bar slot for Autoshot

    if (not combat) then
        i=i+1; Skill[i] = { name = "Enhanced Armor", use = (not string.find(pbuffs,"Significantly Enhanced Armor")) } -- The buff name for a S/K is ot the same as other knights
        i=i+1; Skill[i] = { name = "Frost Arrow", use = (not string.find(pbuffs,"Frost Arrow")) }
    end
    
    if enemy then
        i=i+1; Skill[i] = { name = "Combo Shot", use = true }
        i=i+1; Skill[i] = { name = "Autoshot", use = (not ASon) }
        i=i+1; Skill[i] = { name = "Shot", use = true }
        i=i+1; Skill[i] = { name = "Disarmament", use = (not string.find(tbuffs,"Disarmament IV")) }
        i=i+1; Skill[i] = { name = "Vampire Arrows", use = (focus >= 20) }
        i=i+1; Skill[i] = { name = "Wind Arrows", use = (focus >= 15) }
        i=i+1; Skill[i] = { name = "Disarmament", use = true }
    end
    
MyCombat(Skill,arg1)
end

function ScoutKnightMelee(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local enemy = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(9) -- Change the # to your action bar slot for Autoshot

    if (not combat) then
        i=i+1; Skill[i] = { name = "Enhanced Armor", use = (not string.find(pbuffs,"Significantly Enhanced Armor")) } -- The buff name for a S/K is ot the same as other knights
        i=i+1; Skill[i] = { name = "Frost Arrow", use = (not string.find(pbuffs,"Frost Arrow")) }
    end
    
    if enemy then
        i=i+1; Skill[i] = { name = "Combo Shot", use = true }
        i=i+1; Skill[i] = { name = "Autoshot", use = (not ASon) }
        i=i+1; Skill[i] = { name = "Shot", use = true }
        i=i+1; Skill[i] = { name = "Punishment", use = (string.find(tbuffs, "Light Seal III")) }
        i=i+1; Skill[i] = { name = "Disarmament", use = (not string.find(tbuffs,"Disarmament I")) }
        i=i+1; Skill[i] = { name = "Holy Strike", use = (not string.find(tbuffs,"Light Seal I")) }
        i=i+1; Skill[i] = { name = "Disarmament", use = (not string.find(tbuffs,"Disarmament II")) }
        i=i+1; Skill[i] = { name = "Holy Strike", use = (not string.find(tbuffs,"Light Seal II")) }
        i=i+1; Skill[i] = { name = "Disarmament", use = (not string.find(tbuffs,"Disarmament III")) }
        i=i+1; Skill[i] = { name = "Holy Strike", use = (not string.find(tbuffs,"Light Seal III")) }
        i=i+1; Skill[i] = { name = "Vampire Arrows", use = (focus >= 20) }
        i=i+1; Skill[i] = { name = "Wind Arrows", use = (focus >= 15) }
        i=i+1; Skill[i] = { name = "Disarmament", use = true }
    end
MyCombat(Skill,arg1)
end

1,247

Wednesday, December 29th 2010, 7:33pm

I'm sorry. I don't quite understand what you mean? I notice that a lot of the codes posted are in a darker background area. Please tell me how to do that and I gladly will.

Thanks

EDIT: I figured out the [code] thing. Did a little search after Ghostwolf's recommendation. Thanks and sorry about that
Jacobmo 97Scout/97Warden/95Warrior/97Rogue/88D/85M
Allenmo 78S/77R/56P/1W/1K/1M - retired
Bteam all the way

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,248

Wednesday, December 29th 2010, 9:25pm

No problem. Thanks for doing that, helps in reading, and editing the code.

Give this a try samohn:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function WardenScout(arg1,arg2)
local Skill = {}
local i = 0
local mana = UnitMana("player")
local focus = UnitSkill("player")
local pfocus = PctS("player")
local enemy = UnitCanAttack("player","target")
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local pet = UnitExists("playerpet")
local tspell,ttime,telapsed = UnitCastingTime("target")
local melee = GetActionUsable(8)
local tDead = UnitIsDeadOrGhost("target")
local LockedOn = UnitExists("target")
local phealth = PctH("player")
local thealth = PctH("target")
 
if ((not LockedOn) or tDead or (phealth <= .40)) and (string.find(pbuffs,"Blood Arrow")) then 
    CancelBuff("Blood Arrow")
    --       i=i+1; Skill[i] = { name = "Blood Arrow",        use = ((not combat or (phealth <= .45)) and (string.find(pbuffs,"Blood Arrow"))) }
        --if CancelBuff does not work then try activating the second line here and remove CancelBuff. Both should work though, just two different options.
end

    i=i+1; Skill[i] = { name = "Elven Amulet",                         use = (combat and (phealth <= .30) and (not string.find(pbuffs,"Elven Amulet"))) }
    
    if (not combat) then
        i=i+1; Skill[i] = { name = "Briar Shield",                     use = (not string.find(pbuffs,"Briar Shield")) }
        --i=i+1; Skill[i] = { name = "Summon Chiron the Centaur",     use = (not pet) } --[[you need to define nopet as a variable]]
        i=i+1; Skill[i] = { name = "Item: Doom's Banquet",             use = ((not string.find(pbuffs,"Doom's Banquet")) and (arg2 == "dps")) }
        i=i+1; Skill[i] = { name = "Item: Hero Potion",             use = ((not string.find(pbuffs,"Hero Potion")) and (arg2 == "dps")) }
        i=i+1; Skill[i] = { name = "Blood Arrow",                     use = (phealth >= .80) and (not string.find(pbuffs,"Blood Arrow")) and (arg2 == "dps") }
        i=i+1; Skill[i] = { name = "Savage Power",                     use = (not string.find(pbuffs,"Savage Power")) and (arg2 == "dps")}
    end
    
    if enemy and (not melee) then
        i=i+1; Skill[i] = { name = "Shot", use = true } 
        i=i+1; Skill[i] = { name = "Vampire Arrows",                 use = (focus >= 20) } 
        i=i+1; Skill[i] = { name = "Anti-Magic Arrow",                 use = (pfocus <= .70) } --[[did you mean to only use this when below 70% focus?]]
 
    elseif enemy and melee then
        i=i+1; Skill[i] = { name = "Throat Attack",                 use = (tspell ~= nil) and (ttime >= 0.8) and ((ttime - telapsed) >= 0.4) and (focus >= 15) }
                --[[moved TA down here, because otherwise you will never use the range skills.]] 
        i=i+1; Skill[i] = { name = "Thorny Vine",                     use = (mana >= 30) } 
        i=i+1; Skill[i] = { name = "Charged Chop",                     use = (mana >= 20 } 
        i=i+1; Skill[i] = { name = "Power of the Wood Spirit",         use = (mana >= 15) } 

    end 
 
MyCombat(Skill,arg1) 
end

I have my comments in the code itself, please read them.

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,249

Wednesday, December 29th 2010, 9:28pm

Quoted from "Melehan;369175"

It still works, but it wasn't casting Fire Rose. I moved it to #2 in the order run it in verbose mode and it just acts like I have no such skill called Fire Rose. Fire Rose Explosion is not working even if I manually add 3 Fire Roses to the target.

There's also some kind of ") expected near } error for line 58 (Meteor Shower) which suddenly showed up, but I don't see any missed ) or } there. Maybe I'm just missing it.

ETA: nvm, found the missing ')'. I added the Mind Attack debuff check last night since that's the first time I ever noticed you getting it when you cast Meteor Shower. That won't even work as scripted since I have to check player debuffs anyway.

ETA2: Fixing the ) error fixed the entire Fire Rose (Explosion) thing. That's even weirder since it had no problem casting other spells on the list above and below it.


So, are there anymore errors? Just a little confused, since your edits seem to suggest everything is working fine now.

1,250

Wednesday, December 29th 2010, 10:00pm

Hey Ghostwolf,

I tried the revised macro and it still did not work. It would skip straight to thorny vine and bypass all (not melee) attacks. So I tried removing that statement from the code and then it would cast shot and vamp arrows, but nothing else, even if it was in melee range. I would have assumed that it would cast shot, then VA, then go straight to Thorny vines once those two were on CD but it didnt. It would just say IDLE in my log until shot was past CD.

Honestly, I'm stumped. I have been working on this code and this specific issue for days. I see alot of codes that use the melee definition and on other Wd/S macros in this thread, they use power of the wood spirit for the melee range definition.

It seems to be hung up on defining the melee range. When I remove that part of the code from the macro, it will roll down through the skills but as expected, when shot is off of cooldown, it will fire again. Shot is not my highest dps skill with a Wd/S so I only want to use it when the mob is out of melee range.

I'm not sure what to do now. :(:(:(

EDIT: I also see you added a pfocus variable at the top. Can you please advise what that is? Thanks
Jacobmo 97Scout/97Warden/95Warrior/97Rogue/88D/85M
Allenmo 78S/77R/56P/1W/1K/1M - retired
Bteam all the way

1,251

Wednesday, December 29th 2010, 10:27pm

Quoted from "AKALASZLO;369127"

Thank u six but I still fail :confused: I drop both them in and both of them the buffs go off fine but when i go to fire nothing happens..... what did i do wrong?


Do you get a red flashing icon around your minimap when you run them? If so, click on it and let me know what the message is.

1,252

Wednesday, December 29th 2010, 10:33pm

Quoted from "samohn;369731"

Hello,

So I have been working on a WardenScout diyce and I am trying to define which skills to use in and out of melee range. What I have created is below. My problem is that it will not recognize, nor execute the shot and vamp arrows. It always goes straight to thorny vine and as you can guess, if I am out of melee range, nothing happens. I have tried multiple ways of defining melee and non-melee range and I looked at the "DIYCE - how it works" post on this forum and decided to try that method. It still will not work.

I should also note that my melee range definition is using Power of the Wood Spirit skill, which is slot #8 on my action bar.

Any suggestions??? :( By all the research I have done, it should work.


One glaring problem is your focus and mana definitions are backwards.

It should be:

Source code

1
2
local focus = UnitSkill("player")
local mana = UnitMana("player")/UnitMaxMana("player")

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,253

Wednesday, December 29th 2010, 10:48pm

Try it with this block of code:

Source code

1
2
3
4
5
6
7
8
9
10
11
    if enemy then
        i=i+1; Skill[i] = { name = "Shot",                                 use = (not melee) } 
        i=i+1; Skill[i] = { name = "Vampire Arrows",                     use = (not melee) and (focus >= 20) } 
        i=i+1; Skill[i] = { name = "Anti-Magic Arrow",                     use = (not melee) and (pfocus <= .70) } --[[did you mean to only use this when below 70% focus?]]
        i=i+1; Skill[i] = { name = "Throat Attack",                     use = (tspell ~= nil) and (ttime >= 0.8) and ((ttime - telapsed) >= 0.4) and (focus >= 15) }
                --[[moved TA down here, because otherwise you will never use the range skills.]] 
        i=i+1; Skill[i] = { name = "Thorny Vine",                         use = (mana >= 30) } 
        i=i+1; Skill[i] = { name = "Charged Chop",                         use = (mana >= 20 } 
        i=i+1; Skill[i] = { name = "Power of the Wood Spirit",             use = (mana >= 15) } 

    end
As for "local pfocus = PctS("player")", look near the top of the DIYCE main code to find this:

Source code

1
2
3
function PctS(tgt)
    return (UnitSkill(tgt)/UnitMaxSkill(tgt))
end
Did this because AMA uses 30 focus, and you seem to want to only trigger it if you are below 70% focus based on your previous code. That is why the code doesn't cast AMA. As I said, read my comments in the code itself.

1,254

Wednesday, December 29th 2010, 10:59pm

Ghost,

I pasted it in just as you had indicated and it does the buffs but now will do no attacks at all. I just dont get it. It should work fine.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function WardenScout(arg1,arg2)
local Skill = {}
local i = 0
local mana = UnitMana("player")/UnitMaxMana("player")
local focus = UnitSkill("player")
local pfocus = PctS("player")
local enemy = UnitCanAttack("player","target")
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local pet = UnitExists("playerpet")
local tspell,ttime,telapsed = UnitCastingTime("target")
local melee = GetActionUsable(8)
local tDead = UnitIsDeadOrGhost("target")
local LockedOn = UnitExists("target")
local phealth = PctH("player")
local thealth = PctH("target")
 
if ((not LockedOn) or tDead or (phealth <= .40)) and (string.find(pbuffs,"Blood Arrow")) then CancelBuff("Blood Arrow")
    --i=i+1; Skill[i] = { name = "Blood Arrow",        use = ((not combat or (phealth <= .45)) and (string.find(pbuffs,"Blood Arrow"))) }
    --if CancelBuff does not work then try activating the second line here and remove CancelBuff. Both should work though, just two different options.
end
        i=i+1; Skill[i] = { name = "Elven Amulet",                  use = (combat and (phealth <= .30) and (not string.find(pbuffs,"Elven Amulet"))) }
 
    if (not combat) then
        i=i+1; Skill[i] = { name = "Briar Shield",                  use = (not string.find(pbuffs,"Briar Shield")) }
        i=i+1; Skill[i] = { name = "Item: Doom's Banquet",          use = ((not string.find(pbuffs,"Doom's Banquet")) and (arg2 == "dps")) }
        i=i+1; Skill[i] = { name = "Item: Hero Potion",             use = ((not string.find(pbuffs,"Hero Potion")) and (arg2 == "dps")) }
        i=i+1; Skill[i] = { name = "Blood Arrow",                   use = (phealth >= .80) and (not string.find(pbuffs,"Blood Arrow")) and (arg2 == "dps") }
        i=i+1; Skill[i] = { name = "Savage Power",                  use = (not string.find(pbuffs,"Savage Power")) and (arg2 == "dps")}
    end
 
    if enemy then
        i=i+1; Skill[i] = { name = "Shot",                          use = (not melee) } 
        i=i+1; Skill[i] = { name = "Vampire Arrows",                use = (not melee) and (focus >= 20) } 
        i=i+1; Skill[i] = { name = "Anti-Magic Arrow",              use = (not melee) and (pfocus <= .70) }
        i=i+1; Skill[i] = { name = "Throat Attack",                 use = (tspell ~= nil) and (ttime >= 0.8) and ((ttime - telapsed) >= 0.4) and (focus >= 15) }
        i=i+1; Skill[i] = { name = "Thorny Vine",                   use = (mana >= 30) } 
        i=i+1; Skill[i] = { name = "Charged Chop",                  use = (mana >= 20) } 
        i=i+1; Skill[i] = { name = "Power of the Wood Spirit",      use = (mana >= 15) } 
    end
 
MyCombat(Skill,arg1) 
end
Jacobmo 97Scout/97Warden/95Warrior/97Rogue/88D/85M
Allenmo 78S/77R/56P/1W/1K/1M - retired
Bteam all the way

1,255

Thursday, December 30th 2010, 3:49am

This is a work in progress and ghost suggested I post it here for the benefit of the community. If anyone knows of any other debuff names that result in a Silence besides the two I have listed, let me know.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
function MageScoutCombat(arg1,arg2,arg3,arg4,arg5)
-- arg2 = Quickbar slot# for Lightning.
-- arg3 = Quickbar slot# for Meteor Shower.
-- arg4 = Quickbar slot# for Silence (range check for Fireball).
-- arg5 = Quickbar slot# for Shot.

  local Skill = {}
  local i = 0
  local useShift = IsShiftKeyDown()
  local useCtrl = IsCtrlKeyDown()
  
  -- Player and target status.
  local friendly = (not UnitCanAttack("player","target"))
  local plife = PctH("player")
  local pMana = PctM("player")
  local pbuffs = BuffList("player")
  local dbuffs = DebuffList("player")
  local pcrit = string.find(pbuffs,"Charged")
  local tbuffs = BuffList("target")
  local tDead = UnitIsDeadOrGhost("target")
  
  -- Health monitor.  Change Action: n statements to match action bar numbers for your mana pot slots.
  if (plife <= .55) then
  i=i+1; Skill[i] = { name = "Action: 61 ", use = (plife <= .45) }
  i=i+1; Skill[i] = { name = "Action: 62 ", use = (plife <= .55) }
  i=i+1; Skill[i] = { name = "Electrostatic Charge", use = ((not string.find(pbuffs,"Electrostatic Charge"))) }
  end

  --Mana monitor.  Change Action: n statements to match action bar numbers for your mana pot slots.
  if (pMana <= .60) then
  i=i+1; Skill[i] = { name = "Action: 63", use = (pMana <= .40) }
  i=i+1; Skill[i] = { name = "Action: 64", use = (pMana <= .60) }
  end
  
  --Silence spell list logic.
  local tSpell,tTime,tElapsed = UnitCastingTime("target")
  local silenceList = "/Annihilation/King Bug Shock/Mana Rift/Dream of Gold/Flame/Flame Spell/Wave Bomb/Silence/Recover/Restore Life/Heal/Curing Shot/Leaves of Fire/"
  local silenceThis = ((tSpell ~= nil) and (string.find(silenceList, tSpell)) and ((tTime - tElapsed) > 0.1))
  
  -- Fallback to scout skills if silenced or low on mana.
  if ((pMana <= .10) or string.find(dbuffs,"Silenced") or string.find(dbuffs,"Throat Seal") ) then
    i=i+1; Skill[i] = { name = "Shot", use = ((not friendly) and (string.find(pbuffs,"Fire Arrow")))}
    i=i+1; Skill[i] = { name = "Vampire Arrows", use = (not friendly)}
  end
  
  -- Loot corpse, do normal attack, or interact with NPC
  i=i+1; Skill[i] = { name = "Attack", use = ((not combat) and (tDead)) }
  
  -- Combat.
  i=i+1; Skill[i] = { name = "Silence", 	  use = (silenceThis) }
  i=i+1; Skill[i] = { name = "Fire Rose Explosion",  use = ((not friendly) and ((string.find(tbuffs,"Fire Rose III")) and (BuffTimeLeft("target","Fire Rose III") <= 2))) }
  i=i+1; Skill[i] = { name = "Plasma Arrow",  use = ((not friendly) and (not pcrit) and (useShift)) }
  i=i+1; Skill[i] = { name = "Thunderclap",   use = ((not friendly) and (useShift) and (not string.find(tbuffs,"Thunderclap"))) }
  i=i+1; Skill[i] = { name = "Lightning",     use = ((not friendly) and (GetActionUsable(arg2)) and (not string.find(tbuffs,"Lightning"))) }
  i=i+1; Skill[i] = { name = "Electric Bolt",     use = ((not friendly) and (not string.find(tbuffs,"Electric Flow")) and (string.find(tbuffs,"Lightning"))) }
  i=i+1; Skill[i] = { name = "Fireball",      use = ((not friendly) and (GetActionUsable(arg4)))}
  i=i+1; Skill[i] = { name = "Fire Rose",     use = ((not friendly) and (not string.find(tbuffs,"Fire Rose III"))) }
  i=i+1; Skill[i] = { name = "Meteor Shower", use = ((not friendly) and (GetActionUsable(arg3)) and (string.find(tbuffs,"Lightning")) and (not string.find(dbuffs,"Mind Attack")))}
  i=i+1; Skill[i] = { name = "Shot",          use = ((not friendly) and (string.find(pbuffs,"Fire Arrow")) and (GetActionUsable(arg5)))}
  i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (not string.find(tbuffs,"Lightning")))}
  i=i+1; Skill[i] = { name = "Flame",         use = (not friendly) }
  
  MyCombat(Skill,arg1)
end

function MageScoutBuffs(arg1)

  local Skill = {}
  local i = 0
  local useShift = IsShiftKeyDown()
  
  -- Player and target status.
  local friendly = (not UnitCanAttack("player","target"))
  local plife = PctH("player")
  local pMana = PctM("player")
  local pbuffs = BuffList("player")
  local tbuffs = BuffList("target")

-- Buffs.
  i=i+1; Skill[i] = { name = "Fire Arrow", use = ((not string.find(pbuffs,"Fire Arrow")))}
  i=i+1; Skill[i] = { name = "Fire Ward", use = ((not string.find(pbuffs,"Fire Ward")))}
  i=i+1; Skill[i] = { name = "Energy Well", use = ((not string.find(pbuffs,"Energy Well")))}
  i=i+1; Skill[i] = { name = "Energy Influx", use = ((not string.find(pbuffs,"Energy Influx")))}
  i=i+1; Skill[i] = { name = "Elemental Catalysis", use = ((not string.find(pbuffs,"Elemental Catalysis")))}
  i=i+1; Skill[i] = { name = "Intensification", use = ((not string.find(pbuffs,"Intensification")))}
  
  MyCombat(Skill,arg1)
end

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,256

Thursday, December 30th 2010, 4:00am

Take a look at the code I posted before. You edited my code.

Source code

1
local mana = UnitMana("player")/UnitMaxMana("player")
This line will try to find a percentage of mana left, and is already defined elsewhere in the DIYCE.

Source code

1
i=i+1; Skill[i] = { name = "Thorny Vine",                   use = (mana >= 30) }
This line will try to find a hard coded value.

Choose one to change from the options below.

Source code

1
local mana = UnitMana("player")

Source code

1
2
local mana = PctM("player")
i=i+1; Skill[i] = { name = "Thorny Vine",                   use = (mana >= .30) }

1,257

Thursday, December 30th 2010, 6:01am

Ghostwolf,

So I did some more testing. I fixed the upper part to the recommendations in your last post for the unit mana line. I tried the recommendation for moving the melee statement from the "if" line down to the skill lines.

In a nutshell, any line that has the statement "not melee" will not work. When the "not melee" statement was in the "if" line, none of the skills would fire.

I then moved the "not melee" down to the skill lines on shot, VA and anti-magic arrow. Each time i cycled the macro, it skipped straight to thorny vines. I then removed the "not melee" statement from VA and anti-magic arrow, but left it on shot. When I cycled the macro, it skipped shot but would fire VA and anti-magic arrow.

Is there any other way to define a range. All of my melee skills have a range of 50. For some reason, it seems that the macro does not like the way I am defining range. I dont understand this since I see range defined this way in a lot of other macros on this post. I have tried using the melee range referencing power of the wood spirit and just the normal attack funcion with the same results.

This is driving me crazy. Maybe the macro just doesnt jive with the Warden class and skills.

EDIT: I may have figured it out. I had a slot on my upper action bar noted as position 8 and that is where I had PotWS. I moved this action to another defined slot and changed the macro to reflect this slot number and it seems to work now. Not sure why or what is going on but I will test for a while and advise.

Thanks a ton Ghostwolf (and SixPax for the diyce) for your help. I really appreicate it.
Jacobmo 97Scout/97Warden/95Warrior/97Rogue/88D/85M
Allenmo 78S/77R/56P/1W/1K/1M - retired
Bteam all the way

1,258

Thursday, December 30th 2010, 8:02am

Wolf it does the same thing with that scrip both buff but nothing fires off to kill anything. Six no I don't get any red flags around map
Come take a look at ----> http://romtop100.com

List of US ROM Guilds, Vote for your Favorite to help them move up the ranks, Favorite fan sites, Look for a guild or look for members, Guild Forums, Guild Galleries, and much more

[img][/img]

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,259

Thursday, December 30th 2010, 9:29am

@samohn- That would have been my next suggestion lol. To make sure you have defined the proper action bar slot. Sometimes it really is the simple answers that evade us. It's happened to me on occasion too. :P

@Akalaszlo - Try the same as samohn, check your action bar slots for proper placement. Other than that, I'm really confused as to why this is not working for you.

1,260

Thursday, December 30th 2010, 10:56am

Wolf I get what you mean. The only thing that I should have to do with my action bar with this last scriptis make sure that others shot is in the nine spot with the way the script is. Is this not correct. Also in your big complicated one I don't get where I put the HP and manna pots. where do I edit the code to to the number that the HP and the manna pots slots
Come take a look at ----> http://romtop100.com

List of US ROM Guilds, Vote for your Favorite to help them move up the ranks, Favorite fan sites, Look for a guild or look for members, Guild Forums, Guild Galleries, and much more

[img][/img]