首页 > LazyScript > LazyScript Tutorial Judgment Conditions
2026
04-10

LazyScript Tutorial Judgment Conditions

# LazyScript Tutorial Judgment Conditions

Judgment Condition List
========
Add judgment conditions for skill casting. All conditions must be met to cast the skill. Each skill and judgment condition on one line, order from top to bottom, cast skills that meet the judgment conditions.

Values in curly braces ({}) need to select one or more, if selecting multiple, please separate with English comma (,) (e.g., ifRace=Human,Gnome) judgment condition is satisfied if any one is met (Human or Gnome both work). If selecting multiple and using "Not" (e.g., ifNotRace=Human,Gnome), judgment condition must be neither to execute (neither Human nor Gnome). Square brackets ([]) indicate the value is optional. Do not keep curly braces or square brackets in the script.

Action Judgment Conditions:
----------------

-everyXXs --Every X seconds (only execute once within X seconds)
-if[Not]{Ctrl,Alt,Shift}Down --Judge if key is pressed (Ctrl, Alt, Shift), note when using this judgment condition, cannot bind skills to Ctrl/Alt/Shift keys in-game, note 1
-if[Not]Cooldown{<,>}XXs={action1,action2,...} --Judge skill cooldown time
-if[Not]CurrentAction[=action1,action2,...] --Current casting skill
-if[Not]GlobalCooldown --Judge GCD, judgment method see note 8
-if[Not]History{<,=,>}XX=action --Already used skills
-if[Not]HistoryCount{<,=,>}XX=action --Skill use count
-if[Not]LastAction=action --Most recently used skill
-if[Not]LastUsed>XXs=action --Used this skill within X seconds, timing rules see note 10
-if[Not]InCooldown={action1,action2,...} --Skill in cooldown
-if[Not]InRange={action1,action2,...} --Skill in casting range, note 2
-if[Not]Timer>XXs=action --Not used this skill within X seconds, timing rules see note 10
-if[Not]Usable={action1,action2,...} --Skill usable, note 7

Attack Judgment Conditions:
----------------

-if[Not]BehindAttackJustFailed[X[.Y]s] --Behind attack failed (backstab in front of target), default time is 0.3 seconds. Note 3
-if[Not]InFrontAttackJustFailed[X[.Y]s] --Front attack failed (gouge behind target), default time is 0.3 seconds. Note 3
-if[Not]OutdoorsAttackJustFailed[X[.Y]s] --Outdoors skill failed (druid entangle, travel form), default time is 0.3 seconds. Note 3
-if[Not]Casting --Casting spell
-if[Not]Channelling --Channeling spell
-if[Not]Shooting --Auto shot
-if[Not]Wanding --Wand shooting

Buff/Debuff Judgment Conditions:
-------------------------

-if[Not]{Buff,Debuff}Duration{<,>}XXs={buff1,buff2,...} (player only) --buff/debuff duration (can only judge player itself)
-if[Not]{Buff,Debuff}TitleDuration{<,>}XXs={buffTitle1,buffTitle2,...} --buff/debuff not in list duration (can only judge player itself), note 4
-if[Not][]Has{Buff,Debuff}[{<,=,>}XX]={buff1,buff2,...} --(pet, target, target of target, etc.) whether has buff/debuff, note 5, note 9
-if[Not][]Has{Buff,Debuff}Title[{<,=,>}XX]={buffTitle1,buffTitle2,...} --(pet, target, target of target, etc.) whether has buff/debuff not in list, note 4, note 5, note 9
-if[Not][]Is={Asleep, Bleeding, CCd, Charmed, Cursed, Diseased, Disoriented, Dotted, Drinking, Eating, Feared, Immobile, Incapacitated, Magicked, Poisoned, Polymorphed, Slowed, Stunned, Stung} --Status (Asleep, Bleeding, CCd, Charmed, Cursed, Diseased, Disoriented, Dot, Drinking, Eating, Feared, Immobile, Incapacitated, Magicked, Poisoned, Polymorphed, Slowed, Stunned), note 9
-if[Not]{MainHand, OffHand}Buffed --Main/off hand weapon temporary buff (sharpening stone, poison, oil)

Item Judgment Conditions:
----------------

-if[Not]ItemCooldown{<,>}XXs={item1,item2,...} --Item cooldown time
-if[Not]ItemInCooldown={item1,item2,...} --Item in cooldown

Player Judgment Conditions:
----------------

-if[Not]Dueling --In duel
-if[Not]Equipped=item --Whether equipped item
-if[Not]Ganked --Being PPPVP
-if[Not]InGroup (party or raid) --In party (raid)
-if[Not]InInstance --In dungeon
-if[Not]InBattleground --In battleground
-if[Not]InRaid --In raid
-if[Not]Mounted --Mounted
-if[Not]Shadowmelded --Shadowmeld
-if[Not]Tracking={Herbs, Minerals, Treasure} --Tracking herbs, minerals, treasure
-if[{<,=,>}]XAttackers (PvP only) --N enemies attacking player (PvP only)
-if[Not]Zone=zonename

Pet Judgment Conditions:
----------------

-if[Not]HasPet --Has pet
-if[Not]PetAlive --Pet alive
-if[Not]Pet{Attacking, Following, Staying, Aggressive, Defensive, Passive} --Pet status (Attacking, Following, Staying, Aggressive, Defensive, Passive)
-if[Not]PetFamily={Bat, Bear, Boar, Carrion Bird, Cat, Crab, Crocolisk, Doomguard, Felhunter, Gorilla, Hyena, Imp, Infernal, Owl, Raptor, Scorpid, Spider, Succubus, Tallstrider, Turtle, Voidwalker, Windserpent, Wolf} --Pet family (Bat, Bear, Boar, Carrion Bird, Cat, Crab, Crocolisk, Doomguard, Felhunter, Gorilla, Hyena, Imp, Infernal, Owl, Raptor, Scorpid, Spider, Succubus, Tallstrider, Turtle, Voidwalker, Windserpent, Wolf)
-if[Not]PetName=name --Pet name

