im using a small code to add users in eggdrop access list and am wondering how to replace ~ with * in a mask like nick!~ident@host
heres the code we use:
Code: Select all
bind pub m !adduser pub_adduser
proc pub_adduser {nick host handle channel testes} {
set who [lindex [split $testes] 0 ]
set who "[string trimleft $who "+@"]"
set accesschan [lindex [split $testes] 1 ]
if {[matchattr $who +n]} { putserv "NOTICE $nick :You Cannot Change An Owner's Attributes." ; return 1 }
if {$who eq ""} { putnow "notice $nick :Syntax is: !adduser \<nick\> \<channel\> or !adduser \<nick\>" ; return 0 }
if {$accesschan eq ""} { set accesschan "$channel" }
if {![onchan $who $accesschan]} {
putserv "NOTICE $nick :$who isn't on $accesschan."
return 1
}
if {[set chost [getchanhost $who $accesschan]] ne ""} {
switch -glob -- $chost {
{*.irccloud.com} - {*.mibbit.com} - {*.kiwiirc.com} - {*2001*67c*2f08*} - {*192.184.8.*} - {*192.184.9.*} - {*192.184.9.*} - {*192.184.10.*} {
set accessmask "[string trimleft [lindex [split $chost @] 0] "~"]"
set what "*!*[string tolower [string range $accessmask 1 end]]@*"
}
{default} {
set what [maskhost $who!$chost 5]
}
}
}
adduser $who
chattr $who |+o $accesschan
setuser $who HOSTS $what
putserv "NOTICE $nick :Added $who to User-Database."
return 1
}