vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 -- Form Edit Box
2 lazyr.lreb = {}
3  
4 lazyr.lreb.currentForm = nil
5 lazyr.lreb.cancelEdit = false
6  
7 function lazyr.lreb.OnShow()
8 if (not lazyr.lreb.currentForm) then
9 lazyr.lreb.currentForm = ""
10 end
11  
12 --LazyRogueFormEditFrameTitle:SetText("LazyRogue v"..lazyr.version)
13 LazyRogueFormEditFrameFormName:SetText(lazyr.lreb.currentForm)
14 if (lazyr.lreb.currentForm == "") then
15 LazyRogueFormEditFrameFormName:SetFocus()
16 end
17  
18 local actions = lrConf.forms[lazyr.lreb.currentForm]
19 local text
20 if (actions) then
21 text = table.concat(actions, "\n")
22 else
23 text = ""
24 end
25 LazyRogueFormEditFrameForm:SetText(text)
26 end
27  
28 function lazyr.lreb.OnHide()
29 if (lazyr.lreb.cancelEdit) then
30 lazyr.lreb.cancelEdit = false
31 return
32 end
33  
34 local name = LazyRogueFormEditFrameFormName:GetText()
35 -- convert spaces to underscores
36 name = string.gsub(name, "%s+", "_")
37  
38 local oldName = lazyr.lreb.currentForm
39 local text = LazyRogueFormEditFrameForm:GetText()
40  
41 if (not name or name == "" or not text or text == "") then
42 return
43 end
44  
45 --lazyr.SlashCommand("set "..name.." "..text)
46 -- doing this manually (dup code alert! :-( ) so we can
47 -- preserve comments or other goodies
48 if (lrConf.forms[name]) then
49 verb = "updated"
50 else
51 verb = "created"
52 end
53 local args = {}
54 for arg in string.gfind(text, "[^\r\n]+") do
55 table.insert(args, arg)
56 end
57 lrConf.forms[name] = args
58 lazyr.ClearParsedForm(name)
59 lazyr.p("Form "..name.." "..verb..".")
60 lazyr.ParseForm(args)
61  
62 if (oldName and oldName ~= "" and name ~= oldName) then
63 -- user changed the name
64 if (lazyr.perPlayerConf.defaultForm == oldName) then
65 lazyr.SlashCommand("default "..name)
66 end
67 lazyr.SlashCommand("clear "..oldName)
68 end
69  
70 lazyr.lreb.currentForm = nil
71 end
72  
73  
74 -- Help frame
75 function lazyr.PopulateHelpText()
76 local text = "This is LazyRogue v"..lazyr.version.."."
77  
78 text = text.."\n\n"
79 text = text..[[
80 Actions/Attacks:
81 adrenaline, ambush, berserking, bladeFlurry, blind, bs, cbEvisc, coldBlood, cs, dismount, evasion, evisc, expose, feint, garrote, ghostly, gouge, hemo, kick, ks, premeditation, preparation, riposte, rupture, sap, snd, sprint, ss, stealth, stop, stopAll, tea, use=<item>, useEquipped=<item>, vanish
82  
83 New Actions/Attacks:
84 * perception,cannibalize,stoneForm,escapeArtist,bloodFury,forsaken,warStomp
85 * pickPocket,throw,gun,crossbow,bow
86 * cbAmbush
87 * equipMainHand=<itemid/item name>
88 * equipOffHand=<itemid/item name>
89 * use=<itemid/item name>
90 * setForm=<FormName>
91 * ping (Use for testing criteria)
92 * action=<action/macro name> Action/Macro must reside on a button.
93 * targetAssist (Use /lr assist <player name> or select the player and type /lr assist to set!)
94 * targetNearest (Use with -if[Not]TargetCCd to select the closest available target)
95 * autoAttack (Will target and enter melee for you, if you dont have a target)
96 * sayIn{Guild,Party,Raid,Say,Emote,RAID_WARNING}=<message>(eg sayInParty=Sapping %t...-ifStealthed-ifShiftDown-every10s)(%t will get swapped with your current target)
97  
98 Append zero or more criteria to these attacks. All criteria must be true for that attack to be used. List your attacks one after another. The first attack that matches all criteria is used.
99  
100 In the following, multiple values within curly braces ({}) means choose one, and square brackets ([]) mean the value is optional. Do NOT leave the curly braces or square brackets in your form.
101  
102 Criteria Fuctions:
103 -if{Player,Target}{>,=,<}XX[%]{hp,mana/energy}
104 -if[<=>]Xcp
105 -ifKillShot[=XX%] (evisc only)
106 -ifCbKillShot (evisc or cbevisc only)
107 -if[Not]History{>,=,<}XX=<action>
108 -if[Not]InCombat
109 -if[Not]InGroup
110 -if[Not]LastChance
111 -if[Not]Mounted
112 -if[Not]Stealthed
113 -if[Not]TargetAlive
114 -if[Not]TargetCCd
115 -if[Not]TargetClass={Druid,Hunter,Mage,Paladin,
116 Priest,Rogue,Shaman,Warlock,Warrior} (, can be used for multiples ie -ifTargetClass=Druid,Mage )
117 -if[Not]TargetElite
118 -if[Not]TargetHostile
119 -if[Not]TargetIsCasting[=<regex>] (use with: kick, cs, ks, gouge, blind)(, can be used for multiples ie -ifTargetIsCasting=Renew,Heal )
120 -if[Not]TargetInCombat
121 -if[Not]TargetInMeleeRange (Within 5.5 yards)
122 -if[Not]TargetInBlindRange (Within 10 yards)
123 -ifTargetLevel{>,=,<}XX
124 -if[Not]TargetNPC
125 -if[Not]TargetNamed=regex
126 -if[Not]TargetOfTarget
127 -if[Not]TargetType={Beast,Critter,Demon,Elemental
128 Humanoid,Undead} (, can be used for multiples ie -ifTargetType=Demon,Elemental )
129 -if[Not]Zone=<zonename>
130 -if[Not]{Adrenaline,Berserking,BladeFlurry,Blind,
131 ColdBlood,Cs,Evasion,Expose,FirstAid (Eg Bandages),
132 Garrote,Ghostly,Gouge,Hemo,Ks,RecentlyBandaged,
133 Remorseless,Rupture,Sap,Snd,Vanish}Active
134 -if[Not]{Ctrl,Alt,Shift}Down (see Note 1)
135 -everyXXs
136  
137 Note 1: To use -if{Ctrl,Alt,Shift}Down, you MUST remove any existing
138 Ctrl/Alt/Shift key bindings from the Main Menu, Key Bindings.
139 Otherwise the game will intercept the key and LR will not see it.
140  
141 New Criteria Fuctions:
142 * -if[Not]FirstAidActive
143 * -if[Not]BehindAttackJustFailed
144 * -if[Not]InFrontAttackJustFailed
145 * -if[Not]Feared
146 * -if[Not]Immobile
147 * -if[Not][Target]Slowed
148 * -if[Not][Target]Stunned
149 * -if[Not]TargetOfTargetClass={Druid,Hunter,Mage,Paladin,Priest,Rogue,Shaman,Warlock,Warrior} (, can be used for multiples ie -ifTargetOfTargetClass=Druid,Mage )
150 * -if[Not]InCooldown=<action>
151 * -if[Not]Dotted
152 * -if[Not]Bleeding
153 * -if[Not]Ganked
154 * -if[Not]FlagRunner
155 * -if[Target]FlaggedPVP
156 * -if[<=>]Xattackers
157 * -if[Not]Dueling
158 * -if[Not]Instance
159 * -if[Not]Battleground
160 * -if[Not]TargetMyLevel[<=>]{plus,minus}XX
161 * -if[Not]Timer={adrenaline,berserking,bladeFlurry,blind,
162 coldBlood,cs,evasion,expose,firstAid (Eg Bandages),
163 garrote,ghostly,gouge,hemo,ks,recentlyBandaged,
164 remorseless,rupture,sap,snd,vanish}>XXs
165 * -if[Not]Equipped=<item>
166 * -if[Not]GlobalCooldown
167 * -if[Not]CanDebuff (Checks less than 16 debuffs on target)
168 * -if[Not]HuntersMark
169 * -if[Not]Polymorphed
170 * -if[Not]TargetImmune[={blind,cs,expose,garrote,gouge,hemo,ks,rupture,sap}] (The match list for this function (weaponORspell and Mob) is self building through combat and can be cleared using /lr clearImmunitiesList)
171 * -if[Not]InRaid
172  
173 Any line may be commented out by placing '--' at the front of the line.
174 ]]
175  
176 LazyRogueFormHelpScrollFrameScrollChildText:SetText(text)
177 end
178