Code: Select all
proc chk:restart {} {
global uptime
if {[expr $uptime + 60] > [unixtime]} {
[b]BOT WAS RESTARTED - put code here[/b]
}
}
chk:restart
Code: Select all
proc chk:restart {} {
global uptime
if {[expr $uptime + 60] > [unixtime]} {
.linkchan #clan-klyt ETG irc.enterthegame.com 6667
#ANOTHER command
#Yet another command
}
}
chk:restart
Code: Select all
proc linkchan {idx arg} {
global debug nick chanlinkchan chanlinknet chanlinknick username realname linkchantrim
if {$debug == 1} {putlog "linkchan< $arg"}
set arg2 [lindex $arg 0]
switch $arg2 {
PING {putlc "PONG [lindex $arg 1]"}
ERROR {
putserv "PRIVMSG $chanlinkchan :[1code]
proc linkchan {idx arg} {
global debug nick chanlinkchan chanlinknet chanlinknick username realname linkchantrim
if {$debug == 1} {putlog "linkchan< $arg"}
set arg2 [lindex $arg 0]
switch $arg2 {
PING {putlc "PONG [lindex $arg 1]"}
ERROR {
putserv "PRIVMSG $chanlinkchan :032ERROR: Closing Link"
linkchan:shutdown
}
}
switch [lindex $arg 1] {
001 {
putlc "MODE $chanlinknick :+i"
putlc "JOIN $chanlinkchan"
}
433 {
set chanlinknick $nick[rand 1000]
putdcc $idx "NICK :$chanlinknick"
}
353 {puthelp "privmsg $chanlinkchan :$chanlinknet NAMES list: [string trimleft [string trimleft [string trimleft $arg :] "abcdefghijklmnopqrstuvwxyzABCDEFGHIJGKLMNOPQRSTUVWXYZ1234567890 !@*.#~-_|[]{}`="] :]"}
JOIN {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has joined $chanlinkchan"}
KICK {linkchan:kick $idx $arg}
NICK {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet in now known as [string trimleft [lindex $arg 2] :]@$chanlinknet"}
PART {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has left $chanlinkchan"}
PRIVMSG {linkchan:privmsg $idx $arg}
QUIT {puthelp "privmsg $chanlinkchan :032*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) Quit ([string trimleft [string trimleft [string trimleft $arg :] $linkchantrim] :])"}
}
}
[/code1]032ERROR: Closing Link"
linkchan:shutdown
}
}
switch [lindex $arg 1] {
001 {
putlc "MODE $chanlinknick :+i"
putlc "JOIN $chanlinkchan"
}
433 {
set chanlinknick $nick[rand 1000]
putdcc $idx "NICK :$chanlinknick"
}
353 {puthelp "privmsg $chanlinkchan :$chanlinknet NAMES list: [string trimleft [string trimleft [string trimleft $arg :] "abcdefghijklmnopqrstuvwxyzABCDEFGHIJGKLMNOPQRSTUVWXYZ1234567890 !@*.#~-_|[]{}`="] :]"}
JOIN {puthelp "privmsg $chanlinkchan :[1code]
proc linkchan {idx arg} {
global debug nick chanlinkchan chanlinknet chanlinknick username realname linkchantrim
if {$debug == 1} {putlog "linkchan< $arg"}
set arg2 [lindex $arg 0]
switch $arg2 {
PING {putlc "PONG [lindex $arg 1]"}
ERROR {
putserv "PRIVMSG $chanlinkchan :032ERROR: Closing Link"
linkchan:shutdown
}
}
switch [lindex $arg 1] {
001 {
putlc "MODE $chanlinknick :+i"
putlc "JOIN $chanlinkchan"
}
433 {
set chanlinknick $nick[rand 1000]
putdcc $idx "NICK :$chanlinknick"
}
353 {puthelp "privmsg $chanlinkchan :$chanlinknet NAMES list: [string trimleft [string trimleft [string trimleft $arg :] "abcdefghijklmnopqrstuvwxyzABCDEFGHIJGKLMNOPQRSTUVWXYZ1234567890 !@*.#~-_|[]{}`="] :]"}
JOIN {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has joined $chanlinkchan"}
KICK {linkchan:kick $idx $arg}
NICK {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet in now known as [string trimleft [lindex $arg 2] :]@$chanlinknet"}
PART {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has left $chanlinkchan"}
PRIVMSG {linkchan:privmsg $idx $arg}
QUIT {puthelp "privmsg $chanlinkchan :032*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) Quit ([string trimleft [string trimleft [string trimleft $arg :] $linkchantrim] :])"}
}
}
[/code1]033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has joined $chanlinkchan"}
KICK {linkchan:kick $idx $arg}
NICK {puthelp "privmsg $chanlinkchan :[1code]
proc linkchan {idx arg} {
global debug nick chanlinkchan chanlinknet chanlinknick username realname linkchantrim
if {$debug == 1} {putlog "linkchan< $arg"}
set arg2 [lindex $arg 0]
switch $arg2 {
PING {putlc "PONG [lindex $arg 1]"}
ERROR {
putserv "PRIVMSG $chanlinkchan :032ERROR: Closing Link"
linkchan:shutdown
}
}
switch [lindex $arg 1] {
001 {
putlc "MODE $chanlinknick :+i"
putlc "JOIN $chanlinkchan"
}
433 {
set chanlinknick $nick[rand 1000]
putdcc $idx "NICK :$chanlinknick"
}
353 {puthelp "privmsg $chanlinkchan :$chanlinknet NAMES list: [string trimleft [string trimleft [string trimleft $arg :] "abcdefghijklmnopqrstuvwxyzABCDEFGHIJGKLMNOPQRSTUVWXYZ1234567890 !@*.#~-_|[]{}`="] :]"}
JOIN {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has joined $chanlinkchan"}
KICK {linkchan:kick $idx $arg}
NICK {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet in now known as [string trimleft [lindex $arg 2] :]@$chanlinknet"}
PART {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has left $chanlinkchan"}
PRIVMSG {linkchan:privmsg $idx $arg}
QUIT {puthelp "privmsg $chanlinkchan :032*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) Quit ([string trimleft [string trimleft [string trimleft $arg :] $linkchantrim] :])"}
}
}
[/code1]033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet in now known as [string trimleft [lindex $arg 2] :]@$chanlinknet"}
PART {puthelp "privmsg $chanlinkchan :[1code]
proc linkchan {idx arg} {
global debug nick chanlinkchan chanlinknet chanlinknick username realname linkchantrim
if {$debug == 1} {putlog "linkchan< $arg"}
set arg2 [lindex $arg 0]
switch $arg2 {
PING {putlc "PONG [lindex $arg 1]"}
ERROR {
putserv "PRIVMSG $chanlinkchan :032ERROR: Closing Link"
linkchan:shutdown
}
}
switch [lindex $arg 1] {
001 {
putlc "MODE $chanlinknick :+i"
putlc "JOIN $chanlinkchan"
}
433 {
set chanlinknick $nick[rand 1000]
putdcc $idx "NICK :$chanlinknick"
}
353 {puthelp "privmsg $chanlinkchan :$chanlinknet NAMES list: [string trimleft [string trimleft [string trimleft $arg :] "abcdefghijklmnopqrstuvwxyzABCDEFGHIJGKLMNOPQRSTUVWXYZ1234567890 !@*.#~-_|[]{}`="] :]"}
JOIN {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has joined $chanlinkchan"}
KICK {linkchan:kick $idx $arg}
NICK {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet in now known as [string trimleft [lindex $arg 2] :]@$chanlinknet"}
PART {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has left $chanlinkchan"}
PRIVMSG {linkchan:privmsg $idx $arg}
QUIT {puthelp "privmsg $chanlinkchan :032*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) Quit ([string trimleft [string trimleft [string trimleft $arg :] $linkchantrim] :])"}
}
}
[/code1]033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has left $chanlinkchan"}
PRIVMSG {linkchan:privmsg $idx $arg}
QUIT {puthelp "privmsg $chanlinkchan :[1code]
proc linkchan {idx arg} {
global debug nick chanlinkchan chanlinknet chanlinknick username realname linkchantrim
if {$debug == 1} {putlog "linkchan< $arg"}
set arg2 [lindex $arg 0]
switch $arg2 {
PING {putlc "PONG [lindex $arg 1]"}
ERROR {
putserv "PRIVMSG $chanlinkchan :032ERROR: Closing Link"
linkchan:shutdown
}
}
switch [lindex $arg 1] {
001 {
putlc "MODE $chanlinknick :+i"
putlc "JOIN $chanlinkchan"
}
433 {
set chanlinknick $nick[rand 1000]
putdcc $idx "NICK :$chanlinknick"
}
353 {puthelp "privmsg $chanlinkchan :$chanlinknet NAMES list: [string trimleft [string trimleft [string trimleft $arg :] "abcdefghijklmnopqrstuvwxyzABCDEFGHIJGKLMNOPQRSTUVWXYZ1234567890 !@*.#~-_|[]{}`="] :]"}
JOIN {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has joined $chanlinkchan"}
KICK {linkchan:kick $idx $arg}
NICK {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet in now known as [string trimleft [lindex $arg 2] :]@$chanlinknet"}
PART {puthelp "privmsg $chanlinkchan :033*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) has left $chanlinkchan"}
PRIVMSG {linkchan:privmsg $idx $arg}
QUIT {puthelp "privmsg $chanlinkchan :032*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) Quit ([string trimleft [string trimleft [string trimleft $arg :] $linkchantrim] :])"}
}
}
[/code1]032*** [lindex [split [lindex [split $arg2 !] 0] :] 1]@$chanlinknet ([lindex [split $arg2 !] 1]) Quit ([string trimleft [string trimleft [string trimleft $arg :] $linkchantrim] :])"}
}
}
Code: Select all
proc chk:restart {} {
global uptime
if {[expr $uptime + 60] > [unixtime]} {
dcc:linkchan 0 0 {#clan-klyt ETG irc.enterthegame.com 6667}
#ANOTHER command
#Yet another command
}
}
chk:restart
proc need:netsplit {args} {
chk:restart
}
bind EVNT - "init-server" need:netsplit