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.

Help With Matching A Host To A Nickname

Old posts that have not been replied to for several years.
Locked
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Help With Matching A Host To A Nickname

Post by CoMMy »

I need a script that will match a host given by a user to a nickname in a channel.

Can you help ?
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
Aron
Halfop
Posts: 86
Joined: Sat Mar 15, 2003 8:35 am

Post by Aron »

Code: Select all

proc checkuser {nick host hand chan arg} {
  set check_host [lindex [split $arg] 0]
  foreach user [chanlist $chan] {
     if {[string match -nocase $check_host [getchanhost $user $chan]]} {
        putserv "NOTICE $nick :$check_host matches $user ([getchanhost $user $chan])"
        break
     }
  }
}
....or something like that. I hope that helps.
The best way to start learning is to start helping.
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

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!!
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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?
Have you ever read "The Manual"?
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

Let me explain,

$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!!
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

Anyone Can Help Please ???
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

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!!
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

Ok, I found A Way After Many Many Tries !!!
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
Locked