|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function MageScout(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local enemy = UnitCanAttack("player","target")
i=i+1; Skill[i] = { name = "Fire Arrow", use = (not ChkBuff("player","Fire Arrow")) }
i=i+1; Skill[i] = { name = "Energy Influx", use = (not ChkBuff("player","Energy Influx")) }
i=i+1; Skill[i] = { name = "Fire Ward", use = (not ChkBuff("player","Fire Ward")) }
i=i+1; Skill[i] = { name = "Flame", use = enemy }
MyCombat(Skill,arg1)
end
|
Quoted from "mrmisterwaa;489833"
krssrb, I suggest you switch to DIYCE 2.0, this thread hasn't been supported as much as the newest version by Ghostwolf.
Quoted
function RogueScout(arg1,arg2)
local Skill = {}
local i = 0
local energy = UnitMana("player")
local focus = UnitSkill("player")
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(1)
i=i+1; Skill = { ['name'] = "Blind Spot", ['use'] = ((not friendly) and (energy >=35) and (behind)) }
i=i+1; Skill[i] = { ['name'] = "Wound Attack", ['use'] = ((not friendly) and (energy >=35) and (string.find(tbuffs,"Bleed")) and (string.find(tbuffs,"Grievous Wound"))) }
i=i+1; Skill[i] = { ['name'] = "Low Blow", ['use'] = ((not friendly) and (energy >=35) and (string.find(tbuffs,"Bleed"))) }
i=i+1; Skill[i] = { ['name'] = "Shadowstab", ['use'] = ((not friendly) and (energy >=35)) }
i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Attack", ['use'] = (not friendly) }
MyCombat(Skill,arg1,arg2)
end
Quoted from "dvince;490580"
i need a simple code like this ,can someone help me why this is not working(without blind spot is ok) ??
|
|
Source code |
1 |
i=i+1; Skill[i] = { ['name'] = "Blind Spot", ['use'] = ((not friendly) and (energy >=35) and (behind)) }
|
Quoted from "Peryl;492216"
Gaaahh... can't resist replying...
|
|
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 |
function MageWarden (arg1, arg2, arg3)
[LEFT]local Skill = {}
local i = 0
[LEFT]local mana = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")[/LEFT]
[/LEFT]
[LEFT]if string.find(arg2, "instant")then
[LEFT]i=i+1; Skill[i] = { name = "Earth Groaning Wind Blade", use = not friendly }
i=i+1; Skill[i] = { name = "Earth Surge", use = not friendly }
i=i+1; Skill[i] = { name = "Fireball", use = not friendly }
end [/LEFT]
[/LEFT]
[LEFT]if string.find(arg2, "buff")then
i=i+1; Skill[i] = { name = "Briar Shield", use = and string.find(pbuff, not "Briar Shield") }
i=i+1; Skill[i] = { name = "Earth Scepter", use = and string.find(pbuff, not "Earth Scepter") }
end[/LEFT]
[LEFT]MyCombat(Skill,arg1)
end[/LEFT]
|
Quoted from "Johanjoker;493783"
can some tell my why this is not working
|
|
Source code |
1 2 |
i=i+1; Skill[i] = { name = "Briar Shield", use = [highlight]and[/highlight] string.find(pbuff, not "Briar Shield") }
i=i+1; Skill[i] = { name = "Earth Scepter", use = [highlight]and[/highlight] string.find(pbuff, not "Earth Scepter") }
|
|
|
Source code |
1 |
if string.find(arg2, "instant")then |
|
|
Source code |
1 |
if arg2 == "instant" then |
Quoted from "Peryl;493804"
As no one has responded to this, I guess I should at least point you in the right direction.
First off, please format your code properly. It makes it much easier to read. See my "Avoiding Common Lua Errors" guide (link in my sig).
You haven't shown how you are calling this function, but you must specify "instant" or "buff" as the second parameter or it will do nothing at all.
First lets tackle the main problem:
![]()
Source code
1 2i=i+1; Skill[I] = { name = "Briar Shield", use = [highlight]and[/highlight] string.find(pbuff, not "Briar Shield") } [/I] [I]i=i+1; Skill[I] = { name = "Earth Scepter", use = [highlight]and[/highlight] string.find(pbuff, not "Earth Scepter") } [/I][/I]
[I]The term and here is misused (highlighted in red). This logic operator requires two inputs but you are only giving one. Remove the term entirely. (See my guide on "Using Lua Logic Operators" to learn how to properly use these things. Link in my sig).[/I]
[i]Now for a bit of cleanup/minor optimization. For both the if statements in your function, you are using Lua's string.find function, but all you really want is to compare the variable [I]arg2 with the string "instant" (or with "buff" in the second case). This is wasteful.
Instead, simply compare the variable with the desired string. So
![]()
Source code
1 if string.find(arg2, "instant")then
becomes:
![]()
Source code
1 if arg2 == "instant" then
Do something similar for the second if statement.
Quoted from "Johanjoker;493991"
ty, is there is a way i can defirenciate between targets...
ex:
if target= rouge then
do lightning
end
if target= mage then
do silence
end
|
|
Source code |
1 |
PrimaryClass, SecondaryClass = UnitClassToken( "target" ) |
|
|
Source code |
1 2 3 4 |
local PrimaryClass, SecondaryClass = UnitClassToken( "target" )
if primaryClass == "THIEF" then
i=i+1; Skill[i] = { name = "lightning", use = not friendly }
end
|
Quoted from "Auros;501026"
No, not you, if you read through this thread (long I know) it has been brought up before that max DPS is achieved manually.