
Originally Posted by
*HK*
remember to come with suggestions
Game volume conf:
Code:
Dim Volume As String = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "VolumeLevel", "")
TrackBar1.Maximum = 5
Code:
Select Case Volume
Case "1"
TrackBar1.Value = 1
Case "2"
TrackBar1.Value = 2
Case "3"
TrackBar1.Value = 3
Case "4"
TrackBar1.Value = 4
Case "5"
TrackBar1.Value = 5
Case Else
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "VolumeLevel", 5)
CheckBox1.Checked = True
End Select
Code:
If TrackBar1.Value = 1 Then
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "VolumeLevel", 1)
End If
If TrackBar1.Value = 2 Then
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "VolumeLevel", 2)
End If
If TrackBar1.Value = 3 Then
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "VolumeLevel", 3)
End If
If TrackBar1.Value = 4 Then
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "VolumeLevel", 4)
End If
If TrackBar1.Value = 5 Then
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "VolumeLevel", 5)
End If
my old auto update:
Code:
Public Class Form4
Dim FI_1 As String = Nothing
Dim WithEvents downl As New Net.WebClient
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListBox1.Items.Add("Connection to download server . . .")
Try
Dim ts As System.Net.Sockets.TcpClient = New System.Net.Sockets.TcpClient("127.0.0.1", 44405)
Catch ex As System.Net.Sockets.SocketException
If (ex.ErrorCode = 10061) Then
ListBox1.Items.Add("Connection to server established")
Else
MsgBox("Update server is offline")
End If
End Try
ListBox1.Items.Add("Checking client server version . . .")
My.Computer.Network.DownloadFile("http://localhost/xx.txt", "yourversion.txt", 1, 1, False, 1, True)
'Dispose()
Const cnstart = "ClientVersion="
Dim lines = IO.File.ReadAllLines("yourversion.txt")
Dim ComputerName = (From line In lines Where line.StartsWith(cnstart)).First.Substring(cnstart.Length)
ListBox1.Items.Add("Your client version" & ComputerName)
My.Computer.Network.DownloadFile("http://localhost/xxx.txt", "lastversion.txt", 1, 1, False, 1, True)
' Dispose()
Const cnstart2 = "ClientVersion="
Dim lines2 = IO.File.ReadAllLines("lastversion.txt")
Dim ComputerName2 = (From line2 In lines2 Where line2.StartsWith(cnstart2)).First.Substring(cnstart2.Length)
ListBox1.Items.Add("Lastest client version" & ComputerName2)
If ComputerName2 = ComputerName Then
ListBox1.Items.Add("You already have the lastest version . . .")
End If
If ComputerName2 <> ComputerName Then
ListBox1.Items.Add("Downloading update file . . .")
My.Computer.Network.DownloadFile("http://localhost/xxx.txt", "lastversion.txt", 1, 1, False, 1, True)
downl.DownloadFileAsync(New Uri("http://localhost/lol.exe"), "temp_update.exe")
ListBox1.Items.Add("Closing download process . . .")
downl.Dispose()
ListBox1.Items.Add("Selection option that update download done . . .")
FI_1 = True
Else
FI_1 = False
End If
If FI_1 = True Then
ListBox1.Items.Add("Starting install update . . .")
Dim p As Process = Process.Start("temp_update.exe")
ListBox1.Items.Add("Waiting for exit . . .")
p.WaitForExit()
ListBox1.Items.Add("Deleting update file . . .")
My.Computer.FileSystem.DeleteFile("temp_update.exe")
ListBox1.Items.Add("Now you can go play . . .")
End If
End Sub
Private Sub downl_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles downl.DownloadProgressChanged
ProgressBar1.Value = e.ProgressPercentage
End Sub
End Class
fade in/out:
Code:
Me.Opacity = 0
Dim iCount2 As Integer
For iCount2 = 0 To 100 Step +10
Me.Opacity = iCount2 / 100
Me.Refresh()
Threading.Thread.Sleep(65)
Next
Me.Opacity = 100
Dim iCount As Integer
For iCount = 100 To 0 Step -10
Me.Opacity = iCount / 100
Me.Refresh()
Threading.Thread.Sleep(65)
Next
Form1.Show()
Me.Close()
server status:
Code:
Try
Dim ts As System.Net.Sockets.TcpClient = New System.Net.Sockets.TcpClient("127.0.0.1", 44405)
Catch ex As System.Net.Sockets.SocketException
If (ex.ErrorCode = 10061) Then
Label2.Text = "Offline"
End If
End Try
check if main.exe exist and start game
Code:
If (My.Computer.FileSystem.FileExists("./main.exe")) Then
Process.Start("./main.exe")
Else
MsgBox("Can't find object 'main.exe', please reinstall client.", MsgBoxStyle.Critical, "Client Critical Error")
End If