all repos — NoPaste @ 29b774f090102303e43cf939b38ac2083e62d9f1

Resurrected - The PussTheCat.org fork of NoPaste

scripts/CodeMirror/mode/mirc/index.html (view raw)

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