That is somthing totaly different.
handles, nicknames, banmasks, hostmasks are all different things, and muct be treated and obtained differently, on the information you have, and the information you can gain from it.
A handle is like a shell login username. While the person using the shell can be called somthing different each time, the login name allways remains the same. It is used as a persons identity in eggdrop. Each handle has a set of 1 or more hosts masks (can have 0, so they are never recognised on IRC) which are used to tell the differance from one person on IRC to another. Handles must follow the same rules for valid names, as defined for IRC nicknames in RFC 1459.
Nicknames are a persons
CURRENT identity on IRC. They can change nickname at any time while they are on IRC. Eggdrop tells between them, as noted above, by there hostname, matching a certain mask.
Code: Select all
bind mode - "#chan1 +b" mode:kick_banned
proc mode:kick_banned { nick uhost hand chan mc victim } {
set vname "test"
set vname [hand2nick $victim $chan]
puthelp "PRIVMSG mynick : nick $vname is banned "
}
In your script, it displays a message to the channel, when some1 is banned. However, it only accounts for one person. When you set a ban mask, it can match more than one person.
Everything is fine, until the point of using "hand2nick".
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
This command takes a handle as a comulsary argument. A handle is, as noted abovee, a eggdrop login name. It will then look through all channels (unless one is specified), looking for a nickname, that matches a userhost mask, as defined in that handles records. On top of this, handles only exist for users that have a record on the bot.
This command does not take a mask.
There is no command that exists for this sort of thing, as of yet. However, there are command, that can be used, to obtain all users, and search through them yourself. This can be make into a function, that can be reused other script, like in the way you wish in your script.