Port Checker (mIRC Version)

By Jonesy44 on Dec 01, 2008

This is the equivalent mIRC version of my PHP port checking script.

To call it up:

/pc

Then enter the address:port of the server you wish to test
Image

;;;;;;;;;;;;;;;;;;
;; Port Checker ;;
;; By Jonesy44  ;;
;;;;;;;;;;;;;;;;;;

alias pc {
  set %pc.addr $$input(Enter the Address/IP and port of the server you want to check (IP:Port),eq,Port Check - Input Information)
  if ($sock(pc)) { .sockclose pc }
  if (%pc.addr) {
    echo -a 2Port Check; $str(-,50)
    echo -a 2Port Check; Checking address $qt($iif(: isin %pc.addr,%pc.addr,%pc.addr $+ : $+ 80)) Please wait..
    .sockopen pc $iif(: isin %pc.addr,$replace(%pc.addr,$chr(58),$chr(32)),%pc.addr 80)
    set %pc.timeout 5
    .timerpc1 0 1 pc.timeout
  }
}
alias pc.timeout {
  if (%pc.timeout <= 0) {
    echo -a 4Port Check: Could not connect to $qt($iif(: isin %pc.addr,%pc.addr,%pc.addr $+ : $+ 80))
    echo -a 2Port Check; $str(-,50) 
    .sockclose pc
    .timerpc1 off
    unset %pc.addr
  }
  else { dec %pc.timeout }
}
on *:SOCKOPEN:pc: {
  if ($sockerr) { echo -a 4Port Check: Could not connect to $qt($iif(: isin %pc.addr,%pc.addr,%pc.addr $+ : $+ 80)) }
  else { echo -a 3Port Check: Connected succesfully to $qt($iif(: isin %pc.addr,%pc.addr,%pc.addr $+ : $+ 80)) }
  echo -a 2Port Check; $str(-,50) 
  unset %pc.addr
  .sockclose pc
  .timerpc1 off
}

Comments

Sign in to comment.
Jonesy44   -  Sep 07, 2009

Thankyou :) and yeah, it's personal preference. if i were to re-do this i'm pretty sure i'd change a lot of things lol. I might re-do it soemtime. It's got a lot of useless crap that could be shortcutt-ed

 Respond  
GlobalAnomaly   -  Sep 06, 2009

Not my place, but to Cheiron:

;;;;;;;;;;;;;;;;;;
;; Port Checker ;;
;; By Jonesy44  ;;
;;;;;;;;;;;;;;;;;;

alias pc {
  set %pc.addr $$input(Enter the Address/IP and port of the server you want to check (IP:Port),eq,Port Check - Input Information)
  if ($sock(pc)) { .sockclose pc }
  if (%pc.addr) {
  window @Ports
    aline @Ports 2Port Check; $str(-,50)
    aline @Ports  2Port Check; Checking address $qt($iif(: isin %pc.addr,%pc.addr,%pc.addr $+ : $+ 80)) Please wait..
    .sockopen pc $iif(: isin %pc.addr,$replace(%pc.addr,$chr(58),$chr(32)),%pc.addr 80)
    set %pc.timeout 5
    .timerpc1 0 1 pc.timeout
  }
}
alias pc.timeout {
  if (%pc.timeout <= 0) {
    aline @Ports 4Port Check: Could not connect to $qt($iif(: isin %pc.addr,%pc.addr,%pc.addr $+ : $+ 80))
    aline @Ports 2Port Check; $str(-,50) 
    .sockclose pc
    .timerpc1 off
    unset %pc.addr
  }
  else { dec %pc.timeout }
}
on *:SOCKOPEN:pc: {
  if ($sockerr) { aline @Ports 4Port Check: Could not connect to $qt($iif(: isin %pc.addr,%pc.addr,%pc.addr $+ : $+ 80)) }
  else { aline @Ports 3Port Check: Connected succesfully to $qt($iif(: isin %pc.addr,%pc.addr,%pc.addr $+ : $+ 80)) }
  aline @Ports 2Port Check; $str(-,50) 
  unset %pc.addr
  .sockclose pc
  .timerpc1 off
}

Just made it work with a @window (@Ports) instead of echoing to the active..Bored.

Nice btw :P

 Respond  
Jonesy44   -  Sep 06, 2009

Thanks for the +Like :)

 Respond  
Jonesy44   -  Dec 28, 2008

Were you expecting it not to work or somethihng? Why did you comment on the PHP version too?

 Respond  
Joshuaxiong1   -  Dec 28, 2008

cool this script really work lolololol!!!!!!!!!!!!!!!!!!!!!!!!!!

 Respond  
Jonesy44   -  Dec 11, 2008

Cheiron: Finally! a script of use that i've made lol! I've actually found this really handy s'peshly with my utorrent script & using sockets more often these days

Furbs: Done :P

 Respond  
F*U*R*B*Y*   -  Dec 11, 2008

i'd personally change -------------------------------------------------------------------------------------- to $str(-,50) makes it easier to read and such :P

 Respond  
Cheiron   -  Dec 05, 2008

yw. i appreciate the script and it has indeed shown its worth and functionality

 Respond  
Jonesy44   -  Dec 05, 2008

Thanks for the +Like Cheiron! :]

 Respond  
Jonesy44   -  Dec 05, 2008

lol, me too. i perfer to just echo it into the active window :]

 Respond  
xplo   -  Dec 05, 2008

no $active is cool enough :)

i hate it when you have 2345676543 gazillions windows opened :/

 Respond  
Jonesy44   -  Dec 04, 2008

Thanks mate! much appreciated :D

make all echo's into aline's on a new @window?

 Respond  
Cheiron   -  Dec 04, 2008

very nice script there jonesy :) nice easy display and easy to use. > 2Port Check; --------------------------------------------------------------------------------------
2Port Check; Checking address "208.88.177.68:6667" Please wait..
3Port Check: Connected succesfully to "208.88.177.68:6667"
2Port Check; --------------------------------------------------------------------------------------
-

just looking to see how to make it open in a seperate window instead of showing in status window. not crucial but might be handy to have option.

gets a nice thumbs up and a 9 score

 Respond  
Jonesy44   -  Dec 04, 2008

True, true. However each platform does have their use! and i thought this would really help people who know mirc or php, to learn the other language. It's easy enough to make comparisons!

 Respond  
vaseline28   -  Dec 04, 2008

What this really shows is quite how much simpler PHP is for something like this ;p

 Respond  
Jonesy44   -  Dec 01, 2008

equiv PHP script: http://www.hawkee.com/snippet/5404/
Perhaps this might help people learning PHP who know mIRC?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.