Player, Pet, Target Judgment Conditions:
------------------------------

-if[Not]{[Player],Target}{Blocked, Dodged, Parried, Resisted}[{<,>}XX.XXs] --Player, target Blocked, Dodged, Parried, Resisted, default <5s, note 11
-if[Not]{[Player],Target}FlaggedPVP --PVP status
-if[Not]{[Player],Target}FlagRunner --Warsong flag carrier
-if[Not]{[Player],Pet,Target}InCombat --In combat
-if[]{<,=,>}XX[%]{hp,mana/energy/rage/focus}[Deficit] --Status (HP, Mana, Energy, Rage, Focus), note 9
-if[Not]{[Player],Target}Race={Human, Night Elf, Gnome, Dwarf, Orc, Scourge/Undead, Tauren, Troll} --Player, target race (Human, Night Elf, Gnome, Dwarf, Orc, Undead, Tauren, Troll)

Target Judgment Conditions:
----------------

-if[Not]CanDebuff --Can apply Debuff
-if[Not]HaveTarget --Has target
-if[Not]TargetAlive --Target alive
-if[Not]TargetAttackable --Target can be attacked
-if[Not]TargetBoss --Target is Boss
-if[Not]TargetClass={Druid, Hunter, Mage, Paladin, Priest, Rogue, Shaman, Warlock, Warrior} --Target class (Druid, Hunter, Mage, Paladin, Priest, Rogue, Shaman, Warlock, Warrior)
-if[Not]TargetElite --Target is elite
-if[Not]TargetEnemy --Target is enemy
-if[Not]TargetFleeing (NPC only) --Target fleeing (NPC only)
-if[Not]TargetFriend --Target friendly
-if[Not]TargetHasTarget --Target has target
-if[Not]TargetHostile --Target hostile
-if[Not]TargetIsCasting[={name regex,FIRE,FROST,NATURE,SHADOW,ARCANE,HOLY}] --Target casting (skill full name, Fire, Frost, Nature, Shadow, Arcane, Holy)
-if[Not]TargetImmune[=action] --Target immune to skill
-if[Not]TargetInBlindRange (Within 10 yards) --Target in blind range (within 10 yards)
-if[Not]TargetInLongRange (Within 28 yards) --Target within 28 yards
-if[Not]TargetInMediumRange (Within 10 yards) --Target within 10 yards
-if[Not]TargetInMeleeRange --Target in melee range, note 6
-if[Not]TargetLevel{<,=,>}XX (Does not work for bosses) --Target level (does not work for bosses)
-if[Not]TargetMyLevel{<,=,>}{plus,minus}XX (Does not work for bosses) --Target level difference from player (does not work for bosses)
-if[Not]TargetNamed={regex1,regex2,...} --Target name
-if[Not]TargetNPC --Target is NPC
-if[Not]TargetOfTarget --Target of target
-if[Not]TargetOfTargetClass={Druid, Hunter, Mage, Paladin, Priest, Rogue, Shaman, Warlock, Warrior} --Target of target class (Druid, Hunter, Mage, Paladin, Priest, Rogue, Shaman, Warlock, Warrior)
-if[Not]TargetTrivial --Target is trivial
-if[Not]TargetType={Beast, Critter, Demon, Dragonkin, Elemental, Humanoid, Undead} --Target type (Beast, Critter, Demon, Dragonkin, Elemental, Humanoid, Undead)
-ifTimeToDeath{<,=,>}XXs --Death within X seconds

**Note 1**: To use -if{Ctrl,Alt,Shift}Down, cannot bind skills to Ctrl/Alt/Shift keys in-game, otherwise the game will intercept the key and LazyScript cannot judge.

**Note 2**: -if[Not]InRange={action1,action2,...} must use -if[Not]TargetFriend to assist judgment, if target is not valid target for skill (buff hostile boss, damage friendly target), will also judge as satisfied (true).

**Note 3**: Within X.Y seconds, default is 0.3 seconds, generally use default value.

**Note 4**: Buffs/debuffs not in list should write full name.

**Note 5**: XX refers to buff/debuff stacks, e.g., -ifTargetHasDebuff<5=sunder **Note 6**: Turtle WoW and N server, this judgment condition only works for Rogue (Sinister Strike), Druid (Growl), Hunter (Wing Clip) and Warrior (Rend) four classes against hostile targets. **Note 7**: ifUsable calls API's IsUsableAction function, does not check skill cooldown or skill range. **Note 8**: ifGlobalCooldown needs to be judged through specific skills. You need to drag this skill to action bar to check GCD. Each class corresponding skill is as follows (all are initial skills or level 2 learned skills): Rogue: Sinister Strike Druid: Mark of the Wild Hunter: Track Beasts Priest: Power Word: Fortitude Warrior: Battle Shout Mage: Frost Armor Warlock: Demon Skin Shaman: Rockbiter Weapon Paladin: Seal of Righteousness **Note 9**: can be any valid UnitId sequence, see . Such as: player, pet, target, targettarget. First letter capitalization doesn't matter.

**Note 10**: ifLastUsed timing rules: use this skill after entering combat or changing target. ifTimer timing rules, XX seconds after entering combat or changing target, first cast this skill.

**Note 11**: This judgment condition only detects complete blocks and resists. Partial blocks or resists ("Critter hits you for 100 damage (90 blocked).") neither player nor target satisfies this judgment condition.


留下一个回复

你的email不会被公开。