Advertisement
Guest User

Untitled

a guest
Jun 29th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.36 KB | None | 0 0
  1. # $Id: activechatter.tcl, v3.80.b eggdrop-1.6.18 23/02/2009 10:11:56 Exp $
  2.  
  3. # Begin - Active Chatter v3.80.b [activechatter.tcl]
  4. # Build date: 6th August 2007
  5. # Last Modified: 23rd February 2009
  6. # Copyright © 1998-2009 awyeah (awesomeawyeah@gmail.com)
  7. # This TCL script is designed to work with eggdrop v1.6.17 or higher
  8.  
  9. #########################################################################
  10. # Active Chatter 3.80.b #
  11. # #
  12. # #
  13. # Author: awyeah 23rd February 2009 #
  14. # Email: awesomeawyeah@gmail.com Build version 3.80.b #
  15. #########################################################################
  16. # #
  17. # ########### #
  18. # DESCRIPTION #
  19. # ########### #
  20. # #
  21. # This script voices users who have said a certain number of lines on a #
  22. # channel (active chatters). Additionally, it devoices users who are #
  23. # idling for more than a certain amount of time on a channel (unactive #
  24. # chatters). #
  25. # #
  26. #########################################################################
  27. # #
  28. # ############ #
  29. # REQUIREMENTS #
  30. # ############ #
  31. # #
  32. # The following requirements must be taken into consideration before #
  33. # utilizing this script further: #
  34. # #
  35. # (Fields marked with a '*' are compulsory requirements) #
  36. # #
  37. # (*) (1) You must be running EGGDROP v1.6.17 or higher. #
  38. # (*) (2) You must have TCL v8.4 or higher installed on the system. #
  39. # #
  40. # To FIND the TCL VERSION and PATCH LEVEL your shell is running: #
  41. # (1) At your shell prompt type: tclsh #
  42. # (a) If you have several different versions of tcl installed #
  43. # on the system, pick the latest version. E.g: tclsh8.3, #
  44. # tclsh8.4 which is installed from the given list. #
  45. # (i) At shell prompt type: tclsh8.4 (and go to step 2) #
  46. # (b) If you have only one version, pick that one or continue #
  47. # with 'tclsh' only if it doesn't say to use another name. #
  48. # (2) To find your tcl version type: info tclversion #
  49. # (3) To exit tclsh, type: exit #
  50. # #
  51. #########################################################################
  52. # #
  53. # ############ #
  54. # INSTALLATION #
  55. # ############ #
  56. # #
  57. # This quick installation tutorial consists of 4 steps. Please follow #
  58. # all steps correctly in order to setup your script. #
  59. # #
  60. # (1) Upload the file activechatter.tcl in your eggdrop '/scripts' #
  61. # folder along with your other scripts. #
  62. # #
  63. # (2) OPEN your eggdrops configuration (.conf) file and add a link at #
  64. # the bottom of the configuration file to the path of drone nick #
  65. # remover script, it would be: #
  66. # #
  67. # source scripts/activechatter.tcl #
  68. # #
  69. # #
  70. # (3) SAVE your bots configuration file. #
  71. # #
  72. # (4) REHASH and RESTART your bot. #
  73. # #
  74. #########################################################################
  75. # #
  76. # ######## #
  77. # VERSIONS #
  78. # ######## #
  79. # #
  80. # v3.80.b - Fixed bugs reported by users thanks to "speechless" from #
  81. # (04/02/09) the egghelp forum. #
  82. # - Fixed a bug in the autovoice:users and #
  83. # autovoice:devoice:idlers procedure for $nickchan. #
  84. # - Fixed declaration of $chan in autovoice:devoice:idlers #
  85. # procedure. #
  86. # - Added configuration settings to set user specific mode #
  87. # settings for displaying active and idle chatters. #
  88. # #
  89. # v3.66.b - Fixed some bugs and errors reported. #
  90. # (20/09/07) #
  91. # #
  92. # v3.47.b - First public release. #
  93. # (07/08/07) #
  94. # #
  95. #########################################################################
  96. # #
  97. # ######## #
  98. # CONTACTS #
  99. # ######## #
  100. # #
  101. # (*) For any suggestions, comments, questions or bugs reports, feel #
  102. # free to email me at: #
  103. # #
  104. # awesomeawyeah@gmail.com #
  105. # #
  106. # #
  107. # (*) You can also contact me on MSN Messenger - my messenger ID is: #
  108. # #
  109. # awyeah@awyeah.org #
  110. # #
  111. # #
  112. # (*) You can also catch me on The DALnet Network: #
  113. # #
  114. # /server irc.dal.net:6667, Nick: awyeah #
  115. # Channels: #awyeah, #eggdrops #
  116. # #
  117. #########################################################################
  118. # #
  119. # ######### #
  120. # COPYRIGHT #
  121. # ######### #
  122. # #
  123. # This program is a free software; you can distribute it under the #
  124. # terms of the GNU General Public License under Section 1 as published #
  125. # by the Free Software Foundation; either version 2 of the license, or #
  126. # (at your option) any later version. #
  127. # #
  128. # This program is distributed in the hope that it will be useful, #
  129. # but WITHOUT ANY WARRANTY; without even the implied warranty of #
  130. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  131. # GNU General Public License for more details. #
  132. # #
  133. # WARNING: #
  134. # This program is protected by copyright law and international #
  135. # treaties. Unauthorized reproduction of this program, or any portion #
  136. # of it, may result in severe civil penalties and will be prosecuted to #
  137. # the maximum extent possible under the law. #
  138. # #
  139. #########################################################################
  140. # #
  141. # ######### #
  142. # DOWNLOADS #
  143. # ######### #
  144. # #
  145. # Latest versions of this script can be found on the TCL archives of #
  146. # the following websites: #
  147. # #
  148. # 1) http://www.egghelp.org/ #
  149. # 2) http://www.tclscript.com/ #
  150. # 3) http://channels.dal.net/awyeah/ #
  151. # #
  152. #########################################################################
  153.  
  154.  
  155. ##############################################
  156. ### Start configuring variables from here! ###
  157. ##############################################
  158.  
  159. #Set the channels you would like this script to work on.
  160. #USAGE: [1/2] (1=User defined channels, 2=All channels the bot is on)
  161. set autovoice(chantype) "2"
  162.  
  163.  
  164. ### SET THIS ONLY IF YOU HAVE SET THE PREVIOUS SETTING TO '1' ###
  165. #Set the channels below on which this script should work. Each channel
  166. #must separated by a space in between to create a list-like structure.
  167. #USAGE: set autovoice(channels) "#channel1 #channel2 #mychannel"
  168. set autovoice(chans) "#Sex"
  169.  
  170.  
  171. #Set the 'number of lines' here after which a user will be voiced for being
  172. #an ACTIVE CHATTER. Only channel messages will be counted for activity.
  173. set autovoice(lines) "2"
  174.  
  175.  
  176. #Set the time here in 'minutes' after which you would like to devoice idlers (UNACTIVE
  177. #CHATTERs). Users idling for more than this number of minute(s) will be devoiced.
  178. ######################################################################################
  179. #If you wish yo disable this setting, set it to: "0"
  180. #USAGE: Any numerical integer value.
  181. set autovoice(dvtime) "60"
  182.  
  183.  
  184. ### SET THIS ONLY IF YOU HAVE ENABLED (UNACTIVE CHATTER) DEVOICING FOR IDLERS ###
  185. #Set the time here in 'minutes' after which you would continuously like to check
  186. #channel voices for idling. It is better to set this value low for good accuracy.
  187. #USAGE: Any numerical integer value.
  188. set autovoice(dvcheck) "10"
  189.  
  190.  
  191. ### ACTIVE-CHATTER (VOICE) EXEMPT NICKS ###
  192. #Set the list of nicks here which you would like to be exempted from being
  193. #autovoiced by the script. Place separate each entry by placing it in a new line.
  194. ##################################################################################
  195. #If you do not have any nick to exempt, then: set autovoice(avexempt) {}
  196. set autovoice(avexempt) {}
  197.  
  198.  
  199. ### UNACTIVE-CHATTER (DEVOICE) EXEMPT NICKS ###
  200. #Set the list of nicks here which you would like to be exempted from being
  201. #devoiced by the script. Place separate each entry by placing it in a new line.
  202. ################################################################################
  203. #If you do not have any nick to exempt, then: set autovoice(dvexempt) {}
  204. set autovoice(dvexempt) {
  205. SeenNick:#Sex
  206. }
  207.  
  208.  
  209. ### SET THE TEXT TO DISPLAY IN THE +V (VOICING) MODE ###
  210. #Set the text to display while voicing the active chatters. This text will be
  211. #displayed when removing the channel key (mode: -k). Control codes such as
  212. #color/bold/underline/reverses can also be used in the string.
  213. #Please see: http://tclhelp.net/#faqcolor for more information on control codes.
  214. ################################################################################
  215. set autovoice(voicemode) "\0032Active.\00312chatter"
  216.  
  217.  
  218. ### SET THE TEXT TO DISPLAY IN THE -V (DE-VOICING) MODE ###
  219. #Set the text to display while devoicing the idle chatters. This text will be
  220. #displayed when removing the channel key (mode: -k). Control codes such as
  221. #color/bold/underline/reverses can also be used in the string.
  222. #Please see: http://tclhelp.net/#faqcolor for more information on control codes.
  223. ################################################################################
  224. set autovoice(devoicemode) "\0032Unactive.\00312chatter"
  225.  
  226.  
  227.  
  228. #############################################################
  229. ### Congratulations! Script configuration is now complete ###
  230. #############################################################
  231.  
  232.  
  233. ##############################################################################
  234. ### Don't edit anything else from this point onwards even if you know tcl! ###
  235. ##############################################################################
  236.  
  237. set autovoice(auth) "\x61\x77\x79\x65\x61\x68"
  238. set autovoice(ver) "v3.80.b"
  239.  
  240. bind pubm - "*" autovoice:users
  241. bind join - "*" autovoice:erase:record
  242. if {$autovoice(dvtime) > 0} {bind time - "*" autovoice:devoice:idlers}
  243.  
  244. proc autovoice:users {nick uhost hand chan text} {
  245. global autovoice voice
  246. if {($autovoice(chantype) == 1) && ([lsearch -exact [split [string tolower $autovoice(chans)]] [string tolower $chan]] == -1)} { return 0 }
  247. if {[isbotnick $nick] || [isop $nick $chan] || [isvoice $nick $chan]} { return 0 }
  248. set exemptlist [list]
  249. foreach nickchan $autovoice(avexempt) {
  250. lappend exemptlist $nickchan
  251. }
  252. if {[llength $exemptlist] > 0} {
  253. foreach nickchan $exemptlist {
  254. if {[string equal -nocase $nickchan $nick] || ([string equal -nocase [lindex [split $nickchan :] 0] $nick] && [string equal -nocase [lindex [split $nickchan :] 1] $chan])} {
  255. return 0
  256. }
  257. }
  258. }
  259. set user [split [string tolower $nick:$chan]]
  260. if {![info exists voice($user)] && ![isvoice $nick $chan] && ![isop $nick $chan]} {
  261. set voice($user) 0
  262. } elseif {[info exists voice($user)] && ([expr $voice($user) + 1] >= $autovoice(lines)) && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  263. utimer 3 [list autovoice:delay $nick $chan]
  264. unset voice($user)
  265. } elseif {[info exists voice($user)]} {
  266. incr voice($user)
  267. }
  268. }
  269.  
  270. proc autovoice:delay {nick chan} {
  271. global autovoice voice
  272. set user [split [string tolower $nick:$chan]]
  273. if {[botisop $chan] && [onchan $nick $chan] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  274. # pushmode $chan +v $nick
  275. putquick "privmsg $chan :$nick mnogo se razprikazva, vzemi tozi voice :D"
  276. putquick "mode $chan +v $nick"
  277. set voiced($user) 1
  278. }
  279. # if {[info exists voiced($user)]} {
  280. # pushmode $chan -k $autovoice(voicemode)
  281. # flushmode $chan
  282. # }
  283. }
  284.  
  285. proc autovoice:erase:record {nick uhost hand chan} {
  286. global autovoice voice
  287. if {($autovoice(chantype) == 1) && ([lsearch -exact [split [string tolower $autovoice(chans)]] [string tolower $chan]] == -1)} { return 0 }
  288. if {[isbotnick $nick]} { return 0 }
  289. set user [split [string tolower $nick:$chan]]
  290. if {[info exists voice($user)]} { unset voice($user) }
  291. }
  292.  
  293. proc autovoice:devoice:idlers {m h d mo y} {
  294. global autovoice voice
  295. if {([scan $m %d]+([scan $h %d]*60)) % $autovoice(dvcheck) == 0} {
  296. switch -exact $autovoice(chantype) {
  297. 1 { set chans [split $autovoice(chans)] }
  298. 2 { set chans [channels] }
  299. default { return 0 }
  300. }
  301. foreach chan $chans {
  302. set chan [string tolower $chan]
  303. foreach user [chanlist $chan] {
  304. set user [split [string tolower $user]]
  305. if {[info exists exempt]} { unset exempt }
  306. if {[botonchan $chan] && ![isbotnick $user] && ![isop $user $chan] && [isvoice $user $chan]} {
  307. set exemptlist [list]
  308. foreach nickchan $autovoice(dvexempt) {
  309. lappend exemptlist $nickchan
  310. }
  311. if {[llength $exemptlist] > 0} {
  312. foreach nickchan $exemptlist {
  313. if {[string equal -nocase $nickchan $user] || ([string equal -nocase [lindex [split $nickchan :] 0] $user] && [string equal -nocase [lindex [split $nickchan :] 1] $chan])} {
  314. set exempt 1; break
  315. }
  316. }
  317. }
  318. if {[botonchan $chan] && ![info exists exempt] && ([getchanidle $user $chan] >= $autovoice(dvtime))} {
  319. # pushmode $chan -v $user
  320. putquick "privmsg $chan :$user mnogo se omulcha, gubish voice :D"
  321. putquick "mode $chan -v $user"
  322. if {![info exists devoice($chan)]} {
  323. set devoice($chan) 1
  324. }
  325. } else {
  326. continue
  327. }
  328. } else {
  329. continue
  330. }
  331. }
  332. # if {[info exists devoice($chan)]} {
  333. # pushmode $chan -k $autovoice(devoicemode)
  334. # flushmode $chan
  335. # }
  336. }
  337. }
  338. }
  339.  
  340. #if {![string equal "\x61\x77\x79\x65\x61\x68" $autovoice(auth)]} { set autovoice(auth) \x61\x77\x79\x65\x61\x68 }
  341. putlog "Active Chatter has been loaded successfully."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement