Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # May 2, 2015
- # http://forum.egghelp.org/viewtopic.php?p=103991#103991
- set canal_admin "#morsbots"
- set canal_radio "#morsbots"
- bind pub * !request ver_chan
- bind msgm - * info:channel
- proc ver_chan {nick uhost hand chan text} {
- global canal_admin canal_djs canal_radio
- if {[llength $text] != 1} { putmsg $canal_radio "canal invalido XD"; return }
- set canal [lindex [split $text] 0]
- ##Send your query to the bot CHaN by the channel info.
- putserv "PRIVMSG chan :info $canal"
- }
- proc info:channel {nick CHaN!-@- hand text} {
- global canal_admin
- if {[lindex [split $text] 0] eq "Registrado:"} {
- putserv "privmsg $canal_admin :Registrado is: $text"
- set reg_date [lindex [split $text] 2]
- putserv "privmsg $canal_admin :reg_date is: $reg_date"
- putserv "privmsg $canal_admin :Reg days old is: [duration [expr [unixtime] - [clock scan $reg_date -format {%d/%b/%Y} -locale ES] ]]"
- set reg_date_unixtime [clock scan $reg_date -format {%d/%b/%Y} -locale ES]
- putserv "privmsg $canal_admin :10 days ago was :[clock format [clock add [clock seconds] -10 day] -locale ES]"
- set 10_days_ago_unixtime [clock add [clock seconds] -10 day -local ES ]
- if {$10_days_ago_unixtime > $reg_date_unixtime} {
- putserv "privmsg $canal_admin :Channel has been registered more than 10 days"
- } else {
- putserv "privmsg $canal_admin :Channel has been registered less than 10 days"
- }
- }
- return 0
- }
- bind pub n|n !go pub:go
- set canal_admin "#bots_ops"
- set canal_radio "#bots"
- proc pub:go {nick host hand chan text} {
- global canal_admin
- if { $chan != $canal_admin} { return 0 }
- set newchan [lindex [split $text] 0]
- if {$newchan == ""} {
- putmsg $canal_admin "$nick, Enter channel."
- return 0
- }
- if {![validchan "$newchan"]} {
- ##Add channel and join###
- channel add $newchan
- putquick "PRIVMSG $canal_admin :$nick Ok, join $newchan ..."
- set count 0
- ##Counting users $newchan###
- foreach users [chanlist $newchan] {
- ####For debuggin purpose###
- putquick "PRIVMSG $canal_admin :counting $newchan users..."
- incr count
- }
- ##HERE $count not take value, is always a blank##
- if {$count >= 10 } {
- putquick "PRIVMSG $newchan :channel accepted, I came to stay :\)"
- putquick "PRIVMSG $canal_admin : \0032$newchan was verified and accepted has $count users.."
- return 0
- } else {
- channel remove $newchan
- putquick "PRIVMSG $canal_admin :\0032$newchan was verified and NOT accepted has $count users.."
- return 0 }
- } else {
- putquick "PRIVMSG $canal_admin : \002$newchan\002 has already been verified and is in my database.! "
- return 0
- }
- }
Add Comment
Please, Sign In to add comment