foreach user [userlist] {
if {[matchattr $user b]} {
if {[string match -nocase $who [getuser $user HOSTS]]} {
putnotc $nick "Will Never Ban A Bot."
return 0 }}}
This doesnt work. I input a bots host and it doesnt stop here.
It goes on.
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
CoMMy wrote:foreach user [userlist] {
if {[matchattr $user b]} {
if {[string match -nocase $who [getuser $user HOSTS]]} {
putnotc $nick "Will Never Ban A Bot."
return 0 }}}
What are you trying to do? 'userlist b' would list all the bots. (no need for that matchattr) Is $who a host or a hostMASK? [getuser handle HOSTS] returns a list, so you probably want to loop through that list and do some matching with each element... OR would 'finduser' (tcl-commands.doc) get the job done?
$who is the host given by the person activating the proc.
for example host *!*@something.com
I want the bot to scan and match that host with any bot having the flags +b and return 0 if it does. If it doesnt, scan all channels,all nicknames and look if anyone matches the host and if it does ban him/her.
This is basically what i want.
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
string match -nocase "*$ban*" $userhost
doesn't work.
If a user gives a command like !banhost *!*@someone.com the bot searches the userlist and tries to match that ban. But if a user has
*!someone@someone.com the bot DOESN'T match it.
Any ideas on who to make this work ?
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!