Cacao7w7

Untitled

Jun 28th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. # May 2, 2015
  2.  
  3. # http://forum.egghelp.org/viewtopic.php?p=103991#103991
  4.  
  5.  
  6. set canal_admin "#morsbots"
  7. set canal_radio "#morsbots"
  8.  
  9.  
  10. bind pub * !request ver_chan
  11. bind msgm - * info:channel
  12.  
  13.  
  14. proc ver_chan {nick uhost hand chan text} {
  15. global canal_admin canal_djs canal_radio
  16. if {[llength $text] != 1} { putmsg $canal_radio "canal invalido XD"; return }
  17.  
  18. set canal [lindex [split $text] 0]
  19. ##Send your query to the bot CHaN by the channel info.
  20. putserv "PRIVMSG chan :info $canal"
  21. }
  22.  
  23.  
  24. proc info:channel {nick CHaN!-@- hand text} {
  25. global canal_admin
  26.  
  27. if {[lindex [split $text] 0] eq "Registrado:"} {
  28. putserv "privmsg $canal_admin :Registrado is: $text"
  29.  
  30. set reg_date [lindex [split $text] 2]
  31.  
  32. putserv "privmsg $canal_admin :reg_date is: $reg_date"
  33.  
  34. putserv "privmsg $canal_admin :Reg days old is: [duration [expr [unixtime] - [clock scan $reg_date -format {%d/%b/%­Y} -locale ES] ]]"
  35.  
  36. set reg_date_unixtime [clock scan $reg_date -format {%d/%b/%­Y} -locale ES]
  37.  
  38. putserv "privmsg $canal_admin :10 days ago was :[clock format [clock add [clock seconds] -10 day] -locale ES]"
  39.  
  40. set 10_days_ago_unixtime [clock add [clock seconds] -10 day -local ES ]
  41.  
  42. if {$10_days_ago_unixtime > $reg_date_unixtime} {
  43. putserv "privmsg $canal_admin :Channel has been registered more than 10 days"
  44. } else {
  45. putserv "privmsg $canal_admin :Channel has been registered less than 10 days"
  46. }
  47.  
  48. }
  49.  
  50. return 0
  51. }
  52.  
  53. bind pub n|n !go pub:go
  54. set canal_admin "#bots_ops"
  55. set canal_radio "#bots"
  56.  
  57.  
  58. proc pub:go {nick host hand chan text} {
  59. global canal_admin
  60. if { $chan != $canal_admin} { return 0 }
  61. set newchan [lindex [split $text] 0]
  62. if {$newchan == ""} {
  63. putmsg $canal_admin "$nick, Enter channel."
  64. return 0
  65. }
  66. if {![validchan "$newchan"]} {
  67. ##Add channel and join###
  68. channel add $newchan
  69. putquick "PRIVMSG $canal_admin :$nick Ok, join $newchan ..."
  70. set count 0
  71. ##Counting users $newchan###
  72. foreach users [chanlist $newchan] {
  73. ####For debuggin purpose###
  74. putquick "PRIVMSG $canal_admin :counting $newchan users..."
  75. incr count
  76. }
  77. ##HERE $count not take value, is always a blank##
  78. if {$count >= 10 } {
  79. putquick "PRIVMSG $newchan :channel accepted, I came to stay :\)"
  80. putquick "PRIVMSG $canal_admin : \0032$newchan was verified and accepted has $count users.."
  81. return 0
  82. } else {
  83. channel remove $newchan
  84. putquick "PRIVMSG $canal_admin :\0032$newchan was verified and NOT accepted has $count users.."
  85. return 0 }
  86. } else {
  87. putquick "PRIVMSG $canal_admin : \002$newchan\002 has already been verified and is in my database.! "
  88. return 0
  89. }
  90. }
Add Comment
Please, Sign In to add comment