Syntax highlighting on this forum


#1

One of my ideas is to come up with mirc.js for highlight.js, pull request it with the main repo, get it approved and then use mIRC syntax highlighting in [code][/code] blocks on this website. I have asked for help here on the official mIRC forums…

At the moment we use plain code code blocks:

```plain
alias hello { echo -a Hello World! }
```

renders as:

alias hello { echo -a Hello World! }

When mirc.js goes live in the highlight.js repo, syntax highlighting will be added for mSL (mIRC Scripting Language) and can then be enabled for this forum.

We will the be able to use the following code blocks:

```mrc
alias hello { echo -a Hello World! }
```

Which will render as:

alias hello { echo -a Hello World! }

N.B.: Syntax highlighter code for mSL


#2

Sample .mrc code wrapped in mrc code blocks (This is WIP)

; teamrand #channel <number of teams> 
alias teamrand {
  if (($1 ischan) && ($2 isnum 2- $+ $calc($nick($1,0)))) {

    if ($hget(teamrand. $+ $cid $+ . $+ $1)) hfree teamrand. $+ $cid $+ . $+ $1
    hmake teamrand. $+ $cid $+ . $+ $1 40

    ; enumerate nicks in channel and assign random team number
    var %num = $nick($1,0)
    while (%num > 0) {
      hadd teamrand. $+ $cid $+ . $+ $1 $nick($1,%num) $rand(1,$2)
      dec %num
    }
    ; cycle through all teams
    var %team = 1
    while (%team <= $2) {
      ;for every team, enumerate members of the team
      var %n = 1, %members
      while ($hfind(teamrand. $+ $cid $+ . $+ $1,%team,%n).data) {
        %members = $addtok(%members,$ifmatch,32)
        inc %n
      }
      echo -ag Team %team $+ : %members
      inc %team
    }
    hfree teamrand. $+ $cid $+ . $+ $1
  }
}