Advertisement
Ford

channel info tcl / dalnet edit

Feb 8th, 2013
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 4.34 KB | None | 0 0
  1. ##############################################################################################
  2. ##  ##  channelinfo.tcl for eggdrop by Ford_Lawnmower irc.geekshed.net #Script-Help     ##  ##
  3. ##############################################################################################
  4. ## To use this script you must set channel flag +cinfo (ie .chanset #chan +cinfo)           ##
  5. ##############################################################################################
  6. ##      ____                __                 ###########################################  ##
  7. ##     / __/___ _ ___ _ ___/ /____ ___   ___   ###########################################  ##
  8. ##    / _/ / _ `// _ `// _  // __// _ \ / _ \  ###########################################  ##
  9. ##   /___/ \_, / \_, / \_,_//_/   \___// .__/  ###########################################  ##
  10. ##        /___/ /___/                 /_/      ###########################################  ##
  11. ##                                             ###########################################  ##
  12. ##############################################################################################
  13. ##  ##                             Start Setup.                                         ##  ##
  14. ##############################################################################################
  15. namespace eval channelinfo {
  16. ## change cmdchar to the trigger you want to use                                        ##  ##
  17.   variable cmdchar "!"
  18. ## change command to the word trigger you would like to use.                            ##  ##
  19. ## Keep in mind, This will also change the .chanset +/-command                          ##  ##
  20.   variable command "info"
  21. ## change textf to the colors you want for the text.                                    ##  ##
  22.   variable textf "\017\00304"
  23. ## change tagf to the colors you want for tags:                                         ##  ##  
  24.   variable tagf "\017\002"
  25. ## Change logo to the logo you want at the start of the line.                           ##  ##  
  26.   variable logo "\017\00314\002C\00304hannel \00314I\00304nfo\00314:\017"
  27. ## Change lineout to the results you want. Valid results are channel users modes topic  ##  ##
  28.   variable lineout "channel users modes topic"
  29. ##############################################################################################
  30. ##  ##                           End Setup.                                              ## ##
  31. ##############################################################################################  
  32.   variable channel ""
  33.   setudef flag $channelinfo::command
  34.   bind pub -|- [string trimleft $channelinfo::cmdchar]${channelinfo::command} channelinfo::list
  35.   bind raw -|- "322" channelinfo::main
  36. }
  37. proc channelinfo::main {from key text} {
  38.  
  39.   if {[regexp -- {(#.*?)\s(.*?)\s:\[(.*?)\]\s(.*)$} $text fullmatch channel users modes topic]} {
  40.     set channel "${channelinfo::tagf}Channel: ${channelinfo::textf}${channel}"
  41.     set users "${channelinfo::tagf}Users: ${channelinfo::textf}${users}"
  42.     set modes "${channelinfo::tagf}Modes: ${channelinfo::textf}${modes}"
  43.     set topic "${channelinfo::tagf}Topic: ${channelinfo::textf}[encoding convertto utf-8 ${topic}]"
  44.     putserv "PRIVMSG $channelinfo::channel :$channelinfo::logo $channelinfo::textf [subst [regsub -all -nocase {(\S+)} $channelinfo::lineout {$\1}]]"
  45.   } elseif {[regexp -- {(#.*?)\s(.*?)\s:(.*)$} $text fullmatch channel users topic]} {
  46.     set modes ""
  47.     set channel "${channelinfo::tagf}Channel: ${channelinfo::textf}${channel}"
  48.     set users "${channelinfo::tagf}Users: ${channelinfo::textf}${users}"
  49.     set topic "${channelinfo::tagf}Topic: ${channelinfo::textf}[encoding convertto utf-8 ${topic}]"
  50.     putserv "PRIVMSG $channelinfo::channel :$channelinfo::logo $channelinfo::textf [subst [regsub -all -nocase {(\S+)} $channelinfo::lineout {$\1}]]"
  51.   }
  52.   #QuadraZuadra #mIRC 36 :mIRC Help Channel - Latest version: mIRC v7.29 get it and the FAQ at www.mirc.com/get.html
  53. }
  54. proc channelinfo::list {nick host hand chan text} {
  55.   if {[lsearch -exact [channel info $chan] "+${channelinfo::command}"] != -1} {
  56.     namespace eval channelinfo {
  57.       variable channel ""
  58.     }
  59.     variable channelinfo::channel $chan
  60.     putserv "LIST #[string trimleft $text "#"]"
  61.   }
  62. }
  63. putlog "\002*Loaded* \017\00314\002C\00304hannel \00314I\00304nfo\00314:\017 \002by \
  64. Ford_Lawnmower irc.GeekShed.net #Script-Help"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement