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.

if user changes nick, how to pull info for nick in userfile

Old posts that have not been replied to for several years.
Locked
x
xcoldfyrex
Voice
Posts: 4
Joined: Mon Jun 27, 2005 3:20 pm

if user changes nick, how to pull info for nick in userfile

Post by xcoldfyrex »

This tcl works, but the nick must be in the userlist, how can this work for people who changed thier nicknames(it wont recognize them right now)


proc flags {nick host hand chan text} {
set fl [chattr $nick | $chan]
set fl2 [chattr $text | $chan]
set nnick [getchanhost $text]
set fuser [finduser $nnick]
if { $fl != "*" || $fl2 != "*" } {
if { $text == "" } {
putquick "PRIVMSG $chan :Flags for $text!$nnick: Global flags-<\002 $fl\002 >-$chan flags"
} else {
putquick "PRIVMSG $chan :Flags for $text!$nnick: Global flags-<\002 $fl2\002 >-$chan flags"
}
} else {
putquick "PRIVMSG $chan :that mofo ($text!$nnick) ain in da database..."
}
}
D
Dizzle
Op
Posts: 109
Joined: Thu Apr 28, 2005 11:21 am
Contact:

Post by Dizzle »

NICK (stackable)
bind nick <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel> <newnick>

Description: triggered when someone changes nicknames. The mask
is matched against '#channel newnick' and can contain wildcards.
Channel is "*" if the user isn't on a channel (usually the bot not
yet in a channel).
Module: irc
this is from tcl-commands, $newnick will be the user who's had a nickchange.
Hope this will help

Good luck
x
xcoldfyrex
Voice
Posts: 4
Joined: Mon Jun 27, 2005 3:20 pm

Post by xcoldfyrex »

if i am reading that right, that event is triggered when the user changes thier nick, the code i posted is when somone is a channel does "!flag <nick>" . the stats.mod works like that, it keeps correct info reguardless of nickname
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

Code: Select all

nick2hand <nickname> [channel]
    Returns: the handle of a nickname on a channel. If a channel is not
      specified, the bot will check all of its channels. If the nick is
      not found, "" is returned. If the nick is found but does not have
      a handle, "*" is returned.
    Module: irc

  hand2nick <handle> [channel]
    Returns: nickname of the first person on the specified channel (if one
      is specified) whose nick!user@host matches the given handle; "" is
      returned if no match is found. If no channel is specified, all channels
      are checked.
    Module: irc
cheers
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

your proc is incorrect, use [matchattr] instead of [chattr] for matching user flags/attributes

and for converting between nick and user (handle) use the procs suggested by YooHoo
Locked