This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Getting $hand based on $nick given

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
darkmare
Voice
Posts: 12
Joined: Mon Apr 12, 2004 12:55 pm
Location: Beaverton, OR
Contact:

Getting $hand based on $nick given

Post by darkmare »

I'm doing and XTRA field called "tagline", which will be a users tagline. I've got the part that gives you yours if you request it (Such as "Mike, who am I?") (Mike is the bot's name) with this:

Code: Select all

proc give_tagline {nick mask hand chan arg} {

	putserv	"PRIVMSG $chan :$nick is [getuser $hand XTRA tagline]"
}
Now, I also want it to respond to "Mike, who is <nick>?". I have the matching for nicks in channel already written (and if they are there), what I would like to do now is how can I take $requested_nick and get their handle to pull up their tagline? Would something along the lines of:

Code: Select all

proc give_tagline {nick mask hand chan arg} {

	putserv	"PRIVMSG $chan :$requested_nick is [getuser $requested_nick XTRA tagline]"
}
work? Or do I need something to return the $hand of the $requested_nick, then use that first example? Or can I just do something where after matching the $requested_nick to someone in channel, get $requestd_nick's $hand?
Image
Brendan K Callahan Undernet: MaryFinn & PixelCat on #Mary'sPlace | http://3whack.org/brendan/ Theft by Deception DnB music (Released under the CreativeCommons License)
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

nick2hand <nickname> [channel]
returns: handle of <nickname> on <channel>
| if <channel> is not specified, bot will check all of its channels
| if <nickname> not found, returns ""
| if <nickname> found but unknown, returns "*"
Once the game is over, the king and the pawn go back in the same box.
User avatar
darkmare
Voice
Posts: 12
Joined: Mon Apr 12, 2004 12:55 pm
Location: Beaverton, OR
Contact:

Post by darkmare »

Thanks!
Image
Brendan K Callahan Undernet: MaryFinn & PixelCat on #Mary'sPlace | http://3whack.org/brendan/ Theft by Deception DnB music (Released under the CreativeCommons License)
Post Reply