tglogo.png
0 LIKES

Snippet


Chrome Multi Connection

In Category General ircWx Posted by Kevin On 10/30/20

Chrome Multi Connection (SPCN,DCN,ECN,EVO)
on *:start: { hmake message 999 | $iif(%autoconnect == on,launch_auto,echo -a Auto Connect Disabled) | unset %whisper*  | unset %top.* | unset %x.* | unset %nfld  }
alias rejoin { join $+($chr(37),$chr(35),$1) }
on *:sockclose:?#*:{ var %dc.chan $remove($sockname,.,$lnet,$chr(37),$chr(35)) |  echo $remove($sockname,,.,$lnet) You disconnected from %dc.chan ... Rejoining.. | sockclose $sockname  | rejoin %dc.chan }
on *:sockopen:?#*:{  sockwrite -n $sockname nick >ChromeMulti $+ $R(0000,9999) |  sockwrite -n $sockname AUTHTYPE ircwx1 | sockwrite -n $sockname USER ChromeMini "Chrome" 127.0.0.1 :Chrome Multi Server [PublicRelease:1] |  sockwrite -n $sockname loginh $readini(credentials.ini,$gettok($sock($sockname).mark,1,32),credentials)  }
on *:sockclose:local*: { echo $active $sockname Disconnected, Closing anything related to this network to clean up sockets. | sockclose $+(*.,$remove($sockname,local.))  }
on *:sockread:local*: {
  var %l "" | sockread -f %l | tokenize 32 %l | var %chan $2 
  var %s $remove($sockname,local.)
  var %sockname $+(%chan,,.,%s)
  if ($1 == PART) && ($2) { sockwrite -n %sockname PART $2 | .timerDisconnect $+ $right($2,-2) $+ . $+ %s -m 1 650 sockclose $+(*,$right($2,-2),.,%s) }
  if ($1 == PRIVMSG) { sockwrite -n %sockname PRIVMSG %chan $3- | halt }
  if ($1 == JOIN) {
    if ($sock(%sockname)) && ($me !ison $2) { sockwrite -n $+($2,.,%s) JOIN $2 | halt }
    if (!$sock(%sockname)) && (%s == SPCN) { sockopen $+($2,.,%s) 167.114.203.109 7778 | sockmark $+($2,.,%s) local.SPCN $2  }
    if (!$sock(%sockname)) && (%s == DCN) { sockopen $+($2,.,%s) 144.217.229.114 7778 | sockmark $+($2,.,%s) local.DCN  $2 }
    if (!$sock(%sockname)) && (%s == ECN) { sockopen $+($2,.,%s) 167.114.203.103 7778 | sockmark $+($2,.,%s) local.ECN $2  }
    if (!$sock(%sockname)) && (%s == EVO) { sockopen $+($2,.,%s) 167.114.203.110 7778 | sockmark $+($2,.,%s) local.EVO $2 }
    else { return }
  }
  if ($sock(%sockname)) && ($me ison $2) { sockwrite -n %sockname $1- }
}
alias lnet { return $remove($repnet,local.) }
alias setupcat { .sockwrite -n $+($chr(37),$chr(35),$1,.,$lnet) PROP $+($chr(37),$chr(35),$1) CATEGORY CP }
on *:sockread:?#*: {
  if ($sockerr > 0) return
  while (1) {
    sockread -fn &chrome 
    tokenize 32 $bvar(&chrome,1,$bvar(&chrome,0)).text
    if ($5 == :TIME) { sockwrite -fn $gettok($sock($sockname).mark,1,32) :^CHROME_SYSTEM!12345.54321@ALERT PRIVMSG $3 : $+ ALERT 04|01 $right($gettok($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,1,32),1,33),-1) Checked your time... in $3 | echo -s sockwrite -n $sockname PRIVMSG $3 $right($gettok($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,1,32),1,33),-1) $+(:,$chr(1),TIME,$chr(1)) | halt  }
    if ($2 == 433) { .timer -im 1 1 echo -s Error, Nickname already in USE, Closing this socket. | sockclose $sockname  }
    if ($2 == 001) { hadd -m $gettok($sock($sockname).mark,1,32) uid $gettok($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,10,32),3-,46) }
    if ($2 == NOTICE) && ($gettok($sock($sockname).mark,2,32) isin $1-) { sockwrite -fn $sock($sockname).mark :^CHROME_SYSTEM!12345.54321@ALERT PRIVMSG $3 :ALERT 04|01 $status($sockname,$remove($replace($gettok($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,1,32),1,33),>,Guest_),:)) 05 $+ $remove($replace($gettok($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,1,32),1,33),>,Guest_),:) $+ 04:01 $iif($gettok($5,1,32) == :,$right($5-,-1),$remove($strip($5-),:TIME)) | return } 
    if ($2 == 403) { sockwrite -n $sockname CREATE $gettok($sock($sockname).mark,2,32) | $iif(%create.alert,queue.data %create.alert Channel did not exist and had to be created ive taken liberty in applying settings to this channel automatically.,) | sockwrite -n $sockname PROP $gettok($sock($sockname).mark,2,32) UNLOCK CATEGORY |  .timerUpdateCateGory -m 1 2550 setupcat $right($gettok($sock($sockname).mark,2,32),-2) }
    if ($2-5 == MODE $3 +q $me) {  sockwrite -n $sockname access $gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,3,32) add owner $iif($hget($gettok($sock($sockname).mark,1,32),uid),$v1 0,$me 10) :Chrome[ OWNER ]Access }
    if ($2 == 352) {  hadd -m $gettok($sock($sockname).mark,1,32) $gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,8,32) $+($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,5,32),@,$gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,6,32)) }
    if ($2 == 422) {  sockwrite -n $sockname JOIN $gettok($sock($sockname).mark,2,32) }
    if ($2 == QUIT) { sockwrite -n $gettok($sock($sockname).mark,1,32) $gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,1,32) PART $gettok($sock($sockname).mark,2,32) $gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,3-,32) | return }
    if ($1 == PING) { sockwrite -n $sockname PONG $gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,2,32) }
    if ($2 == WHISPER) { set -u1000 %whisper. [ $+ [ $right($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,1,33),-1) ] ] $gettok($sock($sockname).mark,2,32)  |  sockwrite -n $gettok($sock($sockname).mark,1,32) : $+ $remove($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,1,32),:) PRIVMSG $me $replace($regsubex($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,5-,32), /\[(?:style \40|/style).*?\]/gix,),  , $Chr(160)) | return }
    if ($sockbr == 0) return
    if ($istok(002 003 004 251 252 254 255 265 266 375 372 472 482 914 927,$2,32)) return
    if ($2 == JOIN) { $iif($right($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,1,33),-1) == $me,sockwrite -n $sockname WHO $remove($sockname,.spcn,.dcn,.ecn,.evo),)  | set -u5 %wflood on  | if ($gettok($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,3,32),4,44)) { sockwrite -n $gettok($sock($sockname).mark,1,32) : $+ $right($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,1,33),-1) MODE $sockname $+(+,$replace($gettok($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,3,32),4,44),',Q,.,q,@,o,+,v,%,h)) $right($gettok($bvar(&chrome,1,$bvar(&chrome,0)).text,1,33),-1) } }
    if ($pos($2,353)) { var %1, %2 | %2 = $regsub($6-,/([^:,\s]+,)/g,$null,%1) | sockwrite -n $gettok($sock($sockname).mark,1,32) $1-5 %1  }
    else { sockwrite -fn $gettok($sock($sockname).mark,1,32) $bvar(&chrome,1-).text }
  }
}
;Prevent loop
raw 474:*: { echo -s $time(01h4:01nntt) You are Banned from04:01 $2 $+ 4,1 Closing the socket (Network $lnet $+ ) | sockclose $+($2,.,$lnet) | sockclose $+($2,.,$lnet,*)   | haltdef }
raw 473:*: { echo -s $time(01h4:01nntt) Channel is invite only04:01 $2 $+ 4,1 Closing the socket | sockclose $+($2,.,$lnet) | $+($2,.,$lnet,*) | haltdef }
alias singlenet { 
  if ($timer(0) <= 1) autojoin $readini(portdata.ini,port,$port) 
}
on 1:ACTIVE:*: {
  if ($active == Status Window) && ($timer(0) < 1) {
    set -u2 %local $readini(portdata.ini,port,$port)
    if ($readini(portdata.ini,port,$port)) && ($readini(credentials.ini,%local,AJOIN) == ON) {  autojoin $readini(portdata.ini,port,$port) | remini -n portdata.ini port $port }
    if ($readini(portdata.ini,port,$port)) && ($readini(credentials.ini,%local,AJOIN) != ON) { echo -a Status Window is registered to $readini(portdata.ini,port,$port) Auto join not enabled. | remini -n portdata.ini port $port }
  }
}
;;; Auto join
on *:socklisten:preauth*: { var %alive $replace($sockname,preauth,local) | sockaccept $replace($sockname,preauth,local) | sockclose $sockname   | echo -a 01.. 04[01 Connection Established $upper($remove(%alive,local.)) - Thank you for using Chrome Multi Connection, by Kevin. 04]1 .. 04[1 /join $chr(37) $+ #channel 04]1 .. 04[1 AUTOJOIN STATUS: $iif($readini(credentials.ini,%alive,AJOIN),$v1,OFF) 04]1 .. 4[1 Stored Passport: $iif($gettok($readini(credentials.ini,%alive,credentials),1,32),$v1,You need to add a passport for this network) 4]1 | $iif($readini(credentials.ini,%alive,AJOIN) == ON,set %autojoin. [ $+ [ %alive ] ] TRUE,) | .timerSingleNet  1 2 singlenet }
alias connect {
  if ($sock(local. $+ $1)) { echo -a You're already connected to that network, ERROR. | halt }
  if (!$1) { echo -a Network Name not selected, You can, /connect SPCN (Sparkpea), DCN (Digital Com Network), ECN (Essential Chat Network) | halt }
  if ($1 == SPCN) { set -u4 %cs SPCN | set -u4 %port $R(5000,8000) |  socklisten $+(preauth.,$1) %port | writeini -n portdata.ini port %port $+(local.,%cs) | server localhost $sock($+(preauth.,$1)).port  }
  if ($1 == DCN) { set -u4 %cs DCN  | set -u4 %port $R(5000,8000) | socklisten $+(preauth.,$1) %port | writeini -n portdata.ini port %port $+(local.,%cs) | server -m localhost $sock($+(preauth.,$1)).port }
  if ($1 == ECN) { set -u4 %cs ECN  | set -u4 %port $R(5000,8000) | socklisten $+(preauth.,$1) %port | writeini -n portdata.ini port %port $+(local.,%cs) | server -m localhost $sock($+(preauth.,$1)).port }
  if ($1 == EVO) { set -u4 %cs EVO | set -u4 %port $R(5000,8000) | socklisten $+(preauth.,$1) %port | writeini -n portdata.ini port %port $+(local.,%cs) | server -m localhost $sock($+(preauth.,$1)).port }

}
menu status {
  -
  .Autoconnect:
  .Turn on: set %autoconnect on
  .Turn off: set %autoconnect off
  -
  .Credentials:
  .SPARKPEA (SPCN): writeini -n credentials.ini local.spcn CREDENTIALS $?="Email" $md5($?="Password")
  .ESSENTIAL CHAT (ECN): writeini -n credentials.ini local.ecn CREDENTIALS $?="Email" $md5($?="Password")
  .DIGITAL COMM (DCN): writeini -n credentials.ini local.dcn CREDENTIALS $?="Email" $md5($?="Password")
  .EVOLUTION (EVO): writeini -n credentials.ini local.evo CREDENTIALS $?="Email" $md5($?="Password")

  -
  .Connect:
  .ALL: connect SPCN | .timer 1 5 connect ECN | .timer 1 8 connect DCN | | .timer 1 11 connect EVO
  .Sparkpea (SPCN): connect SPCN
  .Essential (ECN): connect ECN
  .Digital (DCN): connect DCN
  .Evolution (EVO): connect EVO
}
alias REPNET { return $replace($network,Sparkpea,LOCAL.SPCN,Digital,LOCAL.DCN,Essential,LOCAL.ECN,Evolution,LOCAL.EVO) }
menu channel {
  -
  .Autojoin ( $iif($readini(credentials.ini,$repnet,AJOIN),$v1,OFF) ):
  .Turn On for $remove($REPNET,LOCAL.): writeini -n credentials.ini $repnet AJOIN ON
  .Turn OFF for $remove($REPNET,LOCAL.): writeini -n credentials.ini $repnet AJOIN OFF
  ..Add: writeini -n autojoin.ini $REPNET $chan Active
  ..Remove: writeini -n autojoin.ini $REPNET $chan Deleted/Suspended
}
alias autojoin1 { .timer -im 1 1 autojoin $1 }
alias autojoin {
  var %x 0, %z $ini(autojoin.ini,$1,0)
  while (%x <= %z) {
    if ($readini(autojoin.ini,$1,$ini(autojoin.ini,$1,%x)) = ACTIVE) .timerjoin $+ $R(0000000000000000000,999999999999999999999) -m 1 $calc(%x * 750) join $right($ini(autojoin.ini,$1,%x),-2)
    inc %x
  }
  unset %autojoin. [ $+ [ $1 ] ]
}
alias launch_auto {
  echo -a 01.. 04[01 Auto Connect Enabled 04]1 .. 04[1 Loading Networks with valid Passports 04]1 .. 04[1 Networks: SPCN, EVO, DCN, ECN.. 04]
  if ($readini(credentials.ini,local.spcn,credentials)) { echo -a 01.. 04[01 Connecting to SPCN 04]1 .. 04[1 Stored Passport: $gettok($readini(credentials.ini,local.spcn,credentials),1,32) 04]1 | connect SPCN  }
  if ($readini(credentials.ini,local.DCN,credentials)) { echo -a 01.. 04[01 Connecting to DCN 04]1 .. 04[1 Stored Passport: $gettok($readini(credentials.ini,local.dcn,credentials),1,32) 04]1 | .timer 1 5 connect DCN }
  if ($readini(credentials.ini,local.ecn,credentials)) { echo -a 01.. 04[01 Connecting to ECN 04]1 .. 04[1 Stored Passport: $gettok($readini(credentials.ini,local.ecn,credentials),1,32) 04]1  | .timer 1 8 connect ECN }
  if ($readini(credentials.ini,local.evo,credentials)) { echo -a 01.. 04[01 Connecting to EVOLUTION (EVO) 04]1 .. 04[1 Stored Passport: $gettok($readini(credentials.ini,local.evo,credentials),1,32) 04]1  | .timer 1 11 connect EVO }
}
alias hop { var %network $repnet  | sockwrite -n $+($iif($1,$1,$active),$remove(%network,LOCAL)) PART $iif($1,$1,$active) | sockwrite -n $+($iif($1,$1,$active),$remove(%network,LOCAL)) JOIN $iif($1,$1,$active) | haltdef }


Comments 5

danger - Friday, 30 October, 2020
if you do it any other way than a fake raw to localhost you've connected it stays associated with the server that initated the sockopen not the server youve faked the connection to causes alsorts of issues with room reading and nicknames
Kevin - Friday, 30 October, 2020
I have removed $pos, as anyone who does not understand the connection should not make changes. Thanks Danger. Updated.
danger - Friday, 30 October, 2020
and sockopen should be on a raw read you localhost on local connet so $me will be correct if you aint same nick on all servers
danger - Friday, 30 October, 2020
Bro using $pos for what should only be an == is gonna slow shit right down also the most mirc is ever going to recieve is 990 characters in one line which makes binary read and while loop worthless as mirc can handle 4096 characters in one line and sockre
Kevin - Friday, 30 October, 2020
Enjoy, if you wish to add other networks and require additional assistance dont hesitate to let me know. You can find me on SPCN.

Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand