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.

maskhost not working right?

Old posts that have not been replied to for several years.
Locked
L
LtPhil
Voice
Posts: 26
Joined: Mon Jul 28, 2003 10:25 am

maskhost not working right?

Post by LtPhil »

i'm trying to set a ban in the form *!*ident@*.isp.com, but when i use maskhost, it has a problem with people who have a tilde (~) in their ident.

when a user is "GNR!~GNR@xxxxxx.client.attbi.com", maskhost returns "*!GNR@*.attbi.com". how can i make it (or make another function) that returns "*!*GNR@*.attbi.com" or "*!*GNR@*.client.attbi.com" ?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

try [maskhost *[getchanhost $nick $chan]]
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Code: Select all

proc my_maskhost {in} {
  set in [split $in !@]
  set nick [lindex $in 0]
  set ident [lindex $in 1]
  set host [lindex $in 2]

  if {[string length [join [lrange [set a [split $host .]] end-1 end] {}]] < 6} {
    set host [join [lrange $a end-2 end] .]
  } else {
    set host [join [lrange $a end-1 end] .]
  }
  return "*!*${ident}@*.${host}"
}
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Re: maskhost not working right?

Post by egghead »

LtPhil wrote:i'm trying to set a ban in the form *!*ident@*.isp.com, but when i use maskhost, it has a problem with people who have a tilde (~) in their ident.

when a user is "GNR!~GNR@xxxxxx.client.attbi.com", maskhost returns "*!GNR@*.attbi.com". how can i make it (or make another function) that returns "*!*GNR@*.attbi.com" or "*!*GNR@*.client.attbi.com" ?
Not sure what you have been trying...
.tcl set strict-host 0
Tcl: 0
.tcl maskhost GNR!~GNR@xxxxxx.client.attbi.com
Tcl: *!*GNR@*.attbi.com
.tcl set strict-host 1
Tcl: 1
.tcl maskhost GNR!~GNR@xxxxxx.client.attbi.com
Tcl: *!?GNR@*.attbi.com
Additional note: if you have "strict-host" set to 0, the username send to your proc (and subsequently send to the maskhost proc) does not contain the leading "~", eventhough the user has this leading tilde when on IRC.

You may want to set strict-host to 1 which will keep the leading tilde.
L
LtPhil
Voice
Posts: 26
Joined: Mon Jul 28, 2003 10:25 am

Post by LtPhil »

quite a few informative replies here :D

thank you all for your help...

sir_fz: that works well, the only problem being i won't always have a $chan to throw in there :)

ppslim: very nifty little bit of code there, i like! *uses*

egghead: strict-host was 0, and that's why maskhost was getting confused :roll: -- good call

again, thank you all for your help, and especially for quick responses! :D
Locked