- Imports System
- Imports System.IO
- Imports System.Data
- Public Class Form1
- 'Dragging form w/o borders :D
- #Region " ClientAreaMove Handling "
- Const WM_NCHITTEST As Integer = &H84
- Const HTCLIENT As Integer = &H1
- Const HTCAPTION As Integer = &H2
- Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
- Select Case m.Msg
- Case WM_NCHITTEST
- MyBase.WndProc(m)
- If m.Result = HTCLIENT Then m.Result = HTCAPTION
- Case Else
- MyBase.WndProc(m)
- End Select
- End Sub
- #End Region
- Public Sub GetProcesses()
- ListBox1.Items.Clear()
- Dim p As Process
- For Each p In Process.GetProcesses
- ListBox1.Items.Add(p.ProcessName)
- Next
- End Sub
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
- Try
- Dim l = "LoginServer"
- ListBox1.SelectedItem = l
- If ListBox1.SelectedItem = l Then
- GetProcesses()
- Else
- Shell("LoginServer.exe")
- End If
- GetProcesses()
- Catch ex As Exception
- MsgBox("Error - Cant find LoginServer.exe")
- End Try
- End Sub
- Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
- Try
- Dim c = "CharServer"
- ListBox1.SelectedItem = c
- If ListBox1.SelectedItem = c Then
- GetProcesses()
- Else
- Shell("CharServer.exe")
- End If
- GetProcesses()
- Catch ex As Exception
- MsgBox("Error - Cant find CharServer.exe")
- End Try
- End Sub
- Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
- Try
- Dim w = "WorldServer"
- ListBox1.SelectedItem = w
- If ListBox1.SelectedItem = w Then
- GetProcesses()
- Else
- Shell("WorldServer.exe")
- End If
- GetProcesses()
- Catch ex As Exception
- MsgBox("Error - Cant find WorldServer.exe")
- End Try
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- GetProcesses()
- End Sub
- Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
- MsgBox("ROSE Restarter coded by -DefaulT - d.faultx@gmail.com")
- End Sub
- Private Sub PictureBox6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox6.Click
- If TextBox1.Text > "64767" Then
- MsgBox("Error - You can not set the interval larger than 64,767 ms. (1 minute 7 seconds)")
- ElseIf TextBox1.Text <= "0" Then
- MsgBox("Error - You should set the interval greater than 0 ms.")
- Else
- Timer1.Interval = TextBox1.Text
- Timer1.Start()
- PictureBox9.Enabled = True
- PictureBox6.Enabled = False
- PictureBox12.Enabled = False
- PictureBox3.Image = My.Resources.login2
- End If
- End Sub
- Private Sub PictureBox7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox7.Click
- If TextBox1.Text > "64767" Then
- MsgBox("Error - You can not set the interval larger than 64,767 ms. (1 minute 7 seconds)")
- ElseIf TextBox1.Text <= "0" Then
- MsgBox("Error - You should set the interval greater than 0 ms.")
- Else
- Timer2.Interval = TextBox1.Text
- Timer2.Start()
- PictureBox10.Enabled = True
- PictureBox7.Enabled = False
- PictureBox12.Enabled = False
- PictureBox4.Image = My.Resources.char2
- End If
- End Sub
- Private Sub PictureBox8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox8.Click
- If TextBox1.Text > "64767" Then
- MsgBox("Error - You can not set the interval larger than 64,767 ms. (1 minute 7 seconds)")
- ElseIf TextBox1.Text <= "0" Then
- MsgBox("Error - You should set the interval greater than 0 ms.")
- Else
- Timer3.Interval = TextBox1.Text
- Timer3.Start()
- PictureBox11.Enabled = True
- PictureBox8.Enabled = False
- PictureBox12.Enabled = False
- PictureBox5.Image = My.Resources.world2
- End If
- End Sub
- Private Sub PictureBox9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox9.Click
- Timer1.Stop()
- PictureBox9.Enabled = False
- PictureBox6.Enabled = True
- If PictureBox6.Enabled = True And PictureBox7.Enabled = True And PictureBox8.Enabled = True Then
- PictureBox12.Enabled = True
- End If
- PictureBox3.Image = My.Resources.login3
- End Sub
- Private Sub PictureBox10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox10.Click
- Timer2.Stop()
- PictureBox10.Enabled = False
- PictureBox7.Enabled = True
- If PictureBox6.Enabled = True And PictureBox7.Enabled = True And PictureBox8.Enabled = True Then
- PictureBox12.Enabled = True
- End If
- PictureBox4.Image = My.Resources.char3
- End Sub
- Private Sub PictureBox11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox11.Click
- Timer3.Stop()
- PictureBox11.Enabled = False
- PictureBox8.Enabled = True
- If PictureBox6.Enabled = True And PictureBox7.Enabled = True And PictureBox8.Enabled = True Then
- PictureBox12.Enabled = True
- End If
- PictureBox5.Image = My.Resources.world3
- End Sub
- Private Sub PictureBox12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox12.Click
- If TextBox1.Text > "64767" Then
- MsgBox("Error - You can not set the interval larger than 64,767 ms. (1 minute 7 seconds)")
- ElseIf TextBox1.Text <= "0" Then
- MsgBox("Error - You should set the interval greater than 0 ms.")
- Else
- If PictureBox6.Enabled = True And PictureBox7.Enabled = True And PictureBox8.Enabled = True Then
- Timer1.Interval = TextBox1.Text
- Timer2.Interval = TextBox1.Text
- Timer3.Interval = TextBox1.Text
- Timer1.Start()
- Timer2.Start()
- Timer3.Start()
- PictureBox6.Enabled = False
- PictureBox9.Enabled = True
- PictureBox7.Enabled = False
- PictureBox8.Enabled = False
- PictureBox12.Enabled = False
- PictureBox10.Enabled = True
- PictureBox11.Enabled = True
- PictureBox13.Enabled = True
- PictureBox3.Image = My.Resources.login2
- PictureBox4.Image = My.Resources.char2
- PictureBox5.Image = My.Resources.world2
- Else
- MsgBox("Error - One or more of the servers are already set to restart.")
- End If
- End If
- End Sub
- Private Sub PictureBox13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox13.Click
- If PictureBox6.Enabled = False And PictureBox7.Enabled = False And PictureBox8.Enabled = False Then
- Timer1.Stop()
- Timer2.Stop()
- Timer3.Stop()
- PictureBox6.Enabled = True
- PictureBox9.Enabled = False
- PictureBox7.Enabled = True
- PictureBox8.Enabled = True
- PictureBox12.Enabled = True
- PictureBox10.Enabled = False
- PictureBox11.Enabled = False
- PictureBox13.Enabled = False
- PictureBox3.Image = My.Resources.login3
- PictureBox4.Image = My.Resources.char3
- PictureBox5.Image = My.Resources.world3
- Else
- MsgBox("Error - One or more of the servers are already turned off.")
- End If
- End Sub
- Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
- Me.Close()
- End Sub
- Private Sub PictureBox6_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox6.MouseHover
- PictureBox6.Image = My.Resources.lstart2
- End Sub
- Private Sub PictureBox6_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox6.MouseLeave
- PictureBox6.Image = My.Resources.lstart1
- End Sub
- Private Sub PictureBox7_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox7.MouseHover
- PictureBox7.Image = My.Resources.cstart2
- End Sub
- Private Sub PictureBox7_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox7.MouseLeave
- PictureBox7.Image = My.Resources.cstart1
- End Sub
- Private Sub PictureBox8_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox8.MouseHover
- PictureBox8.Image = My.Resources.wstart2
- End Sub
- Private Sub PictureBox12_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox12.MouseHover
- PictureBox12.Image = My.Resources.astart2
- End Sub
- Private Sub PictureBox12_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox12.MouseLeave
- PictureBox12.Image = My.Resources.astart1
- End Sub
- Private Sub PictureBox8_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox8.MouseLeave
- PictureBox8.Image = My.Resources.wstart1
- End Sub
- Private Sub PictureBox9_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox9.MouseHover
- PictureBox9.Image = My.Resources.lstop2
- End Sub
- Private Sub PictureBox9_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox9.MouseLeave
- PictureBox9.Image = My.Resources.lstop1
- End Sub
- Private Sub PictureBox10_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox10.MouseHover
- PictureBox10.Image = My.Resources.cstop2
- End Sub
- Private Sub PictureBox10_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox10.MouseLeave
- PictureBox10.Image = My.Resources.cstop1
- End Sub
- Private Sub PictureBox11_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox11.MouseHover
- PictureBox11.Image = My.Resources.wstop2
- End Sub
- Private Sub PictureBox11_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox11.MouseLeave
- PictureBox11.Image = My.Resources.wstop1
- End Sub
- Private Sub PictureBox13_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox13.MouseHover
- PictureBox13.Image = My.Resources.astop2
- End Sub
- Private Sub PictureBox13_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox13.MouseLeave
- PictureBox13.Image = My.Resources.lstop1
- End Sub
- End Class
Download restarter.zip
Took me like 30 min to make so nothing fancy.
Extract the exe to your folder with your login, char, and world servers, then when u open it up in the top right corner set the timer interval (in milliseconds) then click the login, char, and world button, to stop it press the corresponding stop button.
You will need .net framework 3.5 so get that first.
Pic:
And source:
-Edit
Updated source code to add more checks for possible errors and to keep the application from crashing and/or overloading your computer etc. Also added a bit more functionality and i redid the UI to be a little more professional looking.