| View previous topic :: View next topic |
| Author |
Message |
osiris Voice
Joined: 15 Nov 2010 Posts: 2 Location: BE
|
Posted: Mon Nov 15, 2010 1:49 pm Post subject: !args - mysql !command script |
|
|
Hi all.
I am currently making a mysql based !command script (!command nickname1 nickname2) for entertainment of my users.
There are only two things I don't know how to do although it might be quite simple.
#1:
how can I bind just "!" and take everything directly behind it as the first argument ?
#2:
is it possible to automatically replace (in output) %1 and %2 by $nick and $arg(s) (maybe regsub?)
Thanks  |
|
| Back to top |
|
 |
thommey Halfop
Joined: 01 Apr 2008 Posts: 73
|
Posted: Mon Nov 15, 2010 10:36 pm Post subject: |
|
|
#1: bind pubm - "% !*" dostuff
last argument to dostuff will be the full string "!test a b c"
bind pubm in the reference manual
#2: no "automation", but you can just string map it (regsub needs special treatment of special chars which is ugly)
| Code: | | set output [string map [list %1 $nick %2 $arg] $output] |
string map in the reference manual |
|
| Back to top |
|
 |
osiris Voice
Joined: 15 Nov 2010 Posts: 2 Location: BE
|
Posted: Tue Nov 16, 2010 5:08 pm Post subject: |
|
|
That seems to work indeed, except for the second argument which he doesn't read for some reason... (you can use !command, but not !command victim)
Thank you for your help  |
|
| Back to top |
|
 |
|