Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Paste Description for troll.tcl version 2.1

troll.tcl v2.1 by spithash@DALnet #CodeMasters

troll.tcl version 2.1
Thursday, May 3rd, 2012 at 6:45:29am MDT 

  1. #############################################################################################################
  2. # Troll v2.1 TCL by spithash@DALnet                                                                         #
  3. #############################################################################################################
  4. # Gets troll quotes and makes people suffer!                                                                #
  5. #############################################################################################################
  6. #                                                                                                            #
  7. # Version 2.1   (20.03.2012)                                                                                       #
  8. #                                                                                                            #
  9. # Added flood protection. More like, throttle control. Special thanks to username.                 #
  10. #                                                                                                           #
  11. # Any official release of troll.tcl will be announced in http://forum.egghelp.org/viewtopic.php?t=17078     #
  12. # Official troll.tcl updates will be in egghelp.org's TCL archive,                                          #
  13. # Or here: http://bsdunix.info/spithash/troll/troll.tcl                                                     #
  14. #############################################################################################################
  15. # Version 2.0                                                     #
  16. #                                                                                                            #
  17. # Version 2.0 is way different since there's no database in the file. It fetches the quotes by a website.   #
  18. # Also, you can ".chanset #channel +troll" to enable it.                                                    #
  19. # I added this just in case you don't want your trolls to be available globally.                            #
  20. #                                                                                                            #
  21. # (Keep it to "puthelp" cause I didn't add any flood protection yet,                                        #
  22. # and it may cause your bot "Excess Flood" quit if it's in "putserv" or "putquick",                         #
  23. # if someone floods the !troll trigger or if the troll quote is too long.)                                  #
  24. #############################################################################################################
  25. # Credits: special thanks to: username, speechles and arfer who helped me with this :)                      #
  26. #############################################################################################################
  27.  
  28. # Channel flag.
  29. setudef flag troll
  30.  
  31. # Set the time (in seconds) between commands.
  32. set delay 10
  33.  
  34. bind pub - !troll parse
  35.  
  36. proc parse {nick uhost hand chan text} {
  37. global delay
  38. variable troll
  39. if {![channel get $chan troll]} {
  40.     return 0
  41. }
  42. if {[info exists troll(lasttime,$chan)] && [expr $troll(lasttime,$chan) + $delay] > [clock seconds]} {
  43.     putserv "NOTICE $nick :You can use only 1 command in $delay seconds. Wait [expr $delay - [expr [clock seconds] - $troll(lasttime,$chan)]] seconds and try again, nigga."
  44.     return 0
  45. }
  46.  
  47. ::http::config -urlencoding utf-8 -useragent "Mozilla/5.0 (X11; U; Linux i686; el-GR; rv:1.8.1) Gecko/2010112223 Firefox/3.6.12"
  48. set url [::http::geturl "http://rolloffle.churchburning.org/troll_me.php" -timeout 15000]
  49. set data [::http::data $url]
  50. ::http::cleanup $url
  51.  
  52. regsub -all -- {\n} $data "" data;
  53. regexp -nocase -- {<p .*?>(.*?)</p>} $data -> info
  54. regsub -all -- {(<strong[^>]*>)|(</strong>)} $info "\002" info;
  55.  
  56. while {$info != ""} {
  57.     putserv "PRIVMSG $chan :[string range $info 0 419]"
  58.     set info [string range $info 420 end]
  59. }
  60. set troll(lasttime,$chan) [clock seconds]
  61.  
  62. }
  63.  
  64. putlog "\002troll.tcl\002 v2.1 by spithash@DALnet iz up and trollin'"
  65. # EOF

Paste Details

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

fantasy-obligation
fantasy-obligation