Jump to content

Server Status Ping Freeze


Recommended Posts

I Made a launcher for a video game I play. I am trying to setup a Server Status Area on the GUI but it freezes, I used a Ping script from this site and it works when It's not in my script so it's obviously something i'm over looking.

CODE
#include <GUIConstants.au3>

#include <inet.au3>

#include <File.au3>

#include <IE.au3>

Opt("GUIOnEventMode", 1)

MsgBox(0, "Created By", ".Portwolf for Fantasy ROSE")

GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit")

;$oIE = ObjCreate("Shell.Explorer.2")

$eip = ("fantasyrose.twilight-mania.com")

TCPStartup()

$sIp = TCPNameToIP($eip)

GUISetIcon("Client.ico")

;Locate your icon launcher

GUICreate ( "Fantasy ROSE Launcher", 600, 480,(@DesktopWidth-600)/2, (@DesktopHeight-480)/2 )

GUICtrlSetBkColor(-1, 0x000000)

;GUICtrlCreatePic("gui.jpg", 0,0,600,480)

GUICtrlSetState( -1, $GUI_DISABLE)

$Launch = GUICtrlCreateButton("Start Game", 5, 420, 100, 33, 0)

$Patch = GUICtrlCreateButton("Patch Check", 265, 420, 100, 33, 0)

$Register = GUICtrlCreateButton("Website", 136, 420, 100, 33, 0)

;$GUIActiveX = GUICtrlCreateObj ( $oIE, 5, 120 , 360 , 290 )

;Status Check

GUICtrlCreateLabel("Login Server:", 20, 25)

GUICtrlCreateLabel("Character Server:", 20, 45)

GUICtrlCreateLabel("World Server:", 20, 65)

$lStatus = GUICtrlCreateLabel(" ",100,25)

$cStatus = GUICtrlCreateLabel(" ",115,45)

$wStatus = GUICtrlCreateLabel(" ",100,65)

GUISetState(@SW_SHOW)

;$oIE.navigate("http://fantasyrose.twilight-mania.com/news.php")

;Change your server host

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $Patch

MsgBox(0, "Fantasy ROSE Patcher", "Patch function will be added when we need it.")

Case $msg = $Launch

Run("TRose.exe @TRIGGER_SOFT@ _server fantasy-rose.no-ip.org")

WinClose("Fantasy ROSE Launcher")

case $msg = $Register

$oIE2 = _IECreate ("http://fantasyrose.twilight-mania.com/")

EndSelect

Wend

Func doping()

If Ping("www.google.com") > 0 Then

GUICtrlSetData($lStatus, "Online")

Else

GUICtrlSetData($lStatus, "Offline")

EndIf

EndFunc

Func _Quit()

Exit

EndFunc

the IE Nav is commented out along with the background pic just so i could see what was going on.

I tried Several ways to implement the ping script. I just cant seem to get it to work.

Both the launcher and the ping script work separately but not together so I'm overlooking something, anyone know what it is?

--Portwolf

Link to comment
Share on other sites

You are mixing OnEvent mode with GUI MessageLoop mode.

In OnEvent Mode your GUI Loop is only this:

While 1

Sleep(1000)

WEnd

Every gui element then has an event bound to it which requires an associated function.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...