This is useful on unrealircd networks with anope services. The bot needs an oline that would give it access to chghost, and access to set hosts in hostserv. There is one line that needs to be changed when you add words to the badwords list, it is commented as such. Sorry for any problems you may have with this (it works for what it is.) Also, this code will send a globops message when it changes a host, so that abuse can be monitored. Just change the variables at the top.
set channel "#vhost"
set operid "operlogin"
set operpass "youroperpass"
bind evnt - init-server oper
bind pub -|- !vhost vhost
bind join -|- * joinnotice
proc oper init-server { putserv "OPER $::operid $::operpass" }
proc joinnotice {noticenick noticehost noticehandle noticechan } {
if { $noticechan == $::channel } {
putserv "NOTICE $noticenick To change your host type !vhost <thehost.you.want> and you'll recieve a msg "
}
}
proc vhost {vhostnick vhosthost vhosthand vhostchan vhosttext} {
if { $vhostchan == $::channel } {
checkvhost $vhostnick $vhosttext
}
}
set badwords { *<censored>* *g0v* *admin* *fuck* *fag* *dick* *suck* *shit* *asshole* *zub* *bitch* *cock* *cunt* *whore* *slut* *fartknocker* *ass* *bastard* *nigger* *pussy* *dickhead* *nigga* *piss* *maricon* *shithead* *prick* *sucks* *dicks* *pricks* *.htm* *www.* *#* *channel* *sex* *ass* *trick* *fuk* *azz* *hail* *hitler* *gov* *mil* *cyberarmy* *cia* *fbi* *nsa* *dod* }
proc checkvhost { checknick vhostcheck } {
if {[string match "*.*.*" [string tolower $vhostcheck]]} {
set temp 0
set results 0
#$temp<=X X = number of space delimited tokens in the badwords variable.
while {$temp<=47} {
foreach x [string tolower $::badwords] {
if {[string match $x [string tolower $vhostcheck]]} {
incr results
}
}
incr temp
}
unset temp
if { $results > 0 } {
putserv "NOTICE $checknick Your Vhost has not been changed to $vhostcheck as it is an invalid/disallowed host."
} else {
putserv "GLOBOPS $checknick has changed their vhost to '$vhostcheck'"
putserv "chghost $checknick $vhostcheck"
putserv "NOTICE $checknick Your vhost has been changed to '$vhostcheck'"
putserv "PRIVMSG hostserv set $checknick $vhostcheck"
putserv "NOTICE $checknick To make the server set your vhost whenver you connect type '/msg hostserv on now'"
}
} else {
putserv "NOTICE $checknick You muse use two '.'s in your vhost"
}
}
[quote=Soxide]This script is very usefull indeed but a eggdrop with oper power wouldnt be too good on big servers because some1 could getinto ur bot and mess with stuff.[/quote]
Possibly, but if the bot/conf is secured and you fake version/ctcp etc, people don\'t realise what type of bot/client it is. You can also have it identify/hostmask before it joins channels etc, to make sure people don\'t see the realhost. There are many tricks/things you can do to protect your bot, and I run a couple of oper.eggs on various networks, so I know it can work, if the bot(s) do what they are told that is.
maybe your server uses a different format
putserv \"PRIVMSG hostserv set $checknick $vhostcheck\"
that line sends the command to server, it would be
/msg hostserv set nick host
in mirc. if your server doesnt accept that, then you\'d need to change the format. Otherwise, there\'s nothing in the tcl that would generate that error, and it would be in the oline/services config.
Hi I love this script, one tiny problem is the bot gets a message from hostserv saying access denied. Which is really wierd because he is able to set the vhosts, and oper up correctly. So I think it\'s just a tiny bug. This is the only script I have found so far that will enable my eggy to actually oper up, which is awesome for me for the purposes of this particular bot.
I loaded the script all fine... eggy even opers up... however i get an error saying denied axxess.. bot has NetAdmin status, same flags I have.. and I dont get error... any idea why the bot is?
-HostServ (services@GigaCrew.net)- Access denied. <- from dcc chat