index.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <!doctype html>
  2. <title>CodeMirror: mIRC mode</title>
  3. <meta charset="utf-8"/>
  4. <link rel=stylesheet href="../../doc/docs.css">
  5. <link rel="stylesheet" href="../../lib/codemirror.css">
  6. <link rel="stylesheet" href="../../theme/twilight.css">
  7. <script src="../../lib/codemirror.js"></script>
  8. <script src="mirc.js"></script>
  9. <style>.CodeMirror {border: 1px solid black;}</style>
  10. <div id=nav>
  11. <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
  12. <ul>
  13. <li><a href="../../index.html">Home</a>
  14. <li><a href="../../doc/manual.html">Manual</a>
  15. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  16. </ul>
  17. <ul>
  18. <li><a href="../index.html">Language modes</a>
  19. <li><a class=active href="#">mIRC</a>
  20. </ul>
  21. </div>
  22. <article>
  23. <h2>mIRC mode</h2>
  24. <form><textarea id="code" name="code">
  25. ;AKA Nick Tracker by Ford_Lawnmower irc.GeekShed.net #Script-Help
  26. ;*****************************************************************************;
  27. ;**Start Setup
  28. ;Change JoinDisplay, below, for On Join AKA Display. On = 1 - Off = 0
  29. alias -l JoinDisplay { return 1 }
  30. ;Change MaxNicks, below, to the number of nicknames you want to store for each hostmask. I wouldn't go over 400 with this ;/
  31. alias -l MaxNicks { return 20 }
  32. ;Change AKALogo, below, To the text you want displayed before each AKA result.
  33. alias -l AKALogo { return 06 05A06K07A 06 }
  34. ;**End Setup
  35. ;*****************************************************************************;
  36. On *:Join:#: {
  37. if ($nick == $me) { .timer 1 1 ialupdateCheck $chan }
  38. NickNamesAdd $nick $+($network,$wildsite)
  39. if ($JoinDisplay) { .timerNickNames $+ $nick 1 2 NickNames.display $nick $chan $network $wildsite }
  40. }
  41. on *:Nick: { NickNamesAdd $newnick $+($network,$wildsite) $nick }
  42. alias -l NickNames.display {
  43. if ($gettok($hget(NickNames,$+($3,$4)),0,126) > 1) {
  44. echo -g $2 $AKALogo $+(09,$1) $AKALogo 07 $mid($replace($hget(NickNames,$+($3,$4)),$chr(126),$chr(44)),2,-1)
  45. }
  46. }
  47. alias -l NickNamesAdd {
  48. if ($hget(NickNames,$2)) {
  49. if (!$regex($hget(NickNames,$2),/~\Q $+ $replacecs($1,\E,\E\\E\Q) $+ \E~/i)) {
  50. if ($gettok($hget(NickNames,$2),0,126) <= $MaxNicks) {
  51. hadd NickNames $2 $+($hget(NickNames,$2),$1,~)
  52. }
  53. else {
  54. hadd NickNames $2 $+($mid($hget(NickNames,$2),$pos($hget(NickNames,$2),~,2)),$1,~)
  55. }
  56. }
  57. }
  58. else {
  59. hadd -m NickNames $2 $+(~,$1,~,$iif($3,$+($3,~)))
  60. }
  61. }
  62. alias -l Fix.All.MindUser {
  63. var %Fix.Count = $hfind(NickNames,/[^~]+[0-9]{4}~/,0,r).data
  64. while (%Fix.Count) {
  65. if ($Fix.MindUser($hget(NickNames,$hfind(NickNames,/[^~]+[0-9]{4}~/,%Fix.Count,r).data))) {
  66. echo -ag Record %Fix.Count - $v1 - Was Cleaned
  67. hadd NickNames $hfind(NickNames,/[^~]+[0-9]{4}~/,%Fix.Count,r).data $v1
  68. }
  69. dec %Fix.Count
  70. }
  71. }
  72. alias -l Fix.MindUser { return $regsubex($1,/[^~]+[0-9]{4}~/g,$null) }
  73. menu nicklist,query {
  74. -
  75. .AKA
  76. ..Check $$1: {
  77. if ($gettok($hget(NickNames,$+($network,$address($1,2))),0,126) > 1) {
  78. NickNames.display $1 $active $network $address($1,2)
  79. }
  80. else { echo -ag $AKALogo $+(09,$1) 07has not been known by any other nicknames while I have been watching. }
  81. }
  82. ..Cleanup $$1:hadd NickNames $+($network,$address($1,2)) $fix.minduser($hget(NickNames,$+($network,$address($1,2))))
  83. ..Clear $$1:hadd NickNames $+($network,$address($1,2)) $+(~,$1,~)
  84. ..AKA Search Dialog:dialog $iif($dialog(AKA_Search),-v,-m) AKA_Search AKA_Search
  85. -
  86. }
  87. menu status,channel {
  88. -
  89. .AKA
  90. ..AKA Search Dialog:dialog $iif($dialog(AKA_Search),-v,-m) AKA_Search AKA_Search
  91. ..Clean All Records:Fix.All.Minduser
  92. -
  93. }
  94. dialog AKA_Search {
  95. title "AKA Search Engine"
  96. size -1 -1 206 221
  97. option dbu
  98. edit "", 1, 8 5 149 10, autohs
  99. button "Search", 2, 163 4 32 12
  100. radio "Search HostMask", 4, 61 22 55 10
  101. radio "Search Nicknames", 5, 123 22 56 10
  102. list 6, 8 38 190 169, sort extsel vsbar
  103. button "Check Selected", 7, 67 206 40 12
  104. button "Close", 8, 160 206 38 12, cancel
  105. box "Search Type", 3, 11 17 183 18
  106. button "Copy to Clipboard", 9, 111 206 46 12
  107. }
  108. On *:Dialog:Aka_Search:init:*: { did -c $dname 5 }
  109. On *:Dialog:Aka_Search:Sclick:2,7,9: {
  110. if ($did == 2) && ($did($dname,1)) {
  111. did -r $dname 6
  112. var %search $+(*,$v1,*), %type $iif($did($dname,5).state,data,item), %matches = $hfind(NickNames,%search,0,w). [ $+ [ %type ] ]
  113. while (%matches) {
  114. did -a $dname 6 $hfind(NickNames,%search,%matches,w). [ $+ [ %type ] ]
  115. dec %matches
  116. }
  117. did -c $dname 6 1
  118. }
  119. elseif ($did == 7) && ($did($dname,6).seltext) { echo -ga $AKALogo 07 $mid($replace($hget(NickNames,$v1),$chr(126),$chr(44)),2,-1) }
  120. elseif ($did == 9) && ($did($dname,6).seltext) { clipboard $mid($v1,$pos($v1,*,1)) }
  121. }
  122. On *:Start:{
  123. if (!$hget(NickNames)) { hmake NickNames 10 }
  124. if ($isfile(NickNames.hsh)) { hload NickNames NickNames.hsh }
  125. }
  126. On *:Exit: { if ($hget(NickNames)) { hsave NickNames NickNames.hsh } }
  127. On *:Disconnect: { if ($hget(NickNames)) { hsave NickNames NickNames.hsh } }
  128. On *:Unload: { hfree NickNames }
  129. alias -l ialupdateCheck {
  130. inc -z $+(%,ialupdateCheck,$network) $calc($nick($1,0) / 4)
  131. ;If your ial is already being updated on join .who $1 out.
  132. ;If you are using /names to update ial you will still need this line.
  133. .who $1
  134. }
  135. Raw 352:*: {
  136. if ($($+(%,ialupdateCheck,$network),2)) haltdef
  137. NickNamesAdd $6 $+($network,$address($6,2))
  138. }
  139. Raw 315:*: {
  140. if ($($+(%,ialupdateCheck,$network),2)) haltdef
  141. }
  142. </textarea></form>
  143. <script>
  144. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  145. theme: "twilight",
  146. lineNumbers: true,
  147. matchBrackets: true,
  148. indentUnit: 4,
  149. mode: "text/mirc"
  150. });
  151. </script>
  152. <p><strong>MIME types defined:</strong> <code>text/mirc</code>.</p>
  153. </article>