Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias mIRC2JSON {
- var %b = bset -t &json $!calc($bvar(&json,0) +1)
- $(,%b) [
- var %sN = 1
- while (%sN == 1 && $scon(%sN)) {
- scid $v1
- $(,%b) $iif(%sN != 1,$chr(44)) $+ {cid: $cid $+ $chr(44)
- $(,%b) status: $+ $iif($status == disconnected,0,$iif($v1 == connecting,1,$iif($v1 == connected,2,3))) $+ ,
- $(,%b) network: $+ $jqt($network) $+ ,server: $+ $jqt($server) $+ ,serverip: $+ $jqt($serverip) $+ ,port: $+ $port $+ , $+ chans:[
- var %cN = 1, %c
- while ($chan(%cN)) {
- %c = $v1
- $(,%b) $iif(%cN != 1,$chr(44)) $+ {name: $+ $jqt(%c) $+ ,mode: $+ $jqt($chan(%c).mode) $+ ,topic: $+ $jqt($chan(%c).topic) $+ ,users:[
- var %nN = 1, %n
- while ($nick(%c,%nN)) {
- %n = $v1
- $(,%b) $iif(%nN != 1,$chr(44)) $+ {nick: $+ $jqt(%n) $+ ,prefix: $+ $pfix(%c,%n) $+ ,address: $+ $jqt($address(%n,5)) $+ $chr(125)
- inc %nN
- }
- $(,%b) ]}
- inc %cN
- }
- $(,%b) ],queries:[
- var %qN = 1
- while ($query(%qN)) {
- %n = $v1
- $(,%b) $iif(%qN != 1,$chr(44)) $+ {nick: $+ $jqt(%n) $+ ,address: $+ $jqt($address(%n,5)) $+ ,comchans:[ $+ $left($regsubex($str(a,$comchan(%n,0)),/./g,$jqt($comchan(%n,\n)) $+ $chr(44)),-1) $+ ]}
- inc %qN
- }
- $(,%b) ]}
- inc %sN
- }
- $(,%b) ]
- }
- alias -l jqt return ' $+ $regsubex($1-,/([\\'[\]{}\x2C])/g,\\t) $+ '
- alias -l pfix return $jqt($regsubex($nick($1,$2).pnick,/\Q $+ $replacecs($2,\E,\E\\E\Q) $+ \E$/i,))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement