egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

!args - mysql !command script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
osiris
Voice


Joined: 15 Nov 2010
Posts: 2
Location: BE

PostPosted: Mon Nov 15, 2010 1:49 pm    Post subject: !args - mysql !command script Reply with quote

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 Wink
Back to top
View user's profile Send private message
thommey
Halfop


Joined: 01 Apr 2008
Posts: 73

PostPosted: Mon Nov 15, 2010 10:36 pm    Post subject: Reply with quote

#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
View user's profile Send private message
osiris
Voice


Joined: 15 Nov 2010
Posts: 2
Location: BE

PostPosted: Tue Nov 16, 2010 5:08 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber