Mercurial > wow > mylilpony
comparison MyLilPony.lua @ 19:2ae5f67e313a 1.1.0-b1
Added support for matching any unit's mount via macro options (e.g. /pony [@mouseover] match). The "target" command is now deprecated in favour of the slightly more general "match" (although "target" will continue to work).
author | syzler |
---|---|
date | Sat, 16 Apr 2011 15:23:40 +0000 |
parents | b7966675a105 |
children | 7bc67e937603 |
comparison
equal
deleted
inserted
replaced
18:b7966675a105 | 19:2ae5f67e313a |
---|---|
123 | 123 |
124 MyLilPony.CallGroundMount(); | 124 MyLilPony.CallGroundMount(); |
125 end | 125 end |
126 | 126 |
127 function MyLilPony.SlashHandler(args) | 127 function MyLilPony.SlashHandler(args) |
128 local arg = SecureCmdOptionParse(args); | 128 local arg, unit = SecureCmdOptionParse(args); |
129 if MyLilPony.StringMatchIgnoreCase(arg, "^auto$") then | 129 if MyLilPony.StringMatchIgnoreCase(arg, "^auto$") then |
130 MyLilPony.AutoMount(); | 130 MyLilPony.AutoMount(); |
131 elseif MyLilPony.StringMatchIgnoreCase(arg, "^random$") | 131 elseif MyLilPony.StringMatchIgnoreCase(arg, "^random$") |
132 or MyLilPony.StringMatchIgnoreCase(arg, "^rand$") | 132 or MyLilPony.StringMatchIgnoreCase(arg, "^rand$") |
133 or MyLilPony.StringMatchIgnoreCase(arg, "^rng$") | 133 or MyLilPony.StringMatchIgnoreCase(arg, "^rng$") |
144 elseif MyLilPony.StringMatchIgnoreCase(arg, "^aquatic$") | 144 elseif MyLilPony.StringMatchIgnoreCase(arg, "^aquatic$") |
145 or MyLilPony.StringMatchIgnoreCase(arg, "^aqua$") | 145 or MyLilPony.StringMatchIgnoreCase(arg, "^aqua$") |
146 or MyLilPony.StringMatchIgnoreCase(arg, "^swim$") | 146 or MyLilPony.StringMatchIgnoreCase(arg, "^swim$") |
147 or MyLilPony.StringMatchIgnoreCase(arg, "^s$") then | 147 or MyLilPony.StringMatchIgnoreCase(arg, "^s$") then |
148 MyLilPony.CallAquaticMount(); | 148 MyLilPony.CallAquaticMount(); |
149 elseif MyLilPony.StringMatchIgnoreCase(arg, "^target$") | 149 elseif MyLilPony.StringMatchIgnoreCase(arg, "^match$") |
150 or MyLilPony.StringMatchIgnoreCase(arg, "^m$") | |
151 or MyLilPony.StringMatchIgnoreCase(arg, "^target$") | |
150 or MyLilPony.StringMatchIgnoreCase(arg, "^tgt$") | 152 or MyLilPony.StringMatchIgnoreCase(arg, "^tgt$") |
151 or MyLilPony.StringMatchIgnoreCase(arg, "^t$") then | 153 or MyLilPony.StringMatchIgnoreCase(arg, "^t$") then |
152 local result = MyLilPony.CallMountByMatch("target"); | 154 if unit == "" or unit == nil then unit = "target" end |
155 local result = MyLilPony.CallMountByMatch(unit); | |
153 if not result then | 156 if not result then |
154 MyLilPony.Log("No matching mounts were found"); | 157 MyLilPony.Log("No matching mounts were found"); |
155 end | 158 end |
156 elseif MyLilPony.StringMatchIgnoreCase(arg, "^exact .+$") | 159 elseif MyLilPony.StringMatchIgnoreCase(arg, "^exact .+$") |
157 or MyLilPony.StringMatchIgnoreCase(arg, "^x .+$") then | 160 or MyLilPony.StringMatchIgnoreCase(arg, "^x .+$") then |
188 MyLilPony.Print(" /mylilpony auto - Summons a \"suitable\" mount"); | 191 MyLilPony.Print(" /mylilpony auto - Summons a \"suitable\" mount"); |
189 MyLilPony.Print(" /mylilpony random - Summons random mount"); | 192 MyLilPony.Print(" /mylilpony random - Summons random mount"); |
190 MyLilPony.Print(" /mylilpony ground - Summons random ground mount"); | 193 MyLilPony.Print(" /mylilpony ground - Summons random ground mount"); |
191 MyLilPony.Print(" /mylilpony flying - Summons random flying mount"); | 194 MyLilPony.Print(" /mylilpony flying - Summons random flying mount"); |
192 MyLilPony.Print(" /mylilpony aquatic - Summons random aquatic mount"); | 195 MyLilPony.Print(" /mylilpony aquatic - Summons random aquatic mount"); |
193 MyLilPony.Print(" /mylilpony target - Summons same mount as targeted unit"); | 196 MyLilPony.Print(" /mylilpony match - Summons same mount as targeted unit"); |
197 MyLilPony.Print(" /mylilpony [@<UNITID>] match - Summons same mount as specified unit"); | |
194 MyLilPony.Print(" /mylilpony list <NAME> - Lists mounts matching name"); | 198 MyLilPony.Print(" /mylilpony list <NAME> - Lists mounts matching name"); |
195 MyLilPony.Print(" /mylilpony exact <NAME> - Summons mount by exact name"); | 199 MyLilPony.Print(" /mylilpony exact <NAME> - Summons mount by exact name"); |
196 MyLilPony.Print(" /mylilpony <ID> - Summons mount by spell or creature ID"); | 200 MyLilPony.Print(" /mylilpony <ID> - Summons mount by spell or creature ID"); |
197 MyLilPony.Print(" /mylilpony <NAME> - Summons random mount matching name"); | 201 MyLilPony.Print(" /mylilpony <NAME> - Summons random mount matching name"); |
198 end | 202 end |