|
||||||
| Lua Code Discussion You scared? Terrified. Mortified. Petrified. Stupefied... by [coding]. | ||||||
![]() |
|
|
Thread Tools |
|
|
#1 | |
|
Newbie
Join Date: Oct 2008
Posts: 9
|
Not sure how I should have worded the title, it's probably inaccurate.
Either way, I am working on an addon that builds an array of character's names through slash commands. I want it to basically do this. The addon is called ScrubAway, I want it to add the character's name to the array through this command: Quote:
I was thinking: Oh I can use string.sub from the 9th character to the end. However I realized I would require the string for the string.sub function. Is this possible? To save the string that is placed at that command so that my string sub can run the variable? Hope this makes sense. Thanks guys! |
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jan 2006
Location: Sweden
Posts: 352
|
To capture "Playersname", you could do something like this in your slash handler: (the slightly more foolproof way)
Code:
function(msg)
local cmd, arg = msg:match("%s*(%S+)%s+(%S+)")
addToArray(arg)
end
__________________
Grab your sword and fight the Horde! Shattered Hand-EU |
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
All times are GMT. The time now is 04:18 AM.
WowAce Forums




