;ServerPorts.mrc v1.2 Dec 9 1999 - fixed for v5.6+ ;Find the fastest Port on your server ! ;A nifty little Script that all goes in your Remotes files. ;Scans for the least busy port and allows you to switch onto it ;with a simple double click of your mouse ! ;Displays all results in a Custom Window sorted in order of best to worst. ;Written by Free of #mIRC Undernet on Aug 15 1998 v1.0 ;Modified slightly on Sep 1 1998 v1.1 ;Modified the $left,$right identifiers when it was brought to my notice by muDsKippY that v5.6+ drops the old syntax. ; http://www.much.net/free/scriptsothers.html ;to load use /load -rs ServerPorts.mrc ...OR... if you are lazy ;//load -rs $getdir(*.mrc) $+ ServerPorts.mrc ;or maybe load using //load -rs $findfile($mircdir,ServerPorts.mrc,1) ; Modified 3/Jan/2000 ; now new command is /stats p ; and $3 = server port ... and $4 is number of active users ... and RAW is 217 with RAW 219 being the end of the report ; menu menubar { ServerPorts:ServerPorts } alias ServerPorts { set %server.Port.for.Popup.menu $server .enable #ServerPorts if ($window(@Server-Ports) != $null) { window -c @Server-Ports } window -l13besS @Server-Ports 120 100 400 185 @Server-Ports MS Serif 11 titlebar @server-ports Ports in order of Best to worst echo @Server-Ports 4=[ 2Scanning visible ports on 6 $server $+ 4 ]= unset %ServerPortsScan stats p ;stats l } menu @Server-Ports { dclick { server %server.Port.for.Popup.menu $strip($gettok($line(@Server-Ports,$$1),3,32)) } Switch Ports:server %server.Port.for.Popup.menu $strip($gettok($line(@Server-Ports,$sline(@Server-Ports,1).ln,1),3,32)) Switch and rejoin Channels:{ set %server.Port.Channels.Total $chan(0) unset %server.Port.Channels :ServerChannels if (%server.Port.Channels.Total != 0) { set %server.Port.Channels %server.Port.Channels $chan(%server.Port.Channels.Total) dec %server.Port.Channels.Total 1 goto ServerChannels } .enable #serverPortConnect server %server.Port.for.Popup.menu $strip($gettok($line(@Server-Ports,$sline(@Server-Ports,1).ln,1),3,32)) } } #serverPortConnect off on 1:connect:{ .disable #serverPortConnect :ServerChannelsJoin if (%server.Port.Channels != $null) { set %server.Port.Channels $replace(%server.Port.Channels,$chr(32),$chr(44)) join %server.Port.Channels } } #serverPortConnect end #ServerPorts off raw 217:* { set %ServerPort $3 if (%ServerPort == $port) { aline -l 4 @Server-Ports $str($chr(160),$calc(14 - $len($4))) $+ $4 Port %ServerPort } else { aline -l @Server-Ports $str($chr(160),$calc(14 - $len($4))) $+ $4 Port %ServerPort } } ;raw 211:* { ; if ($2 == $server) { set %ServerPort 6667 } | else { set %ServerPort $left($right($2,5),4) } ; if ((%ServerPort isnum) && ($chr(46) !isin %ServerPort)) { ; if (%ServerPortsScan == $null) { ; set %ServerPortsBest %ServerPort | set %ServerPortsTraffic $5 + $7 | set %ServerPortsScan active | set %ServerPortsList %ServerPort ; } ; else { set %ServerPortsListAll %ServerPortsList | set %ServerPortsList %ServerPortsListAll $+ , $+ %ServerPort | set %ServerPortsSum $5 + $7 ; if (%ServerPortsSum < %ServerPortsTraffic) { set %ServerPortsBest %ServerPort | set %ServerPortsTraffic $5 + $7 | set %ServerPortsListAll %ServerPortsList | unset %ServerPortsListAll } ; unset %ServerPortsSum ; } ; if (%ServerPort == 6667) { aline -l 3 @Server-Ports $str($chr(160),$calc(14 - $len($calc($5 + $7)))) $+ $calc($5 + $7) Port %ServerPort } ; elseif (%ServerPort == $port) { aline -l 4 @Server-Ports $str($chr(160),$calc(14 - $len($calc($5 + $7)))) $+ $calc($5 + $7) Port %ServerPort } ; else { aline -l @Server-Ports $str($chr(160),$calc(14 - $len($calc($5 + $7)))) $+ $calc($5 + $7) Port %ServerPort } ; } ; halt ;} raw 219:*: { ; if ($2 == l) { if ($3 == End) { echo @Server-Ports 2 All available ports :3 %ServerPortsList echo @Server-Ports 2Best port is: 3 %ServerPortsBest echo @Server-Ports 2Best port traffic: 3 %ServerPortsTraffic Kilobytes echo @Server-Ports 4=[2Finished Server scan ports on 6 $server $+ 4]= echo @Server-Ports 2You are now connected to Port6 $port  echo @Server-Ports 5Double Click the Port in the List Box echo @Server-Ports 5to Switch to that Port unset %ServerPorts*List | unset %ServerPortsScan | unset %ServerPortsTraffic | unset %ServerPort | /.timer 1 20 /unset %ServerPortsBest | unset %ServerPortsListAll | /.timer 1 1 /.disable #ServerPorts | halt } } #ServerPorts end