Last active 1737100574

MSN (IRC8) compatible connection script

realJoshByrnes revised this gist 1737100574. Go to revision

1 file changed, 1 insertion, 2 deletions

IRC8.mrc

@@ -52,8 +52,7 @@ on 1:PARSELINE:in:*:{
52 52 }
53 53 }
54 54 elseif ($2 == PRIVMSG) {
55 - if ($regex($4-, /^:\x01S\s([^\\]|\\.)([^\\]|\\.)(.*?);(\d+)\s(.*?)\x01?$/) > 0) {
56 - echo -at SUCCESS
55 + if ($regex($4-, /^:\x01S\s([^\\]|\\.)([^\\]|\\.)(.*?);(\d+)\s(.*?)\x01?$/) > 0) {
57 56 ; Notes:
58 57 ; Font stored in: $regsubex($regml(3), /([^\\]|\\.)/gu, $chr($gk.asc(\1)))
59 58 ; Script number stored in: $regml(4) - See also https://learn.microsoft.com/pl-pl/dotnet/api/system.windows.forms.visualstyles.textmetricscharacterset

realJoshByrnes revised this gist 1737100546. Go to revision

1 file changed, 2 insertions, 2 deletions

IRC8.mrc

@@ -53,13 +53,13 @@ on 1:PARSELINE:in:*:{
53 53 }
54 54 elseif ($2 == PRIVMSG) {
55 55 if ($regex($4-, /^:\x01S\s([^\\]|\\.)([^\\]|\\.)(.*?);(\d+)\s(.*?)\x01?$/) > 0) {
56 + echo -at SUCCESS
56 57 ; Notes:
57 58 ; Font stored in: $regsubex($regml(3), /([^\\]|\\.)/gu, $chr($gk.asc(\1)))
58 59 ; Script number stored in: $regml(4) - See also https://learn.microsoft.com/pl-pl/dotnet/api/system.windows.forms.visualstyles.textmetricscharacterset
59 60 var %msg :
60 61 var %color $gk.msn2irc($calc($gk.asc($regml(1)) - 1))
61 - if (%color)
62 - %msg = $+(%msg, $chr(3), $base(%color, 10, 10, 2))
62 + if (%color) %msg = $+(%msg, $chr(3), $base(%color, 10, 10, 2))
63 63 var %style $calc($gk.asc($regml(2)) - 1)
64 64 if (%style & 1) %msg = %msg $+ $chr(2)
65 65 if (%style & 2) %msg = %msg $+ $chr(29)

realJoshByrnes revised this gist 1737100148. Go to revision

2 files changed, 36 insertions, 6 deletions

IRC8.mrc

@@ -79,7 +79,7 @@ on 1:PARSELINE:in:*:{
79 79 var %user = $gettok(%original, %i, 32)
80 80 %new = %new $gettok(%user, $numtok(%user, 44), 44)
81 81 if ($numtok(%user, 44) = 4) {
82 - .parseline -itq : $+ $gettok(%user, $numtok(%user, 44), 44) AWAY $iif($gettok(%user, 1, 44) == G,:Away)
82 + .parseline -itq : $+ $remove($gettok(%user, $numtok(%user, 44), 44), +, @, .) AWAY $iif($gettok(%user, 1, 44) == G,:Away)
83 83 }
84 84 inc %i
85 85 }
@@ -93,8 +93,19 @@ on 1:PARSELINE:in:*:{
93 93 }
94 94 }
95 95
96 - ; 3/6 matches
97 - alias gk.msn2irc return $gettok(1 0 5 3 2 7 6 10 15 14 4 9 12 8 13 11, $calc($1 + 1), 32)
96 + on 1:PARSELINE:out:*:{
97 + tokenize 32 $iif($asc($right($parseline, 1)) == 10, $left($parseline, -1), $parseline)
98 +
99 + ; JOIN without key/hostkey/ownerkey
100 + if ($1 == JOIN && $3 == $null) {
101 + if (!$2) return
102 + if ($gk.config($2, OWNERKEY)) .parseline -otn $1-2 $ifmatch
103 + elseif ($gk.config($2, HOSTKEY)) .parseline -otn $1-2 $ifmatch
104 + else .parseline -otn $1-2 $gk.ud
105 + }
106 + }
107 +
108 + alias -l gk.msn2irc return $gettok(1 0 5 3 2 7 6 10 15 14 4 9 12 8 13 11, $calc($1 + 1), 32)
98 109
99 110 ; Usage: $gk.header(sequence) - Returns GateKeeper v3 header with specified sequence (1 or 3 for client)
100 111 alias -l gk.header return $+(GKSSP\0JD,$chr(3),\0\0\0,$chr($$1),\0\0\0)
@@ -114,7 +125,7 @@ alias -l gk.hex2chr {
114 125 ; Normalise - Remove zero padding
115 126 var %h = $base($1, 16, 16)
116 127
117 - ; Chars need escapinh
128 + ; Chars need escaping
118 129 if (%h == 0) return \0
119 130 elseif (%h == 9) return \t
120 131 elseif (%h == A) return \n
@@ -122,14 +133,32 @@ alias -l gk.hex2chr {
122 133 elseif (%h == 20) return \b
123 134 elseif (%h == 2C) return \c
124 135 elseif (%h == 5C) return \\
136 +
125 137 ; Chars don't need escaping
126 138 else return $chr($base($1, 16, 10))
127 139 }
128 140
129 141 alias -l gk.guid {
130 142 if ($1 == GateKeeperPassport) return $str(00,16)
131 - if (!$var(%GK.GUID)) set %GK.GUID $md5($time $date $gmt $ctime $ticks)
132 - return %GK.GUID
143 + if ($gk.config(settings, GUID)) return $ifmatch
144 + var %guid = $md5($time $date $gmt $ctime $ticks)
145 + gk.config settings GUID %guid
146 + return %guid
147 + }
148 +
149 + alias -l gk.ud {
150 + if ($gk.config(settings, UserData1)) return $ifmatch
151 + var %ud = $regsubex($str(-, 31), /-/g, $chr($r(33, 126)))
152 + gk.config settings UserData1 %ud
153 + return %ud
154 + }
155 +
156 + ; Usage: $gk.config(section, key)
157 + ; /gk.config <section> <key> <data>
158 + alias gk.config {
159 + var %fn $scriptdir $+ gk.settings.ini
160 + if ($isid) return $readini(%fn, $1, $2)
161 + writeini %fn $1-
133 162 }
134 163
135 164 ; Adds $username for mIRC (Built-in for AdiIRC)

README.md

@@ -9,6 +9,7 @@
9 9 * [X] Supports IRC8 names reply (353)
10 10 * [X] Supports IRC8 away/unaway notifications (821/822/JOIN/353)
11 11 * [X] Supports MSN Chat colors and styles (bold/italic/underline)
12 + * [X] Support MSN Chat UserData1 / Ownerkey (and HostKey)
12 13
13 14 ## Nice to haves (might be implemented)
14 15

realJoshByrnes revised this gist 1737011222. Go to revision

2 files changed, 8 insertions, 9 deletions

IRC8.mrc

@@ -46,19 +46,16 @@ on 1:PARSELINE:in:*:{
46 46 }
47 47 elseif ($2 == JOIN) {
48 48 .parseline -it $1-2 $4-
49 + .parseline -itq $1 AWAY $iif($gettok($3, 1, 44) == G,:Away)
49 50 if ($gettok($3, 4, 44) isin +@.) {
50 51 .parseline -itq $+($1 MODE $right($4, -1) +, $replace($gettok($3, 4, 44), +, v, @, o, ., q) $right($gettok($1, 1, 33), -1))
51 52 }
52 53 }
53 54 elseif ($2 == PRIVMSG) {
54 - :>JD!07215E4B28474ECBBCEF373752CAA2D1@GateKeeper PRIVMSG %#The\bLobby :S Tahoma;0 test
55 - if ($left($4-, 2) == : $+ $chr(1) && $len($4-) > 2) {
56 - echo -a CTCP
57 - }
58 55 if ($regex($4-, /^:\x01S\s([^\\]|\\.)([^\\]|\\.)(.*?);(\d+)\s(.*?)\x01?$/) > 0) {
59 - ; Notes:
60 - ; Font stored in: $regsubex($regml(3), /([^\\]|\\.)/gu, $chr($gk.asc(\1)))
61 - ; Script number stored in: $regml(4) - See also https://learn.microsoft.com/pl-pl/dotnet/api/system.windows.forms.visualstyles.textmetricscharacterset
56 + ; Notes:
57 + ; Font stored in: $regsubex($regml(3), /([^\\]|\\.)/gu, $chr($gk.asc(\1)))
58 + ; Script number stored in: $regml(4) - See also https://learn.microsoft.com/pl-pl/dotnet/api/system.windows.forms.visualstyles.textmetricscharacterset
62 59 var %msg :
63 60 var %color $gk.msn2irc($calc($gk.asc($regml(1)) - 1))
64 61 if (%color)
@@ -81,6 +78,9 @@ on 1:PARSELINE:in:*:{
81 78 while (%i <= $numtok(%original, 32)) {
82 79 var %user = $gettok(%original, %i, 32)
83 80 %new = %new $gettok(%user, $numtok(%user, 44), 44)
81 + if ($numtok(%user, 44) = 4) {
82 + .parseline -itq : $+ $gettok(%user, $numtok(%user, 44), 44) AWAY $iif($gettok(%user, 1, 44) == G,:Away)
83 + }
84 84 inc %i
85 85 }
86 86 .parseline -it $1-5 : $+ %new

README.md

@@ -7,13 +7,12 @@
7 7 * [X] Supports IRC8 JOIN messages
8 8 * [X] Supports MODE on JOIN via IRCX access entries
9 9 * [X] Supports IRC8 names reply (353)
10 - * [X] Supports IRC8 away/unaway notifications (821/822)
10 + * [X] Supports IRC8 away/unaway notifications (821/822/JOIN/353)
11 11 * [X] Supports MSN Chat colors and styles (bold/italic/underline)
12 12
13 13 ## Nice to haves (might be implemented)
14 14
15 15 * [ ] IRC8 Profiles (818)
16 - * [ ] Support away information from 353/JOIN
17 16 * [ ] Support WHISPER (and convert PRIVMSG to & from WHISPER)
18 17 * [ ] Support CTCP "ERR NOUSERWHISPER".
19 18 * [ ] Don't default to IRC8

realJoshByrnes revised this gist 1737008948. Go to revision

1 file changed, 1 insertion, 1 deletion

README.md

@@ -2,7 +2,7 @@
2 2
3 3 ## Features
4 4
5 - * [ ] Works with both mIRC and AdiIRC
5 + * [X] Works with both mIRC and AdiIRC
6 6 * [X] Native GateKeeper & GateKeeperPassport Authentication
7 7 * [X] Supports IRC8 JOIN messages
8 8 * [X] Supports MODE on JOIN via IRCX access entries

realJoshByrnes revised this gist 1737008948. Go to revision

1 file changed, 8 insertions, 8 deletions

README.md

@@ -2,13 +2,13 @@
2 2
3 3 ## Features
4 4
5 - * [x] Works with both mIRC and AdiIRC
6 - * [x] Native GateKeeper & GateKeeperPassport Authentication
7 - * [x] Supports IRC8 JOIN messages
8 - * [x] Supports MODE on JOIN via IRCX access entries
9 - * [x] Supports IRC8 names reply (353)
10 - * [x] Supports IRC8 away/unaway notifications (821/822)
11 - * [x] Supports MSN Chat colors and styles (bold/italic/underline)
5 + * [ ] Works with both mIRC and AdiIRC
6 + * [X] Native GateKeeper & GateKeeperPassport Authentication
7 + * [X] Supports IRC8 JOIN messages
8 + * [X] Supports MODE on JOIN via IRCX access entries
9 + * [X] Supports IRC8 names reply (353)
10 + * [X] Supports IRC8 away/unaway notifications (821/822)
11 + * [X] Supports MSN Chat colors and styles (bold/italic/underline)
12 12
13 13 ## Nice to haves (might be implemented)
14 14
@@ -19,4 +19,4 @@
19 19 * [ ] Don't default to IRC8
20 20
21 21 ## Known Issues
22 - * Auth doesn't always work with AdiIRC (probably due to UTF8 quirks)
22 + * Auth doesn't always work with AdiIRC (probably due to UTF8 quirks)

realJoshByrnes revised this gist 1737008640. Go to revision

2 files changed, 26 insertions, 2 deletions

IRC8.mrc

@@ -50,6 +50,27 @@ on 1:PARSELINE:in:*:{
50 50 .parseline -itq $+($1 MODE $right($4, -1) +, $replace($gettok($3, 4, 44), +, v, @, o, ., q) $right($gettok($1, 1, 33), -1))
51 51 }
52 52 }
53 + elseif ($2 == PRIVMSG) {
54 + :>JD!07215E4B28474ECBBCEF373752CAA2D1@GateKeeper PRIVMSG %#The\bLobby :S Tahoma;0 test
55 + if ($left($4-, 2) == : $+ $chr(1) && $len($4-) > 2) {
56 + echo -a CTCP
57 + }
58 + if ($regex($4-, /^:\x01S\s([^\\]|\\.)([^\\]|\\.)(.*?);(\d+)\s(.*?)\x01?$/) > 0) {
59 + ; Notes:
60 + ; Font stored in: $regsubex($regml(3), /([^\\]|\\.)/gu, $chr($gk.asc(\1)))
61 + ; Script number stored in: $regml(4) - See also https://learn.microsoft.com/pl-pl/dotnet/api/system.windows.forms.visualstyles.textmetricscharacterset
62 + var %msg :
63 + var %color $gk.msn2irc($calc($gk.asc($regml(1)) - 1))
64 + if (%color)
65 + %msg = $+(%msg, $chr(3), $base(%color, 10, 10, 2))
66 + var %style $calc($gk.asc($regml(2)) - 1)
67 + if (%style & 1) %msg = %msg $+ $chr(2)
68 + if (%style & 2) %msg = %msg $+ $chr(29)
69 + if (%style & 4) %msg = %msg $+ $chr(31)
70 + %msg = $+(%msg, $str($chr(2), 2), $regml(5))
71 + .parseline -it $1-3 %msg
72 + }
73 + }
53 74 elseif ($2 == 004) {
54 75 .parseline -itq : $+ $server 005 $me PREFIX=(qov).@+ CHANTYPES=%#
55 76 }
@@ -72,6 +93,9 @@ on 1:PARSELINE:in:*:{
72 93 }
73 94 }
74 95
96 + ; 3/6 matches
97 + alias gk.msn2irc return $gettok(1 0 5 3 2 7 6 10 15 14 4 9 12 8 13 11, $calc($1 + 1), 32)
98 +
75 99 ; Usage: $gk.header(sequence) - Returns GateKeeper v3 header with specified sequence (1 or 3 for client)
76 100 alias -l gk.header return $+(GKSSP\0JD,$chr(3),\0\0\0,$chr($$1),\0\0\0)
77 101
@@ -112,4 +136,4 @@ alias -l gk.guid {
112 136 alias -l username {
113 137 if (@ isin $emailaddr) return $gettok($emailaddr, 1, 46)
114 138 else return $me
115 - }
139 + }

README.md

@@ -8,13 +8,13 @@
8 8 * [x] Supports MODE on JOIN via IRCX access entries
9 9 * [x] Supports IRC8 names reply (353)
10 10 * [x] Supports IRC8 away/unaway notifications (821/822)
11 + * [x] Supports MSN Chat colors and styles (bold/italic/underline)
11 12
12 13 ## Nice to haves (might be implemented)
13 14
14 15 * [ ] IRC8 Profiles (818)
15 16 * [ ] Support away information from 353/JOIN
16 17 * [ ] Support WHISPER (and convert PRIVMSG to & from WHISPER)
17 - * [ ] Convert styled PRIVMSG to normal PRIVMSG (convert colors, etc)
18 18 * [ ] Support CTCP "ERR NOUSERWHISPER".
19 19 * [ ] Don't default to IRC8
20 20

realJoshByrnes revised this gist 1736951883. Go to revision

2 files changed, 22 insertions, 14 deletions

IRC8.mrc

@@ -47,7 +47,7 @@ on 1:PARSELINE:in:*:{
47 47 elseif ($2 == JOIN) {
48 48 .parseline -it $1-2 $4-
49 49 if ($gettok($3, 4, 44) isin +@.) {
50 - parseline -itq $+($1 MODE $right($4, -1) +, $replace($gettok($3, 4, 44), +, v, @, o, ., q) $right($gettok($1, 1, 33), -1))
50 + .parseline -itq $+($1 MODE $right($4, -1) +, $replace($gettok($3, 4, 44), +, v, @, o, ., q) $right($gettok($1, 1, 33), -1))
51 51 }
52 52 }
53 53 elseif ($2 == 004) {
@@ -64,6 +64,12 @@ on 1:PARSELINE:in:*:{
64 64 }
65 65 .parseline -it $1-5 : $+ %new
66 66 }
67 + elseif ($2 == 821) {
68 + .parseline -it $1 AWAY
69 + }
70 + elseif ($2 == 822) {
71 + .parseline -it $1 AWAY $3-
72 + }
67 73 }
68 74
69 75 ; Usage: $gk.header(sequence) - Returns GateKeeper v3 header with specified sequence (1 or 3 for client)
@@ -97,7 +103,7 @@ alias -l gk.hex2chr {
97 103 }
98 104
99 105 alias -l gk.guid {
100 - if ($1 == GateKeeperPassport) return $str(00, 16)
106 + if ($1 == GateKeeperPassport) return $str(00,16)
101 107 if (!$var(%GK.GUID)) set %GK.GUID $md5($time $date $gmt $ctime $ticks)
102 108 return %GK.GUID
103 109 }
@@ -106,4 +112,4 @@ alias -l gk.guid {
106 112 alias -l username {
107 113 if (@ isin $emailaddr) return $gettok($emailaddr, 1, 46)
108 114 else return $me
109 - }
115 + }

README.md

@@ -1,19 +1,21 @@
1 1 # MSN (IRC8) compatible connection script
2 2
3 - ## Requirements
3 + ## Features
4 4
5 - * [x] AdiIRC-first - Works with both mIRC and AdiIRC
6 - * [x] Native GateKeeper / GateKeeperPassport Authentication
7 - * [ ] Support WHISPER (and converts WHISPER to & from PRIVMSG)
8 - * [x] Convert IRC8 JOIN to IRC JOIN
9 - * [x] Support MODE on IRC8 JOIN (+v/o/q)
10 - * [x] Convert IRC8 NAMES to IRC NAMES
5 + * [x] Works with both mIRC and AdiIRC
6 + * [x] Native GateKeeper & GateKeeperPassport Authentication
7 + * [x] Supports IRC8 JOIN messages
8 + * [x] Supports MODE on JOIN via IRCX access entries
9 + * [x] Supports IRC8 names reply (353)
10 + * [x] Supports IRC8 away/unaway notifications (821/822)
11 11
12 - ## Nice to haves
12 + ## Nice to haves (might be implemented)
13 13
14 - * [ ] Convert styled PRIVMSG to normal PRIVMSG
15 - * [ ] Supports CTCP "ERR NOUSERWHISPER".
16 - * [ ] Convert AWAY to IRCv3 AWAY (if it does something in clients)
14 + * [ ] IRC8 Profiles (818)
15 + * [ ] Support away information from 353/JOIN
16 + * [ ] Support WHISPER (and convert PRIVMSG to & from WHISPER)
17 + * [ ] Convert styled PRIVMSG to normal PRIVMSG (convert colors, etc)
18 + * [ ] Support CTCP "ERR NOUSERWHISPER".
17 19 * [ ] Don't default to IRC8
18 20
19 21 ## Known Issues

realJoshByrnes revised this gist 1736949344. Go to revision

2 files changed, 2 insertions, 1 deletion

IRC8.mrc

@@ -97,7 +97,7 @@ alias -l gk.hex2chr {
97 97 }
98 98
99 99 alias -l gk.guid {
100 - if ($1 == GateKeeperPassport) return $str(00,16)
100 + if ($1 == GateKeeperPassport) return $str(00, 16)
101 101 if (!$var(%GK.GUID)) set %GK.GUID $md5($time $date $gmt $ctime $ticks)
102 102 return %GK.GUID
103 103 }

README.md

@@ -14,6 +14,7 @@
14 14 * [ ] Convert styled PRIVMSG to normal PRIVMSG
15 15 * [ ] Supports CTCP "ERR NOUSERWHISPER".
16 16 * [ ] Convert AWAY to IRCv3 AWAY (if it does something in clients)
17 + * [ ] Don't default to IRC8
17 18
18 19 ## Known Issues
19 20 * Auth doesn't always work with AdiIRC (probably due to UTF8 quirks)

realJoshByrnes revised this gist 1736949094. Go to revision

2 files changed, 24 insertions, 3 deletions

IRC8.mrc

@@ -44,6 +44,26 @@ on 1:PARSELINE:in:*:{
44 44 echo $color(info2) -t * ERROR: Unknown Authentication Package $+($chr(40),$2,$chr(41))
45 45 }
46 46 }
47 + elseif ($2 == JOIN) {
48 + .parseline -it $1-2 $4-
49 + if ($gettok($3, 4, 44) isin +@.) {
50 + parseline -itq $+($1 MODE $right($4, -1) +, $replace($gettok($3, 4, 44), +, v, @, o, ., q) $right($gettok($1, 1, 33), -1))
51 + }
52 + }
53 + elseif ($2 == 004) {
54 + .parseline -itq : $+ $server 005 $me PREFIX=(qov).@+ CHANTYPES=%#
55 + }
56 + elseif ($2 == 353) {
57 + var %original = $right($6-, -1)
58 + var %new
59 + var %i = 1
60 + while (%i <= $numtok(%original, 32)) {
61 + var %user = $gettok(%original, %i, 32)
62 + %new = %new $gettok(%user, $numtok(%user, 44), 44)
63 + inc %i
64 + }
65 + .parseline -it $1-5 : $+ %new
66 + }
47 67 }
48 68
49 69 ; Usage: $gk.header(sequence) - Returns GateKeeper v3 header with specified sequence (1 or 3 for client)

README.md

@@ -5,14 +5,15 @@
5 5 * [x] AdiIRC-first - Works with both mIRC and AdiIRC
6 6 * [x] Native GateKeeper / GateKeeperPassport Authentication
7 7 * [ ] Support WHISPER (and converts WHISPER to & from PRIVMSG)
8 - * [ ] Convert IRC8 JOIN to IRC JOIN
9 - * [ ] Support MODE on IRC8 JOIN (+v/o/q)
10 - * [ ] Convert IRC8 NAMES to IRC NAMES
8 + * [x] Convert IRC8 JOIN to IRC JOIN
9 + * [x] Support MODE on IRC8 JOIN (+v/o/q)
10 + * [x] Convert IRC8 NAMES to IRC NAMES
11 11
12 12 ## Nice to haves
13 13
14 14 * [ ] Convert styled PRIVMSG to normal PRIVMSG
15 15 * [ ] Supports CTCP "ERR NOUSERWHISPER".
16 + * [ ] Convert AWAY to IRCv3 AWAY (if it does something in clients)
16 17
17 18 ## Known Issues
18 19 * Auth doesn't always work with AdiIRC (probably due to UTF8 quirks)
Newer Older