##########################################################################
# Seen.tcl
# Za da raboti tcla za daden kanal to trqbva da set-nete chan flag seenserv
# s drugi dumi .chanset #kanala +seenserv ( na partyline )
# Kak da izprashta bota msg-tata?
# 1 - na private
# 2 - v kanala
# 3 - kato notice na nicka
# 4 - kato notice v kanala ( nepreporychitelno )
# Tova moje da go nastroite ot partyline s .chanset #kanala seen:meth 2
# seen.tcl e oshte v testove period , vyzmojni sa nqkoi bugove <img src="https://forum.egghelp.ru/images/smilies/icon_e_smile.gif" alt=":)" title="Smile" />
##########################################################################
# kakvi iskate da bydat msg-tata ?
# 1 - pokazva msg-ta na seenserv 1 kym 1 ( by default )
# 2 - pokazva msg-tata po razlichen nachin <img src="https://forum.egghelp.ru/images/smilies/icon_e_wink.gif" alt=";)" title="Wink" />)
set msgmeth 1
# nedei bara nadolu ako ne razbirash <img src="https://forum.egghelp.ru/images/smilies/icon_e_smile.gif" alt=":)" title="Smile" />
bind pub -|- seen serv:seen
bind msgm -|- "*is*currently*online*" success:seen
bind msgm -|- "*was*" offline:seen
bind msgm -|- "*sorry*have*recently*" nosucc:seen
setudef flag seenserv
setudef int seen:meth
proc msg:seen {nick chan msg} {
switch [channel get $chan seen:meth] {
1 { putquick "PRIVMSG $nick :$msg" }
2 { putquick "PRIVMSG $chan :$msg" }
3 { putquick "NOTICE $nick :$msg" }
4 { putquick "NOTICE $chan :$msg" }
default { putquick "PRIVMSG $chan :$msg" }
}
}
proc serv:seen {n u h c t} {
if { [channel get $c seenserv] } {
if {$t == ""} {
set msg "$n, a nick ?"
msg:seen $n $c $msg
return 0
}
if {[onchan [split $t] $c]} {
set msg "$n, [split $t] e v kanala, ogledai se <img src="https://forum.egghelp.ru/images/smilies/icon_e_smile.gif" alt=":)" title="Smile" />"
msg:seen $n $c $msg
return 0
}
putquick "PRIVMSG SeenServ :seen $t"
set ::schan "$c"
set ::rnick "$n"
}
}
proc success:seen {n u h t} {
if { $n == "SeenServ" } {
if {$::msgmeth == 1 } { set msg $t }
if {$::msgmeth == 2 } { set msg "[lindex [split $t] 0] [lindex $t 1] shtyka iz chata <img src="https://forum.egghelp.ru/images/smilies/icon_e_smile.gif" alt=":)" title="Smile" />"}
msg:seen $::rnick $::schan $msg
return 0
}
}
proc offline:seen {n u h t} {
if { $n == "SeenServ" } {
if {$::msgmeth == 1 } { set msg $t }
if {$::msgmeth == 2 } { regsub -nocase {ago} [lrange $t 6 end] "" koga;set msg "[lindex [split $t] 0] [lindex $t 1] mina prez chata predi $koga" }
msg:seen $::rnick $::schan $msg
return 0
}
}
proc nosucc:seen {n u h t} {
if { $n == "SeenServ" } {
if {$::msgmeth == 1 } { set msg $t }
if {$::msgmeth == 2 } { set msg "Nqmam informaciq , moje bi [lindex [chanlist $::schan] [rand [llength [chanlist $::schan]]]] znae neshto ?"}
msg:seen $::rnick $::schan $msg
return 0
}
}
# malko credits =)
putlog "seen.tcl 0.99 loaded
# Seen.tcl
# Za da raboti tcla za daden kanal to trqbva da set-nete chan flag seenserv
# s drugi dumi .chanset #kanala +seenserv ( na partyline )
# Kak da izprashta bota msg-tata?
# 1 - na private
# 2 - v kanala
# 3 - kato notice na nicka
# 4 - kato notice v kanala ( nepreporychitelno )
# Tova moje da go nastroite ot partyline s .chanset #kanala seen:meth 2
# seen.tcl e oshte v testove period , vyzmojni sa nqkoi bugove <img src="https://forum.egghelp.ru/images/smilies/icon_e_smile.gif" alt=":)" title="Smile" />
##########################################################################
# kakvi iskate da bydat msg-tata ?
# 1 - pokazva msg-ta na seenserv 1 kym 1 ( by default )
# 2 - pokazva msg-tata po razlichen nachin <img src="https://forum.egghelp.ru/images/smilies/icon_e_wink.gif" alt=";)" title="Wink" />)
set msgmeth 1
# nedei bara nadolu ako ne razbirash <img src="https://forum.egghelp.ru/images/smilies/icon_e_smile.gif" alt=":)" title="Smile" />
bind pub -|- seen serv:seen
bind msgm -|- "*is*currently*online*" success:seen
bind msgm -|- "*was*" offline:seen
bind msgm -|- "*sorry*have*recently*" nosucc:seen
setudef flag seenserv
setudef int seen:meth
proc msg:seen {nick chan msg} {
switch [channel get $chan seen:meth] {
1 { putquick "PRIVMSG $nick :$msg" }
2 { putquick "PRIVMSG $chan :$msg" }
3 { putquick "NOTICE $nick :$msg" }
4 { putquick "NOTICE $chan :$msg" }
default { putquick "PRIVMSG $chan :$msg" }
}
}
proc serv:seen {n u h c t} {
if { [channel get $c seenserv] } {
if {$t == ""} {
set msg "$n, a nick ?"
msg:seen $n $c $msg
return 0
}
if {[onchan [split $t] $c]} {
set msg "$n, [split $t] e v kanala, ogledai se <img src="https://forum.egghelp.ru/images/smilies/icon_e_smile.gif" alt=":)" title="Smile" />"
msg:seen $n $c $msg
return 0
}
putquick "PRIVMSG SeenServ :seen $t"
set ::schan "$c"
set ::rnick "$n"
}
}
proc success:seen {n u h t} {
if { $n == "SeenServ" } {
if {$::msgmeth == 1 } { set msg $t }
if {$::msgmeth == 2 } { set msg "[lindex [split $t] 0] [lindex $t 1] shtyka iz chata <img src="https://forum.egghelp.ru/images/smilies/icon_e_smile.gif" alt=":)" title="Smile" />"}
msg:seen $::rnick $::schan $msg
return 0
}
}
proc offline:seen {n u h t} {
if { $n == "SeenServ" } {
if {$::msgmeth == 1 } { set msg $t }
if {$::msgmeth == 2 } { regsub -nocase {ago} [lrange $t 6 end] "" koga;set msg "[lindex [split $t] 0] [lindex $t 1] mina prez chata predi $koga" }
msg:seen $::rnick $::schan $msg
return 0
}
}
proc nosucc:seen {n u h t} {
if { $n == "SeenServ" } {
if {$::msgmeth == 1 } { set msg $t }
if {$::msgmeth == 2 } { set msg "Nqmam informaciq , moje bi [lindex [chanlist $::schan] [rand [llength [chanlist $::schan]]]] znae neshto ?"}
msg:seen $::rnick $::schan $msg
return 0
}
}
# malko credits =)
putlog "seen.tcl 0.99 loaded