November 30, 2020, 02:34:59 AM

Author Topic: [bb] is online? by Airilsm [ 1+ years ago ]  (Read 519 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] is online? by Airilsm [ 1+ years ago ]
« on: June 29, 2017, 12:28:39 AM »
Title : is online?
Author : Airilsm
Posted : 1+ years ago

Description : My simple way to check user online without annoing 'Network Connection Popup'. May be not working correctlly on network computer ;)

Code :
Code: BlitzBasic
  1. If OnLine() Print "You're online" Else Print "You're not online"
  2. WaitKey()
  3. End
  4.  
  5. Function OnLine()
  6. n = CountHostIPs("")
  7. For k=1 To n
  8. ip = HostIP(k)
  9. ipaddress$ = DottedIP$(ip)
  10. If ipaddress$="127.0.0.1"
  11.         notconnect=1
  12. EndIf
  13. Next
  14. Return Not(notconnect)
  15. End Function


Comments :


*(Posted 1+ years ago)

 the only question I have with this, is does it still tell you if you are online on the internet or just connected to a network?


Pineapple(Posted 1+ years ago)

 Yeah, personally, I'd use a function that sends a request to a few servers (microsoft.com, google.com, yahoo.com) if at least one responds, then your online, if not, well, chances are your not! :)Anyway, that's me, but I'm sure someone will have a use for the above! ;)Dabz


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal