index.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CodeMirror: Tcl mode</title>
  6. <link rel="stylesheet" href="../../lib/codemirror.css">
  7. <script src="../../lib/codemirror.js"></script>
  8. <script src="tcl.js"></script>
  9. <link rel="stylesheet" href="../../theme/night.css">
  10. <link rel="stylesheet" href="../../doc/docs.css">
  11. </head>
  12. <body>
  13. <h1>CodeMirror: Tcl mode</h1>
  14. <form><textarea id="code" name="code">
  15. ##############################################################################################
  16. ## ## whois.tcl for eggdrop by Ford_Lawnmower irc.geekshed.net #Script-Help ## ##
  17. ##############################################################################################
  18. ## To use this script you must set channel flag +whois (ie .chanset #chan +whois) ##
  19. ##############################################################################################
  20. ## ____ __ ########################################### ##
  21. ## / __/___ _ ___ _ ___/ /____ ___ ___ ########################################### ##
  22. ## / _/ / _ `// _ `// _ // __// _ \ / _ \ ########################################### ##
  23. ## /___/ \_, / \_, / \_,_//_/ \___// .__/ ########################################### ##
  24. ## /___/ /___/ /_/ ########################################### ##
  25. ## ########################################### ##
  26. ##############################################################################################
  27. ## ## Start Setup. ## ##
  28. ##############################################################################################
  29. namespace eval whois {
  30. ## change cmdchar to the trigger you want to use ## ##
  31. variable cmdchar "!"
  32. ## change command to the word trigger you would like to use. ## ##
  33. ## Keep in mind, This will also change the .chanset +/-command ## ##
  34. variable command "whois"
  35. ## change textf to the colors you want for the text. ## ##
  36. variable textf "\017\00304"
  37. ## change tagf to the colors you want for tags: ## ##
  38. variable tagf "\017\002"
  39. ## Change logo to the logo you want at the start of the line. ## ##
  40. variable logo "\017\00304\002\[\00306W\003hois\00304\]\017"
  41. ## Change lineout to the results you want. Valid results are channel users modes topic ## ##
  42. variable lineout "channel users modes topic"
  43. ##############################################################################################
  44. ## ## End Setup. ## ##
  45. ##############################################################################################
  46. variable channel ""
  47. setudef flag $whois::command
  48. bind pub -|- [string trimleft $whois::cmdchar]${whois::command} whois::list
  49. bind raw -|- "311" whois::311
  50. bind raw -|- "312" whois::312
  51. bind raw -|- "319" whois::319
  52. bind raw -|- "317" whois::317
  53. bind raw -|- "313" whois::multi
  54. bind raw -|- "310" whois::multi
  55. bind raw -|- "335" whois::multi
  56. bind raw -|- "301" whois::301
  57. bind raw -|- "671" whois::multi
  58. bind raw -|- "320" whois::multi
  59. bind raw -|- "401" whois::multi
  60. bind raw -|- "318" whois::318
  61. bind raw -|- "307" whois::307
  62. }
  63. proc whois::311 {from key text} {
  64. if {[regexp -- {^[^\s]+\s(.+?)\s(.+?)\s(.+?)\s\*\s\:(.+)$} $text wholematch nick ident host realname]} {
  65. putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Host:${whois::textf} \
  66. $nick \(${ident}@${host}\) ${whois::tagf}Realname:${whois::textf} $realname"
  67. }
  68. }
  69. proc whois::multi {from key text} {
  70. if {[regexp {\:(.*)$} $text match $key]} {
  71. putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Note:${whois::textf} [subst $$key]"
  72. return 1
  73. }
  74. }
  75. proc whois::312 {from key text} {
  76. regexp {([^\s]+)\s\:} $text match server
  77. putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Server:${whois::textf} $server"
  78. }
  79. proc whois::319 {from key text} {
  80. if {[regexp {.+\:(.+)$} $text match channels]} {
  81. putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Channels:${whois::textf} $channels"
  82. }
  83. }
  84. proc whois::317 {from key text} {
  85. if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {
  86. putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Connected:${whois::textf} \
  87. [ctime $signon] ${whois::tagf}Idle:${whois::textf} [duration $idle]"
  88. }
  89. }
  90. proc whois::301 {from key text} {
  91. if {[regexp {^.+\s[^\s]+\s\:(.*)$} $text match awaymsg]} {
  92. putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Away:${whois::textf} $awaymsg"
  93. }
  94. }
  95. proc whois::318 {from key text} {
  96. namespace eval whois {
  97. variable channel ""
  98. }
  99. variable whois::channel ""
  100. }
  101. proc whois::307 {from key text} {
  102. putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Services:${whois::textf} Registered Nick"
  103. }
  104. proc whois::list {nick host hand chan text} {
  105. if {[lsearch -exact [channel info $chan] "+${whois::command}"] != -1} {
  106. namespace eval whois {
  107. variable channel ""
  108. }
  109. variable whois::channel $chan
  110. putserv "WHOIS $text"
  111. }
  112. }
  113. putlog "\002*Loaded* \017\00304\002\[\00306W\003hois\00304\]\017 \002by \
  114. Ford_Lawnmower irc.GeekShed.net #Script-Help"
  115. </textarea></form>
  116. <script>
  117. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  118. tabMode: "indent",
  119. theme: "night",
  120. lineNumbers: true,
  121. indentUnit: 2,
  122. mode: "text/x-tcl"
  123. });
  124. </script>
  125. <p><strong>MIME types defined:</strong> <code>text/x-tcl</code>.</p>
  126. </body>
  127. </html>