eXtreme — File Browser
xtreme_s / xtreme_s / sys / socks2.ini
socks2.ini — 46.37 KB — Download this file
[script]
n0=;xxxxxxxxxxxxxxxxxxxxxxx
n1=; extreme v8.21
n2=; sockets (2)
n3=;xxxxxxxxxxxxxxxxxxxxxxx
n4=;
n5=;identd server
n6=alias _identd if ($1 == off) { sockclose identdl | .timeridentdl off | return } | elseif ($portfree(113)) socklisten identdl 113 | .timeridentdl 1 60 sockclose identdl
n7=on 1:socklisten:identd*:sockaccept identda. $+ $rand(100,999) | if ($sock(identda.*,0) >= 30) sockclose identd*
n8=on 1:sockread:identda.*:var %i | sockread %i | var %1 = $+($gettok(%i,1,44)), %2 = $+($gettok(%i,2,44)), %id = $iif($hget(x_mserver,user),$ifmatch,xtreme) | if (%1 isnum) && (%2 isnum) _sw $sockname %2 $+ , %1 : USERID : UNIX : %id | .timer 1 5 sockclose $sockname
n9=
n10=;portscan
n11=dialog pscan {
n12= title "Port Scan v3.5"
n13= size -1 -1 302 400
n14= icon graphics\telnet.ico
n15= text "Host", 1, 5 5 25 15
n16= edit "127.0.0.1", 2, 32 2 198 20, autohs
n17= text "Start port", 3, 5 26 50 15
n18= edit "1", 4, 55 23 50 20, autohs
n19= text "Stop port", 5, 5 46 50 15
n20= edit "65535", 6, 55 43 50 20, autohs
n21= text "Delay-(ms)", 7, 125 26 55 15
n22= edit "50", 8, 180 23 50 20, autohs
n23= text "Open socks", 9, 115 46 62 15
n24= edit "0", 10, 180 43 50 20, autohs disable
n25= button "Start", 12, 235 9 60 20
n26= button "Halt", 11, 235 28 60 20
n27= button "Close", 17, 235 47 60 20
n28= list 13, 5 90 290 265, extsel
n29= check "Save to", 14, 5 353 62 15
n30= edit "", 15, 65 350 230 20, autohs
n31= button "Clear window", 16, 100 375 80 20
n32= check "Use ports from file", 18, 7 70 105 15
n33= edit "sys\ports.txt", 19, 115 67 105 20, autohs disable
n34= button "!", 20, 220 68 10 18, disable
n35= button "", 56, 0 0 0 0, ok
n36=}
n37=on 1:dialog:pscan:*:*:{
n38= if ($devent == init) {
n39= did -ra pscan 15 sys\scanlog.log
n40= if ($numtok($cb,32) == 1) && ($isserv($cb)) && ($cb != $did(2)) did -ra pscan 2 $cb
n41= pscan.sv Portscan ready.
n42= }
n43= if ($devent == sclick) {
n44= if ($did == 12) && ($sock(pscan.*,0) == 0) {
n45= if ($isserv($did(2))) {
n46= sockclose pscan.*
n47= did -ra pscan 17 Reset
n48= did -b pscan 2,4,6,8,14,15
n49= .timerpscan.socks -o 0 1 pscan.sockupd
n50= if ($did(18).state) && ($read($did(pscan,19),1) isnum) did -ra pscan 4 $ifmatch
n51= pscan.sv Scanning host ( $+ $did(2) $+ )
n52= pscan.sv Scan begun on port ( $+ $did(4) $+ )
n53= .timerpscan.uncon -o 1 5 pscn.uncon
n54= pscan.open $did(2) $did(4) $did(8) 1 $lines($did(19))
n55= }
n56= else sr Missing/invalid hostname
n57= }
n58= if ($did == 11) && ($sock(pscan.*,0)) { pscan.sv Scan halted on port ( $+ $did(4) $+ ) | pscn.end }
n59= if ($did == 17) {
n60= if ($sock(pscan.*,0)) {
n61= pscan.sv All sockets closed.
n62= sockclose pscan.*
n63= .timerpscan.uncon -o 1 3 pscn.uncon
n64= }
n65= else dialog -k pscan
n66= }
n67= if ($did == 16) did -r pscan 13
n68= if ($did == 18) {
n69= if ($did(18).state) { did -b pscan 4,6 | did -e pscan 19,20 }
n70= else { did -e pscan 4,6 | did -b pscan 19,20 }
n71= }
n72= if ($did == 20) && ($isfile($did(19))) run notepad $did(19)
n73= }
n74=}
n75=alias pscan _dialog -dm pscan pscan
n76=alias -l pscan.open {
n77= if (!$dialog(pscan)) { pscn.end | return }
n78= var %lsock = $calc($2 - 80), %4 = $calc($4 +1)
n79= if ($sock(pscan.*,0) >= 80) && ($sock( [ pscan. [ $+ [ %lsock ] ] ] ).status == connecting) sockclose pscan. $+ %lsock
n80= if ($2 isnum 1-65535) sockopen pscan. $+ $2 $1-2
n81=
n82= if ($did(pscan,18).state) { if (%4 <= $5) var %next = $read($did(pscan,19),%4) }
n83= elseif ($calc($2 +1) <= $did(pscan,6)) var %next = $ifmatch
n84=
n85= if (%next) { did -ra pscan 4 %next | .timerpscan. $+ %4 -om 1 $3 pscan.open $1 %next $3 %4 $5 }
n86= else { pscan.sv Scan ended on port ( $+ $2 $+ ) | pscn.end 10 }
n87=}
n88=alias -l pscan.sockupd if ($dialog(pscan)) did -ra pscan 10 $sock(pscan.*,0) | else pscn.end
n89=alias -l pscan.sv did -a pscan 13 $1- | if ($did(pscan,14).state == 1) && ($did(pscan,15)) write $shortfn($nofile($did(pscan,15))) $+ $nopath($did(pscan,15)) $1-
n90=alias -l pscn.end .timer 1 $iif($1 isnum,$1,0) sockclose pscan.* | .timerpscan.* off | if ($dialog(pscan)) { did -ra pscan 10 0 | did -ra pscan 17 Close | did -e pscan 2,4,6,8,14,15 }
n91=alias -l pscn.uncon if ($sock(pscan.*,0) <= 1) { sr -t Error Unable to connect | pscn.end }
n92=
n93=on 1:sockopen:pscan*:if ($sockerr) return | pscan.sv $sock($sockname).port :CONNECTED | .timer $+ $sockname -o 1 10 sockclose $sockname
n94=on 1:sockclose:pscan*:pscan.sv $sock($sockname).port :CLOSED
n95=on 1:sockread:pscan*:{
n96= if ($sockerr) return
n97= :next
n98= var %s | sockread %s | if ($sockbr == 0) return
n99= var %len = $calc(%len + $len(%s))
n100= if (%len > 500) { pscan.sv $sock($sockname).port :CLOSED (flooding) | sockclose $sockname | return }
n101= if (!%s) var %s -
n102= pscan.sv $sock($sockname).port : $+ %s
n103= goto next
n104=}
n105=
n106=
n107=;portlisten
n108=alias pl _dialog -dm plisten plisten
n109=alias plisten {
n110= if ($1 == close) { sockclose pl.* | echo -qs (Portlisten) All sockets closed | return }
n111= if ($1 == start) { if ($hget(x_plisten,onstart) != 1) || (!$2) return | sle Initializing portlistener... ( $+ $numtok($2,44) ports) | .timer 1 0 .plisten $2 | return }
n112= var %n = $numtok($1,44)
n113= while (%n) {
n114= var %tok = $gettok($1,%n,44), %p = $gettok(%tok,2,58), %pr = $gettok(%tok,1,58) | if (%p !isnum 1-65536) { if ($show) sle Invalid port %p | goto next }
n115= if ($sock($+(pl.,%pr,.,%p))) goto next | if ($portfree(%p) == $false) { echo -qs (Portlisten) Port already in use %p | goto next }
n116= if (%pr == tcp) _scklt pl.tcp. $+ %p %p | else _scklu pl.udp. $+ %p %p
n117= if ($dialog(plisten)) { did -a plisten 1 $lower(%pr) $+ : $+ %p | did -r plisten $iif(%pr == tcp,4,5) | did -b plisten $iif(%pr == tcp,2,3) }
n118= else echo -qs (Portlisten) Watching port %p for $upper(%pr) connections/scans
n119= :next | dec %n
n120= }
n121=}
n122=alias -l _scklt if (!$sock($1)) && ($portfree($2)) socklisten $1-
n123=alias -l _scklu if (!$sock($1)) && ($portfree($2)) sockudp -k $1-
n124=alias -l __srefresh did -r plisten 1 | var %t = $sock(pl.*,0) | while (%t) { did -a plisten 1 $gettok($sock(pl.*,%t),2,46) $+ : $+ $sock(pl.*,%t).port | dec %t }
n125=alias -l _updlog if ($dialog(plisten)) { did -r plisten 22 | var %l = $hget(x_plisten,log), %n = 1 | while (%n <= $numtok(%l,59)) { var %a = $gettok(%l,%n,59) | did -a plisten 22 $asctime($gettok(%a,1,45),[dd/mm HH:nn:ss]) $replace($gettok(%a,2,45),.,:) by $gettok(%a,3,45) | inc %n } | did -z plisten 22 }
n126=alias -l _slog var %f = $$sfile(logs\connects.log,Enter logfile), %n = 1 | while (%n <= $did(plisten,22).lines) { .write $_sfn(%f) $did(plisten,22,%n) | inc %n } | did -f plisten 25 | sr Log saved to logs\connects.log
n127=dialog plisten {
n128= title "Port Listener v2.2"
n129= size -1 -1 300 260
n130= icon graphics\telnet.ico
n131= tab "Setup", 101, 5 5 290 220
n132= tab "Attempts", 102
n133= list 10, 205 50 80 150, sort tab 101
n134= list 1, 15 50 80 150, sort tab 101
n135= text "TCP", 8, 100 63 23 15, tab 101
n136= text "UDP", 9, 100 88 23 15, tab 101
n137= button "add", 2, 170 63 28 14, disable tab 101
n138= button "add", 3, 170 88 28 14, disable tab 101
n139= edit "", 4, 125 60 40 20, tab 101
n140= edit "", 5, 125 85 40 20, tab 101
n141= button "Close", 12, 100 183 50 15, tab 101
n142= button "Close all", 49, 100 198 50 15, tab 101
n143= button "<--", 11, 120 130 60 15, tab 101
n144= button "refresh", 13, 17 198 76 15, tab 101
n145= check "add to list", 14, 207 198 76 15, push tab 101
n146= text "Listening:", 16, 15 35 50 15, tab 101
n147= text "Ports:", 17, 205 35 50 15, tab 101
n148= text "Connection Attempts:", 21, 20 35 105 15, tab 102
n149= list 22, 15 50 270 150, tab 102 hsbar
n150= button "clear", 23, 245 198 40 14, tab 102
n151= button "save", 25, 205 198 40 14, tab 102
n152= button "clip", 24, 165 198 40 14, tab 102
n153= check "Active on startup", 6, 5 225 120 15, right
n154= check "Pop up warning dialog", 15, 5 240 130 15, right
n155= button "Ok", 50, 220 235 50 20, ok default
n156=}
n157=on 1:socklisten:pl.tcp.*:{
n158= sockaccept $sockname $+ a
n159= flash WARNING
n160= var %ip = $sock( [ $sockname $+ a ] ).ip
n161= _set plisten log $qtok($hget(x_plisten,log),$+($ctime,-,$right($upper($sockname),-3),-,%ip),14,59)
n162= sae ( $+ $_c(2) $+ WARNING $+ ) TCP port $sock($sockname).port reached by %ip $iif($server,(Press CtrlF7 to look for offender))
n163= set -u60 %§.iptrace.ip %ip
n164= if (!$hget(x_plisten,nopopup)) sr -t Warning TCP connection attempt detected $+ $crlf $+ on port $sock($sockname).port $+ $crlf $+ %ip
n165= sj 19
n166= .timer 1 10 _scklt $sockname $sock($sockname).port
n167= sockclose $sockname $+ *
n168= _updlog
n169=}
n170=on 1:udpread:pl.udp.*:{
n171= flash WARNING
n172= var %ip = $iif($sock($sockname).saddr,$sock($sockname).saddr,<n/a>)
n173= _set plisten log $qtok($hget(x_plisten,log),$+($ctime,-,$right($upper($sockname),-3),-,%ip),14,59)
n174= sae ( $+ $_c(2) $+ WARNING $+ ) UDP port $sock($sockname).port reached by %ip $iif(($server && $sock($sockname).saddr),(Press CtrlF7 to look for offender))
n175= if ($sock($sockname).saddr) set -u60 %§.iptrace.ip $ifmatch
n176= if (!$hget(x_plisten,nopopup)) sr -t Warning UDP packet detected $+ $crlf $+ on port $sock($sockname).port $+ $crlf $+ %ip
n177= sj 19
n178= .timer 1 10 _scklu $sockname $sock($sockname).port
n179= sockclose $sockname
n180= _updlog
n181=}
n182=on 1:dialog:plisten:*:*:{
n183= if ($devent == init) { if ($hget(x_plisten,list)) didtok plisten 10 44 $hget(x_plisten,list) | else didtok plisten 10 44 tcp:21,tcp:23,tcp:25,tcp:59,tcp:80,tcp:139,tcp:1024,tcp:8080,tcp:12345,udp:31337 | __srefresh | if ($hget(x_plisten,onstart)) did -c plisten 6 | if (!$hget(x_plisten,nopopup)) did -c plisten 15 | _updlog }
n184= if ($devent == edit) { if ($did(4) isnum 1-65536) did -e plisten 2 | else did -b plisten 2 | if ($did(5) isnum 1-65536) did -e plisten 3 | else did -b plisten 3 }
n185= if ($devent == dclick) && ($did == 10) plisten $did(10).seltext
n186= if ($devent == sclick) {
n187= if ($did == 2) { if ($did(14).state) { did -a plisten 10 tcp: $+ $did(4) | did -r plisten 4,5 | did -b plisten 2,3 } | else plisten tcp: $+ $did(4) }
n188= if ($did == 3) { if ($did(14).state) { did -a plisten 10 udp: $+ $did(5) | did -r plisten 4,5 | did -b plisten 2,3 } | else plisten udp: $+ $did(5) }
n189= if ($did == 11) && ($did(10).sel) plisten $did(10).seltext
n190= if ($did == 12) { if ($did(14).state) && ($did(10).sel) did -d plisten 10 $did(10).sel | elseif ($did(1).sel) { sockclose pl. $+ $gettok($did(1).seltext,1,58) $+ . $+ $gettok($did(1).seltext,2,58) | did -d plisten 1 $did(1).sel } }
n191= if ($did == 13) __srefresh
n192= if ($did == 14) { if ($did(14).state) { did -b plisten 1,6,11,13,49 | did -ra plisten 12 Remove } | else { did -e plisten 1,6,11,13,49 | did -ra plisten 12 Close } }
n193= if ($did == 23) { _unset plisten log | did -r plisten 22 }
n194= if ($did == 24) && ($did(22).sel) clipboard $did(22).seltext
n195= if ($did == 25) && ($did(22).lines) _slog
n196= if ($did == 49) { sockclose pl.* | __srefresh }
n197= if ($did == 50) {
n198= if ($did(6).state) _set plisten onstart 1 | else _unset plisten onstart
n199= if ($did(15).state) _unset plisten nopopup | else _set plisten nopopup 1
n200= var %n = $did(1).lines | while (%n) { var %l = $addtok(%l,$did(1,%n),44) | dec %n }
n201= var %n = $did(10).lines | while (%n) { var %l2 = $addtok(%l2,$did(10,%n),44) | dec %n }
n202= if (%l) _set plisten ports %l | else _unset plisten ports | if (%l2) _set plisten list %l2 | else _unset plisten list
n203= }
n204= }
n205=}
n206=
n207=
n208=;nickfinder
n209=alias nfind if ($1) && ($hget(x_misc,nfind)) _nfind $1 $ifmatch | elseif (!$dialog(nfind)) { _loadservers | _dialog -m nfind nfind }
n210=alias -l _nfind {
n211= var %w = $w($1)
n212= if ($window(%w)) window -c %w
n213= sockclose $+(nf-,$1,-*)
n214= var %l = $hget(x_misc,nfind), %n = $numtok(%l,172)
n215= window -kl -t25 %w $_gcoord(nickfinder,-1 -1 400 200) @nfind $_@font
n216= aline %w $_nchr(%w) | aline %w $_c(1) $+ Server $chr(9) $_c(1) $+ Status
n217= aline %w $_nchr(%w)
n218= _identd
n219= while (%n) {
n220= var %m = $gettok(%l,%n,172)
n221= aline %w $gettok(%m,1,32) $chr(9) waiting for reply
n222= _conn $1 $gettok($gettok(%m,1,32),2,58) $gettok(%m,2,32)
n223= dec %n
n224= }
n225=}
n226=alias -l w return @NickFinder results for $+ $1
n227=alias -l _conn if ($2) { var %s = $+(nf,$1,,$2) | if ($sock(%s)) sockclose %s | sockopen %s $2 $iif($3,$3,6667) | .timer $+ %s -o 1 90 _nfcancl %s }
n228=alias -l _nfcancl if ($sock($1)) { var %w = $w($gettok($1,2,173)) | sockclose $1 | if ($window(%w)) titlebar %w (timeout) }
n229=alias -l _result var %w = $w($gettok($sockname,2,173)) | if ($window(%w)) _res2 $gettok($sockname,-1,173) $1- | .timer $+ $sockname off | sockclose $sockname
n230=alias -l _res2 var %w = $w($gettok($sockname,2,173)) | if ($fline(%w,$+(*:,$1,*))) { var %n = $ifmatch | if ($2 == -) var %l = error | elseif ($2 == +) var %l = not there | else var %l = $iif($2,$2,$gettok($sockname,2,173)) ( $+ $iif($3,$3,no chans) $+ ) | rline %w %n $gettok($line(%w,%n),1,9) $chr(9) %l } | window -b %w | if (!$fline(%w,*waiting for reply*)) { titlebar %w (completed) | window -r %w }
n231=dialog nfind {
n232= title "Global nick finder"
n233= size -1 -1 360 215
n234= icon graphics\users1.ico
n235= combo 1, 11 50 240 200, drop edit
n236= combo 2, 258 50 50 150, drop edit
n237= list 3, 10 70 300 130, sort
n238= text "Nick", 4, 92 15 25 15
n239= edit "", 5, 120 12 120 20
n240= button "Add", 40, 310 73 40 17
n241= button "Del", 41, 310 90 40 17
n242= box "", 20, 5 35 350 150
n243= button "Search", 50, 115 190 55 20, default
n244= button "Cancel", 51, 180 190 55 20, cancel
n245=}
n246=on 1:dialog:nfind:*:*:{
n247= if ($devent == init) {
n248= didtok nfind 2 44 6667,6668,6669,7000,7001,7002 | did -c nfind 2 1 | if ($hget(x_misc,nfind)) didtok nfind 3 172 $ifmatch
n249= var %n = 1 | while ($hget(x_servers,%n)) { did -a nfind 1 $ifmatch | inc %n } | hfree x_servers | did -c nfind 1 1 | did -f nfind 5
n250= }
n251= if ($devent == sclick) {
n252= if ($did == 40) && ($did(1)) did -a nfind 3 $iif(: isin $did(1),$did(1),$iif($server($did(1)).group,$+($server($did(1)).group,:,$did(1)),$+(none:,$did(1)))) $iif($did(2),$did(2),6667)
n253= if ($did == 41) && ($did(3).sel) did -d nfind 3 $did(3).sel
n254= if ($did == 50) {
n255= if ($did(3).lines) _set misc nfind $didtok(3,172) | else _unset misc nfind
n256= if ($did(5)) && ($did(3).lines) { _nfind $did(5) | dialog -x nfind } | else { sr -t Error Parameters missing | did -f nfind 5 }
n257= }
n258= }
n259=}
n260=on 1:close:@NickFinder *:_savecoords $target | var %n = $gettok($target,-1,160) | sockclose $+(nf,%n,*) | .timer $+ $+(nf,%n,*) off
n261=menu @nfind {
n262= $iif($sline($active,1),connect to server):if (!$server) || (($server) && ($input(This will disconnect you from current server $+ $crlf $+ Are you sure?,8))) server $gettok($gettok($1,1,9),2,58)
n263= $iif($sline($active,1),connect (multiserver)):mserv $me $gettok($gettok($1,1,9),2,58)
n264= $iif($sline($active,1),remote query):if ($chr(40) isin $1-) { var %w = $wildtok($1-,*!*@*,1,32), %w = $iif(%w,%w,$gettok($gettok($1-,2,9),1,32)) | if (%w) ms.remote.query $gettok(%w,1,33) $+(r,$rand(1,9),_,$me) $gettok($gettok($1,1,9),2,58) }
n265= -
n266= $iif($sline($active,1),clipboard):clipboard $strip($replace($1-,$chr(9),$chr(32)))
n267= -
n268= close:_closewin $active
n269=}
n270=on 1:sockopen:nf*:if ($sockerr) _result - | _sw NICK $randnick $+ $crlf $+ USER $randnick " $+ $iif($host,$host,localhost) $+ " " $+ $iif($ip,$ip,127.0.0.1) $+ " :finder
n271=on 1:sockclose:nf*:_result -
n272=on 1:sockread:nf*:{
n273= if ($sockerr) return | var %nf | sockread %nf | if ($sockbr == 0) return | tokenize 32 %nf
n274= if ($2 isnum) {
n275= if ($2 == 513) && (/ isin $1-) _sw $remove($gettok(%nf,-1,47),quote,raw)
n276= elseif ($2 == 376) _sw WHOIS $gettok($sockname,2,173)
n277= elseif ($2 == 311) _smark 1 $+($4,!,$5,@,$6)
n278= elseif ($2 == 319) _smark 2 $replace($remove($5-,:),$chr(32),$chr(44))
n279= elseif ($2 == 318) _result $replace($_smark(1-),$chr(176),$chr(32))
n280= elseif ($2 == 401) _result +
n281= }
n282= elseif ($1 == ping) _sw PONG $2-
n283=}
n284=
n285=
n286=;chatx
n287=alias chatx if ($1) && (($server) || ($chat($1))) _reqchatx1 $1 $iif(!$server,1)
n288=alias _reqchatx1 if ((!$2) && ($server)) || ($2) { if ($1 == $me) && ($server) { sr -t ChatX Chat with yourself? :P | return } | var %d = $+(chatx.,$1) | if ($sock(%d)) { sr -t Info Session already open. | halt } | if ($dialog(%d)) dialog -x %d | var %p = $rand(10000,15000) | socklisten $+(chatx_l.,$1) %p | $iif($2,.msg $+(=,$1) ,rawnotice $1) CHATX REQUEST $longip($myip) %p | .timer -o 1 30 chatxtimeout $1 | _chatx $1 | did -a $+(chatx.,$1) 2 *** Waiting for $1 $+ ... $crlf }
n289=alias _reqchatx2 if ($input(ChatX requested by $+ $crlf $+ $1 ( $+ $longip($2) $+ ) $+ $crlf $+ Accept?,8,DCC Chat)) { sockopen $+(chatx.,$1) $longip($2) $3 | _chatx $1 | did -a $+(chatx.,$1) 2 *** Connecting to $1 $+ ... $crlf }
n290=alias chatxtimeout if ($sock($+(chatx_l.,$1))) { sockclose $+(chatx_l.,$1) | se *** ChatX connection refused/timed out | if ($dialog($+(chatx.,$1))) dialog -x $ifmatch }
n291=alias chatxflash if ($dialog($1).active) { dialog -t $1- | .timerxflash off | return } | if ($dialog($1).title == [message waiting]) dialog -t $1- | else dialog -t $1 [message waiting]
n292=alias -l _chatx var %d = $+(chatx.,$1) | if ($dialog(%d)) dialog -x %d | dialog -dm %d chatx | dialog -t %d $1 | did -ra %d 12 Local: $me | did -ra %d 13 Remote: $1
n293=alias -l _did if ($dialog($2)) did $1- | else sockclose $2
n294=alias -l _estb _did -a $1 2 *** Connection established $crlf $+ $str(-,45) $crlf | _did -n $1 1 | sj 7
n295=alias -l _rectf var %e = $gettok($did($sockname,2,$calc($1 -1)),-1,32) | if ($+(%e,*) iswm $did($sockname,2,$1)) did -o $sockname 2 $calc($1 -1) $deltok($did($sockname,2,$calc($1 -1)),-1,32)
n296=dialog chatx {
n297= size -1 -1 400 410
n298= icon graphics\chatx.ico
n299= edit "", 1, 10 30 380 150, read multi return autovs vsbar
n300= edit "", 2, 10 210 382 150, read multi return autovs vsbar
n301= text "", 12, 12 16 150 15
n302= text "", 13, 12 196 150 15
n303= button "Disconnect", 50, 170 385 80 20
n304= box "", 20, 2 3 395 375
n305= box "", 21, 2 3 395 193
n306= button "", 51, 0 0 0 0, ok
n307= button "save", 52, 10 380 40 15, disable
n308=}
n309=on 1:dialog:chatx.*:sclick:*:{
n310= if ($did == 10) did -r $dname 1
n311= if ($did == 11) did -r $dname 2
n312= if ($did == 52) { var %ni = $gettok($dialog($dname).title,3,32), %n = 1, %i = 0 | :i | inc %i | while (%n <= $did(%i).lines) { .write $+(logs\chatx-,%ni,.log) $did(%i,%n) | inc %n } | .write $+(logs\chatx-,%ni,.log) $str(=,50) | if (%i < 2) goto i | did -a $dname 2 *** Log saved to chatx- $+ %ni $+ .log | did -b $dname 52 }
n313= if ($did == 50) { if ($sock($dname)) { sockclose $dname | did -ra $dname 50 Close | did -m $dname 1 | did -a $dname 2 $str(-,45) $crlf $+ *** Connection terminated $crlf | if ($did(2).lines > 6) did -e $dname 52 } | else dialog -x $dname }
n314=}
n315=on 1:dialog:chatx.*:edit:1:_sw $dname $calc($did(1,1).sel + 3) $did(1,$did(1,1).sel)
n316=on 1:socklisten:chatx_l.*:var %s = $+(chatx.,$gettok($sockname,2,46)) | sockaccept %s | sockclose $sockname | _estb %s
n317=on 1:sockopen:chatx.*:_estb $sockname
n318=on 1:sockclose:chatx.*:_did -m $sockname 1 | _did -a $sockname 2 $str(-,45) $crlf $+ *** Connection terminated $crlf | _did -ra $sockname 50 Close | if ($did($sockname,2).lines > 6) _did -e $sockname 52
n319=on 1:sockread:chatx.*:var %t | sockread %t | if ($sockbr == 0) return | if (!$gettok(%t,2,32)) { _did -d $sockname 2 %t | if ($dialog($sockname).active == $false) && (!$timer(xflash)) { beep 3 100 | .timerxflash -m 10 500 chatxflash $sockname $dialog($sockname).title } } | _did -o $sockname 2 %t | _rectf $gettok(%t,1,32) | _did -c $sockname 2 $gettok(%t,1,32)
n320=;
n321=;bnc server
n322=alias bnc if ($1 == off) { bnc.close | return } | if ($sock(bnc.l)) || ($sock(bnc.a)) || ($portfree($1) != $true) { echo -qs $_bnc Socket in use. | return } | if ($1) { socklisten bnc.l $1 | unset %§..bnc.* | set %§..bnc.port $1 | if ($2) set %§..bnc.pass $2 | echo -qs $_bnc Listening for connections on port $1 ( $+ $ip $+ ), pass $iif($2,$2,n/a) $+ | else se $_bnc Reactivating BNC. | unset %§.bnc.* | if ($3) set %§.bnc.spy 1 | set %§.bnc.args $1- } | else se $_bnc Usage: /bnc <off|port> [pass]
n323=alias -l _bnc return (BNC)
n324=alias -l bnc.conn .timerbnc.c off | sockclose bnc.l | _identd | sockopen bnc.serv $1 $iif($2,$2,6667) | _sw bnc.a NOTICE nick :Redirecting to $1- | se $_bnc Connection established between client $sock(bnc.a).ip and server $1 | if (%§.bnc.spy) { unset %§.bnc.spy | window -nk +e @spy -1 -1 400 200 $_@font }
n325=alias -l bnc.close .timerbnc.c off | sockclose bnc.* | if ($window(@spy)) aline @spy $_c(1) $+ Connection terminated | echo -qs $_bnc Disabled (all ports closed) | if ($1) { .timer -o 1 10 .bnc %§.bnc.args | .timerbnc1 off | .timerbnc2 off } | else unset %§.bnc.*
n326=on 1:sockclose:bnc.a:se $_bnc Connection to client lost | sockclose bnc.serv | .timerbnc1 -o 1 5 .bnc %§.bnc.args
n327=on 1:sockclose:bnc.serv:se $_bnc Connection to server lost | sockclose bnc.a | .timerbnc2 -o 1 5 .bnc %§.bnc.args
n328=on 1:socklisten:bnc.l:sockaccept bnc.a | sockclose bnc.l | se $_bnc Connection requested from $+ $sock(bnc.a).ip $+ | if (%§..bnc.pass) _sw bnc.a NOTICE nick :type /quote PASS <pass> | else _sw bnc.a NOTICE nick :type /quote CONN <server> [port] | .timerbnc.c -o 1 30 bnc.close 1
n329=on 1:sockopen:bnc.serv:if ($sockerr) return | _sw bnc.serv %§.bnc.log | unset %§.bnc.log %§.bnc.accept %§..bnc.* | set %§.bnc.connected 1
n330=on 1:sockread:bnc.serv:if ($sockerr) return | var %b | :n | sockread %b | if ($sockbr == 0) return | _sw bnc.a %b | if ($window(@spy)) aline @spy -> %b | goto n
n331=on 1:sockread:bnc.a:{
n332= var %bf, %bf1 | :n | if ($sockerr) || (!$sock($sockname)) return | sockread %bf | if (!%bf) return | if ($window(@spy)) aline @spy %bf | %bf1 = $gettok(%bf,1,32)
n333= if (%bf1 == pass) { if ($gettok(%bf,2,32) == %§..bnc.pass) { set -u30 %§.bnc.accept 1 | _sw bnc.a NOTICE nick :type /quote CONN <server> [port] } | else { se $_bnc Failed authentication | bnc.close 1 } }
n334= elseif (%bf1 == conn) && ((%§.bnc.accept) || (!%§..bnc.pass)) { if ($gettok(%bf,2,32)) bnc.conn $gettok(%bf,2-3,32) | else sockclose bnc.a }
n335= elseif (%bf1 == NICK) set %§.bnc.log %bf
n336= elseif (%bf1 == USER) set %§.bnc.log %§.bnc.log $+ $crlf $+ %bf
n337= if (%§.bnc.connected) { _sw bnc.serv %bf | if ($istok(%bf,QUIT,32)) { se $_bnc QUIT command received. | .bnc.close 1 | return } }
n338= goto n
n339=}
n340=
n341=
n342=;get
n343=alias get {
n344= if (!$1) { .timer 1 0 get $inp(Enter complete URL~HTTP Downloader~$iif($isserv($cb),$ifmatch,http://),1) | return }
n345= var %1 = $remove($1,http://), %f = $gettok($1,-1,47), %s = $gettok($gettok(%1,1,47),1,58), %p = $gettok($gettok(%1,1,47),2,58)
n346= if ($sock($+(get,%f))) { sr -t Error Already downloading %f | return }
n347= if ($isfile($+(download\,%f))) {
n348= if (!$input(File already exists. $+ $crlf $+ Continue?,8)) return
n349= if ($input(Overwrite? ('no' to resume),8)) .remove download\ $+ %f
n350= }
n351= sockopen get $+ %f %s $iif(%p,%p,80)
n352= if (!%§.counter) echo -qs $g Connecting... | sockmark get $+ %f $+(http://,%1) $+ °0°0°0°0°0°0°0
n353= _set misc recgets $qtok($hget(x_misc,recgets),$+(http://,%s,$iif(%p,$+(:,%p,/),/),$gettok($1,3-,47)),6,44)
n354=}
n355=alias -l g return (Get)
n356=alias -l _kbps if ($1) { var %b = $round($calc(($2 /1000) / ($ctime - $1)),2), %c = $int($calc(($3 - $2) / (%b * 1000))) | if (%b) return %b $+ kb/s ( $+ $duration(%c) left) }
n357=alias -l get.ccl se $g Download of $gettok($1,-1,173) canceled. | sockclose $1 | if ($dialog($1)) dialog -k $1 | .remove download\ $+ $gettok($1,-1,173) | halt
n358=alias -l get.over {
n359= var %g = $gettok($sockname,2,173)
n360= if (($_smark(5) >= $_smark(3)) && ($_smark(5) > 0)) || ($_smark(3) == 0) {
n361= if (!%§.counter) se $g Download of %g complete
n362= if (patch*.zip iswm %g) .timer 1 0 _installpatch %g
n363= if ($dialog($sockname)) dialog -x $sockname
n364= }
n365= elseif (!%§.counter) se $g Download error
n366= else _--unset status counter
n367= sockclose $sockname
n368= unset %§.counter
n369= halt
n370=}
n371=on 1:close:@get*:if ($sock($remove($target,@))) get.ccl $ifmatch
n372=on 1:sockclose:get*:get.over
n373=on 1:sockread:get*:{
n374= if ($sockerr) { se $g Download error. | return } | var %sw = $sockname | :read | if ($sock($sockname).status != active) return
n375= if ($_smark(7) == 0) {
n376= var %s | sockread %s | if (%debug) _wecho %s
n377= if ($rt(HTTP/* 4*) iswm %s) || ($rt(HTTP/* 5*) iswm %s) _smark 2 $gettok(%s,2-,32)
n378= elseif (content-length:* iswm %s) _smark 3 $gettok(%s,2,32)
n379= elseif (content-type:* iswm %s) _smark 4 $iif(text/ isin %s,txt,bin)
n380= ; elseif ($rt(HTTP/* 30*) iswm %s) _smark 8 1
n381= ; elseif (location:* iswm %s) && ($_smark(8)) { var %f = $gettok($_smark(1),-1,47), %u = $gettok(%s,2-,32), %h = $iif(%f isin %s,%u,$+(%u,$gettok($_smark(1),3-,47))) | .timer 1 0 .get %h | sockclose $sockname }
n382= if (!%s) {
n383= if ($_smark(2) == 0) {
n384= if (!%§.counter) se $g Socket connected, downloading file. | else return | if ($dialog(%sw)) dialog -x %sw | dialog -dm %sw getd
n385= .timer_updget. $+ %sw -o 1 1 _updget %sw | dialog -ti %sw $gettok(%sw,-1,173)
n386= did -ra %sw 2 $_smark(1) | did -ra %sw 3 download\ $+ $gettok(%sw,-1,173) | did -ra %sw 4 $iif($_smark(3),$bytes($_smark(3),3).suf,<unknown>) | did -ra %sw 5 0b | if ($_smark(3) == 0) did -ra %sw 6 <unknown>
n387= _smark 7 $sock($sockname).rcvd | _smark 6 $ctime
n388= }
n389= else { if ($_smark(2)) sr -t HTTP Downloader Error $+ $crlf $+ ' $+ $_smark(2) $+ ' | else sr -t HTTP Downloader Unable to download | sockclose %sw }
n390= return
n391= }
n392= goto read
n393= }
n394= if (!$dialog(%sw)) get.ccl %sw | if ($_smark(5) >= $_smark(3)) && ($_smark(5) > 0) get.over
n395= if ($_smark(4) == bin) { sockread &get | bwrite download\ $+ $gettok(%sw,2,173) -1 $bvar(&get,0) &get }
n396= else { var %get | sockread %get | .write download\ $+ $gettok(%sw,2,173) $iif(%get,%get,$lf) }
n397= _smark 5 $calc($sock(%sw).rcvd - $_smark(7))
n398= if ($sockbr == 0) return | goto read
n399=}
n400=alias -l _updget {
n401= if ($sock($1)) && ($dialog($1)) {
n402= if ($_smark($1,3)) {
n403= dialog -t $1 $gettok($1,2,173) $_sperc($_smark($1,5),$_smark($1,3))
n404= did -ra $1 6 $_kbps($_smark($1,6),$_smark($1,5),$_smark($1,3))
n405= did -a $1 1 $_smark($1,5) 0 $_smark($1,3)
n406= }
n407= did -ra $1 5 $bytes($_smark($1,5),3).suf
n408= .timer_updget. $+ $1 -o 1 1 _updget $1
n409= }
n410=}
n411=on 1:sockopen:get*:{
n412= if ($sockerr) { if (%§.counter) _--unset status counter | else sr -t HTTP Downloader Error $+ $crlf $+ ' $+ $_sockerr $+ ' | unset %§.counter | return }
n413= var %s = $sockname, %f = download\ $+ $gettok(%s,2,173)
n414= _sw %s GET / $+ $gettok($_smark(1),3-,47) HTTP/1.0
n415= _sw %s HEAD http:// $+ $gettok($_smark(1),2,47) HTTP/1.0
n416= _sw %s Accept: */*
n417= _sw %s User-Agent: $hget(x_status,script1) $xtreme.ver
n418= if ($file(%f).size > 0) _sw %s Range: bytes= $+ $file(%f).size $+ -
n419= _sw %s Host: $gettok($_smark(1),2,47) $+ : $+ $sock($sockname).port
n420= _sw %s Connection: Keep-Alive
n421= _sw %s $lf
n422=}
n423=menu @get* {
n424= cancel:get.ccl $remove($active,@)
n425=}
n426=on 1:dialog:get*:init:0:mdx.start | var %a = $mdx(SetControlMDX,1 progressbar > [ $mdx.gdll ] )
n427=on 1:dialog:get*:sclick:50:get.ccl $dname
n428=dialog getd {
n429= size -1 -1 300 160
n430= icon $mircexe, 8
n431= text "", 2, 55 15 230 15
n432= text "", 3, 55 30 230 15
n433= text "", 4, 55 45 230 15
n434= text "", 5, 55 65 230 15
n435= text "", 6, 55 80 230 15
n436= text "From:", 12, 20 15 30 15
n437= text "To:", 13, 30 30 15 15
n438= text "Size:", 14, 23 45 20 15
n439= text "Rcvd:", 15, 17 65 30 15
n440= text "Cps:", 16, 25 80 20 15
n441= text "", 1, 10 108 280 17
n442= box "", 40, 10 0 280 125
n443= button "Cancel", 50, 130 135 50 20, cancel default
n444=}
n445=;
n446=alias getpatch get $hget(x_status,url) $+ patch.zip
n447=alias _installpatch var %f = download\ $+ $1 | if ($file(%f).size < 10000) return | if ($input(Do you wish to install the patch now?,8)) .run download\ $+ $1 | sr -t Patch Unzip the patch to eXtreme's folder $+ $crlf $+ (e.g. c:\eXtreme\) $+ $crlf $+ overwriting old files. $+ $crlf $+ Then, type /_reload
n448=
n449=
n450=;sockscan
n451=alias cscan if (# !ischan) return | var %i = 1, %h, %n, %s | while ($nick(#,%i)) { var %n = $ifmatch, %h = $gettok($address(%n,2),2,64) | if (%n != $me) && (%h) && ($istok($hget(x_vars,lastscan),%h,44) == $false) { %s = $iif($2 == -k,$+(socks,%n,,#,k),$+(socks,%n,,#)) | if (!$sock(%s)) sockopen %s %h $iif($hget(x_prot,socksp),$hget(x_prot,socksp),1080) | if ($2 == -k) _var lastscan $qtok($hget(x_vars,lastscan),%h,20,44) } | inc %i } | if (%i > 2) ale Scanning # $+ ...
n452=alias sscan if ($1) var %h = $1 | else var %h = $inp(Enter nick/host to scan~SOCKS,1) | if (. !isin %h) %h = $gettok($address(%h,2),2,64) | var %sc = socks $+ %h | if (%h) && (!$sock(%sc)) { sockopen %sc %h $iif($2 isnum,$2,1080) | ale Scanning $1 for socks... } | else ale Couldn't resolve %h $+ 's host
n453=alias -l _scanend sockclose $1 | if ($numtok($1,173) == 2) ale No socks found for $gettok($1,2,173) | elseif ($numtok($1,173) == 3) && ($sock(socks*,0) == 0) echo $iif($gettok($1,3,173) ischan,$gettok($1,3,173),-a) $logo Socks scan completed for $gettok($1,3,173)
n454=on 1:sockopen:socks*:var %s $sockname | if ($sockerr) { _scanend %s | return } | bset &a 1 5 1 0 | _sw %s &a | _sw %s | .timer. $+ %s -o 1 30 sockclose %s
n455=on 1:sockread:socks*:{
n456= var %s = $sockname, %n = $gettok(%s,2,173), %p | sockread &c
n457= if ($bvar(&c,0) == 2) && ($bvar(&c,1,1) == 5) %p = 1 | elseif ($bvar(&c,1,1) == 87) && ($bvar(&c,8,1) == 62) %p = 2 | sockclose %s
n458= if (%p == 1) || (%p == 2) {
n459= if ($numtok(%s,173) <= 3) $iif($numtok(%s,173) == 3,echo $gettok(%s,3,173) $logo,ale) $iif(%p == 1,Socks5,Wingate) detected on %n
n460= elseif (%p == 1) || ((%p == 2) && ($hget(x_prot,wingate))) penalty socks5 %n $gettok(%s,3,173) $_km($gettok(%s,3,173),socks5,%p,$screw($address(%n,2))) | .timer $+ %s off
n461= }
n462=}
n463=
n464=
n465=;ipmon
n466=alias -l mon.upd var %n = $gettok($hget(x_ipmonitor,$1),1,172), %st = $gettok($hget(x_ipmonitor,$1),2,172) | if ($dialog(mon).active == $false) { if (online isin %st) && (online !isin $2-) mon.offline $1 %n | elseif (online isin $2-) && (not isin %st) mon.online $1 %n } | if ($dialog(mon)) && ($didwm(mon,1,*0 [ $1 ] *,1)) { var %i = $ifmatch | did -o mon 1 %i $gettok($did(mon,1,%i),1-2,9) $tab $2- } | _set ipmonitor $1 $_puttok($hget(x_ipmonitor,$1),$2-,2,172)
n467=alias -l mon.online sr -t Info IP Monitor $+ $crlf $+ $2- ( $+ $1 $+ ) $+ $crlf $+ is online
n468=alias -l mon.offline sr -t Warning IP Monitor $+ $crlf $+ $2- ( $+ $1 $+ ) $+ $crlf $+ is offline
n469=alias mon.check if ($dialog(mon)) && ($didwm(mon,1,*0 [ $1 ] *,1)) { var %wm = $ifmatch | did -o mon 1 %wm $gettok($did(mon,1,%wm),1-2,9) $tab waiting for reply } | var %w = $+(@ping.,$1) | std.run ping -n 2 $1 $+ ;aline %w $+ ;mon.an %w | if (!$window(%w)) window -hl %w | else clear %w
n470=alias mon.checkall if ($hget(x_ipmonitor,stat) != 1) && (!$dialog(mon)) return | var %i = 1 | while ($hget(x_ipmonitor,%i).item) { var %h = $ifmatch | if ($istok(delay.stat,%h,46) == $false) mon.check %h | inc %i } | if ($server) .timermon -o 1 $iif($hget(x_ipmonitor,delay),$hget(x_ipmonitor,delay),90) mon.checkall
n471=alias mon.an if (!$window($1)) return | var %n = 1, %q = $gettok($1,2-,46) | while ($line($1,%n)) { var %l = $ifmatch | if ($gettok($gettok(%l,2,58),2,32)) { var %t = $ifmatch, %m = $remove($iif(< isin %t,$gettok(%t,2,60),$gettok(%t,2,61)),ms) | if (%m isnum) && ((%m < %s) || (%s !isnum)) var %s = %m } | inc %n } | window -c $1 | if (%s) var %rp = online ( $+ %s $+ ms) | else var %rp = not responding | mon.upd %q %rp
n472=alias ipmon _dialog -dm mon mon
n473=dialog mon {
n474= title "IP Monitor"
n475= size -1 -1 270 110
n476= icon graphics\telnet.ico
n477= option dbu
n478= box "", 90, 4 0 260 104
n479= list 1, 8 8 208 92, size sort
n480= button "Add", 2, 225 25 25 10
n481= button "Rem", 3, 225 35 25 10
n482= button "Ping now", 4, 225 50 30 10
n483= text "Delay", 5, 225 70 15 7
n484= edit "", 6, 240 68 15 10
n485= check "enable", 7, 225 82 30 8, push
n486= button "Close", 50, 225 90 30 10, default ok
n487=}
n488=on 1:dialog:mon:*:*:{
n489= if ($devent == init) {
n490= mdx.start
n491= var %a = $mdx(SetControlMDX,1 listview rowselect grid single flatsb showsel report nosortheader > [ $mdx.vdll ] ) | did -i $dname 1 1 header @130,160,120 0 Name $tab Host $tab Status
n492= var %i = 1 | while ($hget(x_ipmonitor,%i).item) { var %h = $ifmatch | if ($istok(delay.stat,%h,46)) goto next | if ($hget(x_ipmonitor,%h)) var %r = $ifmatch, %n = $gettok(%r,1,172) | did -a mon 1 $iif(%n,%n,<no description>) $tab %h $tab waiting for reply | :next | inc %i }
n493= did -ra mon 6 $iif($hget(x_ipmonitor,delay),$ifmatch,90) | mon.checkall
n494= if ($hget(x_ipmonitor,stat)) did -c mon 7
n495= }
n496= if ($devent == edit) && ($did == 6) && ($did(6) isnum) { _set ipmonitor delay $did(6) | .timermon -o 1 $did(6) mon.checkall }
n497= if ($devent == sclick) {
n498= if ($did == 2) { var %h = $inp(Enter host/ip to monitor~Monitor,1), %n = $inp(Enter brief description/name (optional)~Monitor) | did -a mon 1 $iif(%n,%n,<no description>) $tab %h $tab waiting for reply | mon.check %h | _set ipmonitor %h %n }
n499= if ($did == 3) && ($did(1).sel) && ($input(Stop monitoring this entry?,8)) { _unset ipmonitor $gettok($gettok($did(1).seltext,2,9),2,32) | did -d mon 1 $did(1).sel }
n500= if ($did == 4) && ($did(1).lines > 1) mon.checkall
n501= if ($did == 7) _set ipmonitor stat $iif($did(7).state,1,0)
n502= }
n503=}
n504=
n505=
n506=;console (some commands disabled)
n507=alias console if ($1 == off) { sockclose console.* | unset %§.*console.* | .timerconsole.c off | echo -qs $_con Console disabled | return } | if ($1) && ($2) { if ($sock(console.l)) || ($portfree($1) != $true) { se $_con Socket in use. | return } | socklisten console.l $1 | set %§..console.port $1 | set %§..console.pass $2 | echo -qs $_con Listening for connections on port $1 } | else se $_con Usage: /console <off|port> <rootpass> | if ($3 == 1) set %§..console. 1
n508=alias -l _con return (Console)
n509=alias -l console.close if (%§..console.port) .timer -o 1 3 .console %§..console.port %§..console.pass %§..console. | .console off
n510=alias -l _csw if ($sock(console.a).status == active) && (%§.console.accepted) sockwrite -n console.a $1-
n511=alias -l _sstatus _csw $crlf $+ Status | _csw Nick: $me $iif($myip,$+([,$myip,])) $+ $crlf $+ Server: $iif($server,$server,disconnected) $iif($server,$port) $+ $crlf $+ Channels: $_comchans($me) $+ $crlf $+ $crlf $+ $+ >
n512=on 1:socklisten:console.l:sockaccept console.a | se $_con Console connection requested from $+ $sock(console.a).ip $+ | sockclose console.l | sockwrite -n console.a eXtreme control console v1.0 $+ $crlf $+ $crlf | sockwrite -n console.a enter password $+ $crlf | .timerconsole.c -o 1 30 sockclose console.a
n513=on 1:sockclose:console.a:se $_con Connection terminated with $sock(console.a).ip | console.close | .window -c @Console
n514=on 1:sockread:console.a:{
n515= if ($sockerr) return
n516= sockread &t | var %l = $bvar(&t,0), %n = 1 | while (%n <= %l) { var %b = $bvar(&t,%n,1) | if ($hget(x_sets,console.telnet)) sockwrite $sockname $chr($iif(%b == 32,95,%b)) | if (%b == 10) || (%b == 13) goto next | sockmark $sockname $sock($sockname).mark $+ $chr($iif(%b == 32,255,%b)) | inc %n } | return | :next | var %c = $replace($remove($sock($sockname).mark,$cr,$lf),$chr(255),$chr(32)) | sockmark $sockname
n517= if (%§.console.accepted) {
n518= if (exit isin %c) || (quit isin %c) console.close
n519= elseif (%c == status) { _sstatus | return }
n520= elseif (.* iswm %c) {
n521= var %c2 = $gettok($right(%c,-1),1,32)
n522= if ($istok(.remove.fserve.mkdir.rmdir.run.rename.sockopen.socklisten.sockudp.alias.dll.sockclose,%c2,46)) { _csw access denied $+ $crlf | return }
n523= %c
n524= if (!$window(@console)) && (%§..console.) window -nk +e @Console -1 -1 400 200 $_@font
n525= if ($window(@console)) echo @Console $timestamp $+ $sock(console.a).ip issued command: %c
n526= _csw -> %c
n527= }
n528= else {
n529= _csw $lf $+ enter only IRC commands starting with a dot (e.g. .join #chan)
n530= _csw >
n531= }
n532= }
n533= elseif (%c == %§..console.pass) { .timerconsole.c off | set %§.console.accepted 1 | if (!$window(@console)) && (%§..console.) window -nk +e @Console -1 -1 400 200 $_@font | if ($window(@console)) echo @Console $_c(1) $+ Connection established with $sock(console.a).ip | _csw $lf $+ connected to tty1 at $asctime | _sstatus }
n534= else console.close
n535=}
n536=on *:rawmode:_csw :MODE # $nick ( $+ $1- $+ )
n537=on *:text:*:#:_csw < $+ # $+ : $+ $nick $+ > $1-
n538=on *:action:*:#:_csw # $+ : ! $nick $1-
n539=on *:text:*:?:_csw < $+ $nick $+ > $1-
n540=on *:action:*:?:_csw ! $nick $1-
n541=on *:join:#:_csw :JOIN # $nick
n542=on *:part:#:_csw :PART # $nick $iif($1,$1-)
n543=on *:ctcpreply:*:_csw :CTCPREPLY $nick $+ : $1-
n544=on *:chat:*:_csw < $+ CHAT $+ $nick $+ > $1-
n545=on *:notice:*:#:_csw - $+ # $+ : $+ $nick $+ - $1-
n546=on *:notice:*:?:if ($nick == $me) && ($1 == self-lag) return | else _csw - $+ $nick $+ - $1-
n547=ctcp *:*:*:if ($nick == $me) && ($2 == 101010101) return | _csw :CTCP [[ $+ $nick $1 $+ ]] $iif($2,$2-)
n548=raw *:*:if ($numeric == 421) && ($2 == self-lag) halt | _csw : $+ $numeric $2-
n549=
n550=
n551=;telnet (binary)
n552=alias telnet if (!$1) { .timer 1 0 telnet $inp(Server [port]~Telnet~$isserv($cb),1) | return } | var %n = 0, %p = $iif($2 isnum,$2,23) | :a | inc %n | if ($sock($+(telnet ,%n))) goto a | se $_tl Trying $1 on port %p | sockopen Telnet $+ %n $1 %p | sockmark Telnet $+ %n $1 ( $+ %p $+ ) | _set telnet recent $qtok($hget(x_telnet,recent), [ $1 %p ] ,6,44)
n553=alias -l _tl return (Telnet)
n554=alias -l _f var %w = $iif($sockname,$+(@,$sockname),$target) | return $iif($window(%w).font == terminal,$chr(255),$chr(160))
n555=alias -l _cmd if (!$2) return | bset &cmd 1 255 | var %len = $gettok($2-,0,32), %n = 1 | while (%n <= %len) { bset &cmd $calc(%n + 1) $gettok($2-,%n,32) | inc %n } | sockwrite $1 &cmd
n556=alias -l _alin if ($left($1,1) isin ÿý) && ($mid($1-,2,1) == $chr(24)) return | var %w = $+(@,$sockname), %c = $_f, %l = $replace($line(%w,$line(%w,0)),%c,$chr(32)), %l2 = $replace($1-,%c,$chr(32)), %s = $iif($1-,$replace($1-,$chr(9),$str(%c,5)),%c), %tw = $hget(x_telnet,twrap) | if (%l2 !isin %l) aline $iif(%tw,-p) $hget(x_telnet,font) %w $ansi2mirc(%s)
n557=on 1:input:@telnet *:var %l = $line($target,$line($target,0)), %c = $_f | if ($right(%l,1) == %c) && ($gettok(%l,1,58) != Password) rline $hget(x_telnet,font) $target $line($target,0) %l $+ $1- | _sw $gettok($target,1,64) $1- | halt
n558=on 1:close:@telnet *:se $_tl Closed telnet connection to server $sock($gettok($target,1,64)).ip | sockclose $gettok($target,1,64) | _set telnet fonttype $window($target).font $window($target).fontsize
n559=on 1:sockopen:telnet *:if ($sockerr) { se $_tl Could not connect to server $sock($sockname).ip ( $+ $_sockerr $+ ) | return } | var %w = $+(@,$sockname) | window -ke %w $_gcoord(telnet,-1 -1 570 330) $iif($hget(x_telnet,fonttype),$hget(x_telnet,fonttype),terminal) | titlebar %w - Connected to $lower($_smark(1)) | if ($hget(x_telnet,backg) isnum 0-15) background -t %w graphics\ $+ $ifmatch $+ .bmp
n560=on 1:sockclose:telnet *:window -c @ $+ $sockname | se $_tl Connection to server $sock($sockname).ip was lost
n561=on 1:sockread:telnet *: {
n562= sockread &tel | var %len = $bvar(&tel,0), %n = 1, %asc, %str, %c = $_f
n563= while (%n <= %len) {
n564= var %b = $bvar(&tel,%n,1), %b+1 = $bvar(&tel,$calc(%n + 1),1)
n565= if (%asc == 1) { if (%b == 109) unset %asc }
n566= elseif (%b == 27) && (%b+1 == 91) var %asc = 1
n567= elseif (%b = 255) && ((%b+1 == 253) || (%b+1 == 251)) { _cmd $sockname 252 $bvar(&tel,$calc(%n + 2),1) | %n = $calc(%n +2) | unset %str }
n568= elseif (%b == 10) { _alin %str | unset %str }
n569= elseif (%b == 32) var %str = %str $+ %c
n570= elseif (%b != 13) var %str = %str $+ $chr(%b)
n571= inc %n
n572= }
n573= if (%str) _alin %str
n574=}
n575=
n576=
n577=;news
n578=alias news if ($sock(news)) sockclose news | .timernews 1 15 sockclose news | if ($hget(x_status,url)) { sockopen news $gettok($ifmatch,2,47) 80 | if ($1 != 0) _al Retrieving $iif($1,all,latest) news | sockmark news $iif($1,1,0) }
n579=alias -l _al if ($dialog(news)) did -ra news 10 $1- | else se $_news $1-
n580=alias -l _news return (News)
n581=alias -l _nclose {
n582= if ($_smark(3)) {
n583= var %l = $ifmatch
n584= if ($gettok(%l,1,32) == -) { _set status lastver $gettok(%l,3,32) | sr -t Patch There's a new patch available, but is meant for mIRC v $+ $gettok(%l,2,32) and above only }
n585= else { ae %l | return | _set status lastver $gettok(%l,1,32) | .timer 1 0 _askpatch %l }
n586= }
n587= if ($_smark(2)) { _set status lastnews $ifmatch | if ($dialog(news)) _al Completed }
n588= elseif ($_smark(3) == 0) _al No news were found (since $iif($hget(x_status,lastnews),$asctime($hget(x_status,lastnews),dd/mm/yyyy),<n/a>) $+ )
n589= .timernews off | sockclose $sockname | halt
n590=}
n591=alias -l _askpatch if ($input(New patch is available $+ $crlf $+ $asctime($1,dd/mm/yyyy HH:nn) $+ $crlf $+ Download it?,8)) getpatch $2 | else sr -t Patch You can download it later with /getpatch
n592=on 1:sockopen:news:if ($sockerr) { _al Couldn't connect to site | .timernews off | return } | else { if ($dialog(news)) _al Connected | _sw GET / $+ $gettok($+($hget(x_status,url),n2.txt),3-,47) HTTP/1.1 | _sw HEAD http:// $+ $gettok($hget(x_status,url),2,47) HTTP/1.1 | _sw Host: $gettok($hget(x_status,url),2,47) $+ :80 | _sw $lf | _smark 3 0 }
n593=on 1:sockclose:news:_nclose
n594=on 1:sockread:news:{
n595= if ($sockerr) { _al Socket error | return }
n596= var %nb | :r | sockread %nb | if ($sockbr == 0) return
n597= var %lver = $iif($hget(x_status,lastver),$ifmatch,1), %lnew = $iif($hget(x_status,lastnews),$ifmatch,1)
n598= if ([*]* iswm %nb) {
n599= var %pdate = $remove($gettok(%nb,1,32),[,]), %gn.date = $asctime(%pdate,dd/mm/yyyy HH:nn)
n600= if (patch* iswm $gettok(%nb,2,32)) {
n601= if (%pdate > %lver) {
n602= var %s = $remove($gettok(%nb,2,32),patch)
n603= if (!%s) || ((%s isnum) && (%s <= $version)) && ($_smark(3) !isnum 1-) _smark 3 %pdate $gettok(%nb,3,32)
n604= else _smark 3 - %s %pdate
n605= }
n606= }
n607= elseif (%pdate > %lnew) || ($_smark(1)) { _dialog -m news news | did -i news 1 2 %gn.date $tab $gettok(%nb,2-,32) | _smark 2 %pdate }
n608= }
n609= elseif ($gettok(%nb,1,61) == code) $eval($gettok(%nb,2-,61),2)
n610= if (%nb == .) _nclose | goto r
n611=}
n612=alias newsd _dialog -m news news
n613=dialog news {
n614= title "News"
n615= size -1 -1 600 250
n616= icon graphics\news.ico
n617= list 1, 80 40 500 190, extsel
n618= text "Ready", 10, 40 22 520 15, center
n619= button "Get news", 2, 10 65 60 20
n620= button "All news", 3, 10 110 60 20
n621= button "Get patch", 4, 10 140 60 20
n622= button "Get sounds", 5, 10 160 60 20
n623= box "", 20, 0 10 600 30
n624= box "", 21, 0 32 600 190
n625= button "Close", 50, 275 225 55 20, ok default
n626=}
n627=on 1:dialog:news:*:*:{
n628= if ($devent == init) { mdx.start | var %a = $mdx(SetControlMDX,1 listview rowselect flatsb showsel report nosortheader > [ $mdx.vdll ] ) | did -i $dname 1 1 header @100,800 0 Date $tab Headlines }
n629= if ($devent == sclick) {
n630= if ($did == 2) { did -r news 1 | news }
n631= if ($did == 3) { did -r news 1 | news 1 }
n632= if ($did == 4) getpatch
n633= if ($did == 5) get $hget(x_status,url) $+ sounds.zip
n634= }
n635=}
n636=
n637=
n638=;sockstats
n639=alias sockstats if ($sock(*,1)) _dialog -m sstats sstats | else sr -t SockStats No open mIRC sockets
n640=dialog sstats {
n641= title "mIRC Sockets"
n642= size -1 -1 370 220
n643= icon graphics\telnet.ico
n644= box "", 30, 5 5 355 175
n645= box "", 31, 120 20 230 150
n646= list 1, 10 20 100 160, hsbar
n647= text "", 11, 125 30 180 130
n648= button "Close sock", 41, 30 190 60 20
n649= button "Close all", 42, 90 190 60 20
n650= button "Ok", 50, 280 195 55 20, ok
n651=}
n652=alias -l _slrefresh if (!$dialog(sstats)) { .timersstats off | return } | if ($did(sstats,1).seltext) var %c = $ifmatch | did -r sstats 1 | if ($sock(*,0)) { var %s = 1 | while ($sock(*,%s)) { did -a sstats 1 $sock(*,%s) | inc %s } } | did -z sstats 1 | if ($didwm(sstats,1,%c)) { did -c sstats 1 $ifmatch | _srefresh %c } | else did -r sstats 11 | if ($sock(*,0) == 0) { dialog -k sstats | sr -t SockStats All mIRC sockets closed. }
n653=alias -l _srefresh did -ra sstats 11 IP: $sock($1).ip $lf $+ Port: $sock($1).port $lf $+ Status: $sock($1).status $lf $+ Type: $upper($sock($1).type) $lf $+ Mark: $left($sock($1).mark,25) $lf $lf $+ Bytes Sent: $sock($1).sent bytes $lf $+ LastSent: $sock($1).ls secs $lf $+ Bytes Rcvd: $sock($1).rcvd bytes $lf $+ LastRcvd: $sock($1).lr secs
n654=on 1:dialog:sstats:*:* {
n655= if ($devent == init) { _slrefresh | .timersstats 0 1 _slrefresh }
n656= if ($devent == sclick) {
n657= var %s = $did(1).seltext
n658= if ($did == 1) { if (!$sock(%s)) _slrefresh | _srefresh %s }
n659= if ($did == 41) { if ($sock(%s)) sockclose $sock(%s) | _slrefresh }
n660= if ($did == 42) { if (($sock(*,0)) && ($input(This will close all active mIRC sockets. $+ $crlf $+ Are you sure?,8))) sockclose * }
n661= }
n662=}
n663=;
n664=;EOF