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.

Any ideas .. Thanks

Old posts that have not been replied to for several years.
Locked
g
galaxyboy

Post by galaxyboy »

This script is working right now at the moment. Except, I need it to be able to count the number of channels it OP the user and give a "NOTICE $nick :op you on <numberof channels>" Any ideas?

Here's the code:
bind pub o "[rmschar]opme" pub:opme
proc pub:opme {nick uhost hand chan arg} {
global botnick rmschs rmsquote
if {[lindex [split $arg] 0] == "-help"} {
puthelp "NOTICE $nick :02[rmschar]OPME02"
puthelp "NOTICE $nick :Flags...: o"
puthelp "NOTICE $nick :Syntax..: 02[rmschar]Opme02"
puthelp "NOTICE $nick :0303"
puthelp "NOTICE $nick :Info....: Op you on all channel you have flags in"
return 0
}
if {[onchan $botnick $chan] == 0} {
puthelp "NOTICE $nick :** $chan is not in my channel list"
return 0
}
if {[botisop $chan] == 0} {
puthelp "NOTICE $nick :** I'm not OP on $chan"
return 0
}
set rmsqt [lindex $rmsquote [rand [llength $rmsquote]]]
set opmeuser [lindex [split $arg] 0]
set chans ""
foreach chan [channels] {
pushmode $chan +o [hand2nick $hand $chan]
set chans "$chans $chan"
puthelp "NOTICE $nick :$rmsqt"
putlog "<$nick> requested [rmschar]Opme"
}
}
<font size=-1>[ This Message was edited by: galaxyboy on 2001-12-09 19:28 ]</font>
g
galaxyboy

Post by galaxyboy »

Err, I've got this ban script. It works. How do a add a line such that if anyone tried to ban the Bot's Hostmask, (/ban *!*identd@bot.hostmask.com), the bot would automatically detect it and unban?
bind pub o "[rmschar]ban" pub:ban
proc pub:ban {nick uhost hand chan arg} {
global botnick botname rmsquote rmscquote
if {[lindex [split $arg] 0] == "-help"} {
puthelp "NOTICE $nick :02[rmschar]BAN02"
puthelp "NOTICE $nick :Flags....: o"
puthelp "NOTICE $nick :Syntax...: 02[rmschar]BAN <nickname/hostmask>02"
puthelp "NOTICE $nick :0303"
puthelp "NOTICE $nick :Info.....: Bans a nickname or hostmask. This would"
puthelp "NOTICE $nick : prevent user from joining channel."
return 0
}
set buser [string tolower [lindex $arg 0]]
set host "$buser![getchanhost $buser $chan]"
set rmscqt [lindex $rmscquote [rand [llength $rmscquote]]]
set rmsqt [lindex $rmsquote [rand [llength $rmsquote]]]
set mask [maskhost $host]
if {$buser == [string tolower $botnick]} {
puthelp "NOTICE $nick :$rmscqt"
putlog "<$nick> tried to ban me... reversing!"
return 0
}
if {([matchattr $buser +m]) || ([matchattr $buser +m $chan]) == 1} {
puthelp "NOTICE $nick :$rmscqt"
putlog "<$nick> tried to ban +m flags!"
return 0
}
if {[onchan $botnick $chan] == 0} {
puthelp "NOTICE $nick :** $chan is not in my channel list"
return 0
}
if {[botisop $chan] == 0} {
puthelp "NOTICE $nick :** I'm not OP on $chan"
return 0
}
putserv "MODE $chan +b :$mask"
puthelp "NOTICE $nick :$rmsqt"
putlog "<$nick> requested [rmschar]Ban on $chan to $buser ($mask)"
return 0
}
<font size=-1>[ This Message was edited by: galaxyboy on 2001-12-09 19:33 ]</font>
Locked