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