- Home»
- Cod sursa: jupe.tcl
jupe.tcl
jupe.tcl
Set the bot's nick to the one you want to jupe, and altnick to the backup. Thats done via the bots globals... you can do that yourself in the bot.conf file.
| Postat de | Copyright | Categorie | Review user | Vizualizari | Data |
|---|---|---|---|---|---|
| btc | Bass | chanops | Cod netestat | 337 | 2023-12-25 09:44:15 |
#jupe.tcl by Bass on Undernet. Last edit: 2/99
#It's pretty simple: set the bot's nick to the one you want to jupe, and altnick to the backup.
#That's done via the bot's globals... you can do that yourself in the bot.conf file.
#You can also do it down below if you prefer. Don't forget to get botnet-nick set, too.
#
#The script is pretty self-explanatory. Read it. Understand it.
#"/msg bot unjupe" will make the bot release the jupenick for 5 minutes.
#(w/o the 5 min timer... the bot *will* nick-collide you if there is any net-lag.)
#"nick" is what the bot will try to hold/jupe, and altnick is the backup.
#The bot switches to "altnick" when you msg the bot "unjupe".
#Uncomment the following lines and set correctly.
#set nick jupenick
#set altnick orignick
#set botnet-nick netnick
bind sign - * sign:jupe
proc sign:jupe {n uh h ch r} {
global botnick nick altnick keep-nick
if {[string tolower $n] == [string tolower $nick] && $botnick != $nick && ${keep-nick} == 1} {putserv "nick $nick" ; return}
if {[string tolower $n] == [string tolower $altnick] && $botnick != $altnick && ${keep-nick} == 1} {putserv "nick $altnick" ; return}
}
bind nick - * nick:jupe
proc nick:jupe {n uhost hand chan newnick} {
global botnick nick altnick keep-nick
if {[string tolower $n] == [string tolower $nick] && $botnick != $nick && $botnick != $newnick && ${keep-nick} == 1} {putserv "nick $nick" ; return}
if {[string tolower $n] == [string tolower $altnick] && $botnick != $altnick && $botnick != $newnick && ${keep-nick} == 1} {putserv "nick $altnick" ; return}
}
if {![info exists jupe_on]} {set jupe_on 1 ; utimer 120 jupe:check}
proc jupe:check {} {
utimer 15 jupe:check
global nick altnick botnick keep-nick
if {${keep-nick} == 0} {return}
set n $botnick
if {$nick != $botnick} {
set n "$n $nick"
if {$altnick != $botnick} {set n "$n $altnick"}
}
if {$n != $botnick} {puthelp "ison :$n"}
}
bind raw -|- 303 jupe:ison
proc jupe:ison {from keywords args} {
global botnick nick altnick keep-nick
if {${keep-nick} == 0 || $botnick == $nick} {return}
set args [split [string trim [join [string tolower $args]]]]
if {[lindex $args 0] != [string tolower $botnick]} {return}
set item2 [lrange $args 2 e]
set args [string trimleft [lindex $args 1] ":"]
if {$item2 != ""} {set args "$args $item2"}
if {[lsearch -exact $args [string tolower $nick]] == -1 && $botnick != $nick} {putserv "nick $nick" ; return}
if {[lsearch -exact $args [string tolower $altnick]] == -1 && $botnick != $altnick} {putserv "nick $altnick"}
}
bind msg n|- unjupe unjupe
proc unjupe {nick uhost hand args} {
global altnick keep-nick
if {${keep-nick} == 1} {set keep-nick 0 ; timer 5 "set keep-nick 1"}
putserv "nick $altnick"
}
IRC Snippets