mIRC Homepage
Is there a function if mIRC that can tell me if I'm connected to the internet?

Thanks.
I found this in the mIRC help file
Maybe it can help you...


$server
Returns the name of the server to which you are currently connected.

If you're not currently connected to a server, it returns $null.


Good Luck !!!
I donĀ“t know that function, i think you must read about sockets.
Well, stimpy, this wasn't what I was looking for, but thanks anyway.

I know how to find out if I'm connected to a server(using $status). I wanted to know if there is a way to find out if I'm connected to the internet.

I have created an e-mail script whcih checks for e-mails, and notify me about them. The problem is that if I'm not connected to the internet, it tries to connect to the internet and causes the dial up to show. I want to prevent that.... I want that it would check e-mails only when I'm connected to the internet.
Depends what version of Windows you are running, the below will work on NT (NT4(?),2000,XP,+) but will NOT work on 9x, it simply uses rasdial to check for a Dial-up connection.
Code:
alias findconnect {
  ; use COM to run rasdial & "find" the string "Connected to" in the output, which is written to a file (ras.txt)
  ; this will wait till the above finishes before continuing, but will not freeze mIRC
  var %a = $ticks
  .comopen %a WScript.Shell
  if !$comerr { .comclose %a $com(%a,Run,3,bstr,cmd.exe /c rasdial|find "Connected to">ras.txt,uint,0,bool,true) }

  ; check that ras.txt is more than 0 bytes
  ; if no connection is found it will be empty
  ; if a connection is found it will contain [color:green]Connected to[/color]
  if $file(ras.txt) { echo -a call.your.email.check.from.here }
  .remove ras.txt
}
Ok,

Thank you for your suggestion. shocked
© mIRC Discussion Forums