Print Page | Close Window

Server Online/Offline [Main Menu]

Printed From: Mirage Source
Category: Tutorials
Forum Name: Temporary Archive (Read Only)
Forum Discription: Temporary 3.0.3 archive tutorials, will be deleted when converted.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=193
Printed Date: 20 December 2006 at 5:53pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Server Online/Offline [Main Menu]
Posted By: Sync
Subject: Server Online/Offline [Main Menu]
Date Posted: 11 February 2006 at 3:25pm
Difficulty: Easy 1/5


Hello All! Do you want to add a small script onto your main menu saying if the server is online or offline? Well, this is the place to be if so.


====2 Label Switch Mode====
First, open your frmMainMenu and add a label [Label1] and 2 text boxes, one over the other.

-----------------------------------
Textbox 1!
(Name) = txtonline
Locked = True
Text = Online


And Now, Textbox 2! [Which has to be right over textbox 1 with the exact same size]
(Name) = txtoffline
Locked = True
Text = Offline

And lastly, Label1!
(Name) = Label1
Caption = The Server is currently :

-----------------------------------
Good! Now you are all set! Now double click on the form and look for this:

Private Sub Form_Load()


and add this between Private Sub Form_Load() and End Sub


    'Server Online/Offline Code
    'Enjoy :)
    If ConnectToServer = True Then
        frmMainMenu.txtonline.Visible = True
        frmMainMenu.txtoffline.Visible = False
        Else
        frmMainMenu.txtonline.Visible = False
        frmMainMenu.txtoffline.Visible = True
    End If


Ending:Well,you now have a Online/Offline code! Feel free to upgrade it!

Note 1 : Since it only works when the form load, try adding a Server Status Recheck button which will perform the script again, checking if the server is online or offline!

Note 2 : This was made with Mirage Source v3.0.3, but it will probably work on the other versions as well :)

====1 Label Mode - Contributed By : Minatours====
Sorry if you dont want me to do this, if you dont just post and ill remove it for you.

Go on to your Main Menu,Now you need to add two things

Label called lblserverstatus and have a caption of "Server:"

Timer called TmrServerStatus, change the intermal on it to fit your preference.

Now double click the timer to enter its code, now add this. Also add it the form_Load so that it changes as soon as you enter and also keep rechecking after that.

Code:
If ConnectToServer = True then
    lblserverstatus.caption = "Server: Online"
Else
    lblserverstatus.caption = "Server: Offline"
End If


I havnt tested as im at college, but i tshould work.

Mina~!~



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info