Jump to content

[Solved]Trigger Func After Certian Amount Of Time


 Share

Recommended Posts

ok so i have a server re starter which i have been building and well it runs perfectly i have now included a few images etc into it but what i want to do now i have it grab the time now and then add lets say 1 hour to that value and when that time comes call the function _Restart i have tried making looping counters but that stops the GUI from working and well ._. im out of ideas XD.

i have seen this done but im not sure how and i haven't found much on the forums about this kind of system.

so if anyone has any knowledge or has done this can u help me please XD last thing i need to do before i start messing with sending data from the client program to the server to do remote restarting.

Code:

[attachment=26442:icons.au3]#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Icons\web-server.ico
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_Res_Comment=Flyff Life Restarter
#AutoIt3Wrapper_Res_Description=Flyff Life Restarter
#AutoIt3Wrapper_Res_Fileversion=3.0.0.1
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=Kris Database / Server Host
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_Run_Tidy=y
#Tidy_Parameters=/rel
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; *** Start added by AutoIt3Wrapper ***
#include <Constants.au3>
; *** End added by AutoIt3Wrapper ***
Global $hMutex
;============# Prevent from secondary run #====================================
$hMutex = DllCall("kernel32.dll", "hwnd", "OpenMutex", "int", 0x1F0001, "int", False, "str", "USBMon")
If $hMutex[0] Then
    $Form1_1_1 = WinGetHandle("Flyff Life")
    WinSetState($Form1_1_1, "", @SW_RESTORE)
    DllCall("user32.dll", "int", "SetForegroundWindow", "hwnd", $Form1_1_1)
    Exit
EndIf
$hMutex = DllCall("kernel32.dll", "hwnd", "CreateMutex", "int", 0, "int", False, "str", "USBMon")
;================================================================================
Global $Charstats, $loginstats, $Worldstats ;==> Server Stats
Global $Group1, $Form1, $Label1 ;==> GUI Setup
Global $WChar, $WLogin, $WWorld ;==> GUI Words For Servers
Global $DChar, $DLogin, $DWorld ;==> GUI Words Detection Information
Global $SChar, $SLogin, $SWorld ;==> Stats For Servers
Global $Start, $Status, $Close, $Restart ;==> Buttons
Global $GroupButtons, $GroupInfo ;==> Groups
Global $Menu, $restore ;==> Tray Menus
Global $iniFile, $g_IP, $time, $reset, $pic, $pic0, $off, $Form1_1_1
Global $picloc1, $picloc, $picloc2
Global $g_IPc, $socketc, $g_IP1c
Global $g_IPl, $socketl, $g_IP1l
Global $g_IPw, $socketw, $g_IP1w
Opt("TrayMenuMode", 1)
$time = 0
$Menu = TrayCreateMenu("Made By")
$aboutitem = TrayCreateItem("Kris", $Menu)
$aboutitem1 = TrayCreateItem("Flyff Life Server Host", $Menu)
$Menu = TrayCreateMenu("Debug / Help From")
$aboutitem14 = TrayCreateItem("Thanks Guys XD", $Menu)
$aboutitem11 = TrayCreateItem("Authenticity", $Menu)
$aboutitem12 = TrayCreateItem("martin", $Menu)
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Icons.au3>
Func _Restart()
    GUISetState(@SW_DISABLE)
    ProcessClose("3. World Server.exe")
    Sleep(1000)
    ProcessClose("2. Char Server.exe")
    Sleep(1000)
    Run("2. Char Server.exe")
    Sleep(1000)
    Run("3. World Server.exe")
    Sleep(1000)
    GUISetState(@SW_ENABLE)
    Sleep(500)
    _Detection()
EndFunc   ;==>_Restart
Func _Start()
    GUISetState(@SW_DISABLE)
    Run("1. Login Server.exe")
    Sleep(1000)
    Run("2. Char Server.exe")
    Sleep(1000)
    Run("3. World Server.exe")
    GUISetState(@SW_ENABLE)
    Sleep(500)
    _Detection()
EndFunc   ;==>_Start
Func _Stop()
    GUISetState(@SW_DISABLE)
    ProcessClose("3. World Server.exe")
    Sleep(1000)
    ProcessClose("2. Char Server.exe")
    Sleep(3000)
    ProcessClose("1. Login Server.exe")
    GUISetState(@SW_ENABLE)
    Sleep(500)
    _Detection()
EndFunc   ;==>_Stop
Func _Splash()
    #Region --- CodeWizard generated code Start ---
    ;SpashImage features: Title=No, Width=754, Height=137 Start Up Image
    SplashImageOn("", @ScriptDir & "\images\flyfflife.jpg", "754", "137", "-1", "-1", 3)
    Sleep(200)
    SplashOff()
    #EndRegion --- CodeWizard generated code Start ---
EndFunc   ;==>_Splash
Func _Detection()
    Sleep(200)
    $picloc2 = (@ScriptDir & "\images\Server.gif")
    GUISetState()
    _SetImage($pic, $picloc2)
    Sleep(200)
    GUICtrlSetData($SLogin, "Testing")
    Sleep(200)
    GUICtrlSetData($SChar, "Testing")
    Sleep(200)
    GUICtrlSetData($SWorld, "Testing")
    Sleep(200)
    GUISetState(@SW_DISABLE)
    TCPStartup()
    ;==> Login
    Sleep(200)
    $g_IP1l = TCPNameToIP($g_IPl)
    $socketl = TCPConnect($g_IP1l, 23000)
    If $socketl = -1 Then
        Sleep(200)
        GUICtrlSetData($SLogin, "OFF")
        $off = $off + 1
    Else
        Sleep(200)
        GUICtrlSetData($SLogin, "ON")
    EndIf ;==> Login
    ;==> Char
    $g_IP1c = TCPNameToIP($g_IPc)
    $socketc = TCPConnect($g_IP1c, 28000)
    If $socketc = -1 Then
        Sleep(200)
        GUICtrlSetData($SChar, "OFF")
        $off = $off + 1
    Else
        Sleep(200)
        GUICtrlSetData($SChar, "ON")
    EndIf ;==> Char
    ;==> World
    Sleep(200)
    $g_IP1w = TCPNameToIP($g_IPw)
    $socketw = TCPConnect($g_IP1w, 15400)
    If $socketw = -1 Then
        Sleep(200)
        GUICtrlSetData($SWorld, "OFF")
        $off = $off + 1
    Else
        Sleep(200)
        GUICtrlSetData($SWorld, "ON")
    EndIf ;==> World
    GUISetState(@SW_ENABLE)
    GUISetState()
    TCPShutdown()
    If $off = 3 Then
        $picloc = (@ScriptDir & "\images\ServerOFF.gif")
        GUISetState()
        _SetImage($pic, $picloc)
    Else
        $picloc1 = (@ScriptDir & "\images\ServerON.gif")
        GUISetState()
        _SetImage($pic, $picloc1)
    EndIf
EndFunc   ;==>_Detection
Func _SGUI()
    _iniread()
    $g_IPc = $g_IP
    $g_IPl = $g_IP
    $g_IPw = $g_IP
    #Region ### START Koda GUI section ### Form=
    $Form1_1_1 = GUICreate("FlyFF Life", 260, 233, 367, 263)
    $Label1 = GUICtrlCreateLabel("FlyFF Life Restarter Version 2.0", 8, 8, 237, 24)
    GUICtrlSetFont(-1, 10, 800, 0, "Bookman Old Style")
    $GroupInfo = GUICtrlCreateGroup("Server Stats", 8, 32, 137, 89)
    GUICtrlSetFont(-1, 8, 400, 0, "Bookman Old Style")
    $WLogin = GUICtrlCreateLabel("Login Server :", 16, 56, 70, 17)
    $WWorld = GUICtrlCreateLabel("World Server :", 16, 88, 72, 17)
    $WChar = GUICtrlCreateLabel("Char Server :", 16, 72, 69, 17)
    $SLogin = GUICtrlCreateLabel($DLogin, 88, 56, 36, 20)
    $SChar = GUICtrlCreateLabel($DChar, 88, 72, 36, 20)
    $SWorld = GUICtrlCreateLabel($DWorld, 88, 88, 36, 20)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $GroupButtons = GUICtrlCreateGroup("Controls", 152, 32, 97, 146)
    $Start = GUICtrlCreateButton("Start Server", 160, 90, 83, 25, 0)
    $Server = GUICtrlCreateButton("Server Status", 160, 60, 83, 25, 0)
    $Close = GUICtrlCreateButton("Close Server", 160, 115, 83, 25, 0)
    $Restart = GUICtrlCreateButton("Restart Server", 160, 140, 83, 25, 0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group1 = GUICtrlCreateGroup("IP", 8, 184, 137, 41)
    GUICtrlSetFont(-1, 8, 400, 0, "Bookman Old Style")
    $Label2 = GUICtrlCreateLabel($g_IP, 16, 202, 120, 19)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Made By", 8, 126, 137, 55)
    GUICtrlSetFont(-1, 8, 400, 0, "Bookman Old Style")
    $Label3 = GUICtrlCreateLabel("Kris", 16, 144, 27, 19)
    $Label4 = GUICtrlCreateLabel("Flyff Life Server Host", 16, 161, 100, 18)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    $pic = GUICtrlCreatePic('', 175, 180, 48, 48)
    _Detection()
    #EndRegion ### END Koda GUI section ###
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $Restart
                _Restart()
            Case $Start
                _Start()
            Case $Close
                _Stop()
            Case $Server
                _Detection()
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
    WEnd
EndFunc   ;==>_SGUI
_Main()
Func _Main()
    $iniFile = @ScriptDir & "\Images\Settings\Settings.ini"
    _Splash()
    _SGUI()
EndFunc   ;==>_Main
Func _Exit()
    Exit
EndFunc   ;==>_Exit
Func _iniRead()
    $g_IP = IniRead($iniFile, "IPSettings", "ServerIP", "127.0.0.1")
EndFunc   ;==>_iniRead

icons.au3

all u need to run it is here.

Edited by Targus
Link to comment
Share on other sites

.... what i want to do now i have it grab the time now and then add lets say 1 hour to that value and when that time comes call the function _Restart ...

You don't need to record the time, you could just use

AdlibEnable("_Restart",60*60*1000)

;or AdlibRegister if using Beta 3.3.1.0 or later

Then maybe have

AdlibDisable(()

;or AdlibDisable("_Restart")

in the _Restart funcion to stop it happening again an hour later.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

ok i got it to work expect it loops every single function XD and im just using it in a case format

with using 1 radial button for eenbale and another for disable and then if enable is checked reads the input for the time and sets it like so

AdlibEnable("_Restart",$timeinput)

Edited by Targus
Link to comment
Share on other sites

AdlibEnable("_Restart",60*60*1000)

whould that still allow me to use the gui ?

I don't know of any reason why not, but I haven't studied your code. Just try it out with a small delay and see what happens.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Can I remind you both that adlibEnable is an old command as of the new beta. You should use adlibRegister instead.

Just a thought

MDiesel

edit: found it: "execution must be non blocking", yur code does not seem to block anything, so you should be alright

Edited by mdiesel
Link to comment
Share on other sites

Can I remind you both that adlibEnable is an old command as of the new beta.

Good of you to offer but there really is no need. :)

You should use adlibRegister instead.

No, that's not correct and not even to be encouraged for people producing scripts for their own customers for example.

Maybe you could read my post again mdiesel because I think I covered the option adequately.

If you are going to assume anything then assuming the production version is the most sensible IMO, and that still uses AdlibEnable. Beta means not finalized, for testing, hoping plenty of people will try it to prove it and remove bugs, could be changed etc so many people don't use Beta versions in their scripts for good reasons.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

ahh sorry for the late post i needed to finish of some tafe work == and i redid the code and redid some optimizations

ok so i have added 2 radial buttons in the code but i removed the case because it was going weird big time.

Cases :

Case $enable

GUICtrlRead($timeinput)

AdlibEnable("_Restart",60*60*1000)

case $disable

AdlibDisable("_Restart")

they dont exactly work add them to the cases and you'll see why XD

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Icons\web-server.ico
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_Res_Comment=Flyff Life Restarter
#AutoIt3Wrapper_Res_Description=Flyff Life Restarter
#AutoIt3Wrapper_Res_Fileversion=3.0.0.4
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=Kris Database / Server Host
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_Run_Tidy=y
#Tidy_Parameters=/rel
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; *** Start added by AutoIt3Wrapper ***
#include <Constants.au3>
; *** End added by AutoIt3Wrapper ***
Global $hMutex
;============# Prevent from secondary run #====================================
$hMutex = DllCall("kernel32.dll", "hwnd", "OpenMutex", "int", 0x1F0001, "int", False, "str", "USBMon")
If $hMutex[0] Then
    $Form1_1_1 = WinGetHandle("Flyff Life")
    WinSetState($Form1_1_1, "", @SW_RESTORE)
    DllCall("user32.dll", "int", "SetForegroundWindow", "hwnd", $Form1_1_1)
    Exit
EndIf
$hMutex = DllCall("kernel32.dll", "hwnd", "CreateMutex", "int", 0, "int", False, "str", "USBMon")
;================================================================================

Global $Charstats, $loginstats, $Worldstats ;==> Server Stats
Global $Group1, $Form1, $Label1 ;==> GUI Setup
Global $WChar, $WLogin, $WWorld ;==> GUI Words For Servers
Global $DChar, $DLogin, $DWorld ;==> GUI Words Detection Information
Global $SChar, $SLogin, $SWorld ;==> Stats For Servers
Global $Start, $Status, $Close, $Restart ;==> Buttons
Global $GroupButtons, $GroupInfo ;==> Groups
Global $Menu, $restore ;==> Tray Menus
Global $iniFile, $g_IP, $time, $reset, $pic, $pic0, $off, $Form1_1_1, $Enable, $disable, $Timeinput, $enabled ;==> extra stuff that needed to be declared
Global $picloc1, $picloc, $picloc2 ;==> Pictures
Global $g_IPc, $socketc, $g_IP1c ;==> Socket Check Char
Global $g_IPl, $socketl, $g_IP1l ;==> Socket Check login
Global $g_IPw, $socketw, $g_IP1w ;==> Socket Check world
Opt("TrayMenuMode", 1)
$time = 0
$Menu = TrayCreateMenu("Made By")
$aboutitem = TrayCreateItem("Kris", $Menu)
$aboutitem1 = TrayCreateItem("Flyff Life Server Host", $Menu)
$Menu = TrayCreateMenu("Debug / Help From")
$aboutitem14 = TrayCreateItem("Thanks Guys XD", $Menu)
$aboutitem11 = TrayCreateItem("Authenticity", $Menu)
$aboutitem12 = TrayCreateItem("martin", $Menu)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Icons.au3>


Func _Restart()
    GUISetState(@SW_DISABLE)
    ProcessClose("3. World Server.exe")
    Sleep(800)
    ProcessClose("2. Char Server.exe")
    Sleep(800)
    Run("2. Char Server.exe")
    Sleep(1000)
    Run("3. World Server.exe")
    Sleep(1000)
    GUISetState(@SW_ENABLE)
    GUICtrlSetData($SLogin, "Waiting")
    GUICtrlSetData($SChar, "Waiting")
    GUICtrlSetData($SWorld, "Waiting")
    Sleep(3000)
    _Detection()
EndFunc   ;==>_Restart

Func _Start()
    GUISetState(@SW_DISABLE)
    Run("1. Login Server.exe")
    Sleep(800)
    Run("2. Char Server.exe")
    Sleep(800)
    Run("3. World Server.exe")
    GUISetState(@SW_ENABLE)
    GUICtrlSetData($SLogin, "Waiting")
    GUICtrlSetData($SChar, "Waiting")
    GUICtrlSetData($SWorld, "Waiting")
    Sleep(3000)
    _Detection()
EndFunc   ;==>_Start


Func _Stop()
    GUISetState(@SW_DISABLE)
    ProcessClose("3. World Server.exe")
    Sleep(800)
    ProcessClose("2. Char Server.exe")
    Sleep(2000)
    ProcessClose("1. Login Server.exe")
    GUISetState(@SW_ENABLE)
    GUICtrlSetData($SLogin, "Waiting")
    GUICtrlSetData($SChar, "Waiting")
    GUICtrlSetData($SWorld, "Waiting")
    Sleep(3000)
    _Detection()
EndFunc   ;==>_Stop


Func _Detection()
    $off = 0
    Sleep(200)
    GUISetState(@SW_DISABLE)
    $picloc2 = (@ScriptDir & "\images\Server.gif")
    GUISetState()
    _SetImage($pic, $picloc2)
    GUICtrlSetData($SLogin, "Testing")
    GUICtrlSetData($SChar, "Testing")
    GUICtrlSetData($SWorld, "Testing")
    TCPStartup()
    ;==> Login
    $g_IP1l = TCPNameToIP($g_IPl)
    $socketl = TCPConnect($g_IP1l, 23000)
    If $socketl = -1 Then
        Sleep(200)
        GUICtrlSetData($SLogin, "OFF")
        $off = $off + 1
    Else
        GUICtrlSetData($SLogin, "ON")
    EndIf ;==> Login
    ;==> Char
    $g_IP1c = TCPNameToIP($g_IPc)
    $socketc = TCPConnect($g_IP1c, 28000)
    If $socketc = -1 Then
        GUICtrlSetData($SChar, "OFF")
        $off = $off + 1
    Else
        GUICtrlSetData($SChar, "ON")
    EndIf ;==> Char
    ;==> World
    $g_IP1w = TCPNameToIP($g_IPw)
    $socketw = TCPConnect($g_IP1w, 15400)
    If $socketw = -1 Then
        GUICtrlSetData($SWorld, "OFF")
        $off = $off + 1
    Else
        GUICtrlSetData($SWorld, "ON")
    EndIf ;==> World
    GUISetState(@SW_ENABLE)
    GUISetState()
    TCPShutdown()
    If $off = 1 Then
        $picloc = (@ScriptDir & "\images\ServerOFF.gif")
        GUISetState()
        _SetImage($pic, $picloc)
    EndIf
    If $off = 2 Then
        $picloc = (@ScriptDir & "\images\ServerOFF.gif")
        GUISetState()
        _SetImage($pic, $picloc)
    EndIf
    If $off = 3 Then
        $picloc = (@ScriptDir & "\images\ServerOFF.gif")
        GUISetState()
        _SetImage($pic, $picloc)
    EndIf
    If $off = 0 Then
        $picloc1 = (@ScriptDir & "\images\ServerON.gif")
        GUISetState()
        _SetImage($pic, $picloc1)
    EndIf
EndFunc   ;==>_Detection

Func _SGUI()
    _iniread()
    $g_IPc = $g_IP
    $g_IPl = $g_IP
    $g_IPw = $g_IP
    #Region ### START Koda GUI section ### Form=
    $Form1_1_1 = GUICreate("FlyFF Life", 260, 320, 220, 159)
    $Label1 = GUICtrlCreateLabel("FlyFF Life Restarter Version 2.0", 8, 8, 237, 24)
    GUICtrlSetFont(-1, 10, 800, 0, "Bookman Old Style")
    $GroupInfo = GUICtrlCreateGroup("Server Stats", 8, 32, 137, 81)
    GUICtrlSetFont(-1, 8, 400, 0, "Bookman Old Style")
    $WLogin = GUICtrlCreateLabel("Login Server :", 16, 56, 70, 17)
    $WWorld = GUICtrlCreateLabel("World Server :", 16, 88, 72, 17)
    $WChar = GUICtrlCreateLabel("Char Server :", 16, 72, 69, 17)
    $SLogin = GUICtrlCreateLabel($DLogin, 88, 56, 36, 20)
    $SChar = GUICtrlCreateLabel($DChar, 88, 72, 36, 20)
    $SWorld = GUICtrlCreateLabel($DWorld, 88, 88, 36, 20)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $GroupButtons = GUICtrlCreateGroup("Controls", 152, 32, 97, 154)
    $Start = GUICtrlCreateButton("Start Server", 160, 82, 83, 25)
    $Server = GUICtrlCreateButton("Server Status", 160, 52, 83, 25)
    $Close = GUICtrlCreateButton("Close Server", 160, 115, 83, 25)
    $Restart = GUICtrlCreateButton("Restart Server", 160, 148, 83, 25)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group1 = GUICtrlCreateGroup("IP", 8, 264, 137, 49)
    GUICtrlSetFont(-1, 8, 400, 0, "Bookman Old Style")
    $Label2 = GUICtrlCreateLabel($g_IP, 16, 282, 120, 19)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Made By", 8, 198, 137, 63)
    GUICtrlSetFont(-1, 8, 400, 0, "Bookman Old Style")
    $Label3 = GUICtrlCreateLabel("Kris", 16, 216, 27, 19)
    $Label4 = GUICtrlCreateLabel("Flyff Life Server Host", 16, 233, 124, 18)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $pic = GUICtrlCreatePic("", 151, 196, 48, 48)
    $Group3 = GUICtrlCreateGroup("Auto Restarter", 8, 120, 137, 73)
    GUICtrlSetFont(-1, 8, 400, 0, "Bookman Old Style")
    $time = GUICtrlCreateLabel("Time : ", 16, 168, 44, 19)
    $Timeinput = GUICtrlCreateInput("", 64, 164, 50, 23)
    $Enable = GUICtrlCreateRadio("Enable", 16, 136, 60, 25)
    $disable = GUICtrlCreateRadio("Disable", 80, 140, 60, 17)
    GUISetState(@SW_SHOW)
    $pic = GUICtrlCreatePic('', 175, 205, 48, 48)
    #EndRegion ### END Koda GUI section ###
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $Restart
                _Restart()
            Case $Start
                _Start()
            Case $Close
                _Stop()
            Case $Server
                _Detection()
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
    WEnd
EndFunc   ;==>_SGUI


_Main()


Func _Main()
    $iniFile = @ScriptDir & "\Images\Settings\Settings.ini"
    _SGUI()
EndFunc   ;==>_Main

Func _iniRead()
    $g_IP = IniRead($iniFile, "IPSettings", "ServerIP", "127.0.0.1")
EndFunc   ;==>_iniRead
Edited by Targus
Link to comment
Share on other sites

oook i got it working == now when i put in

case $disable

AdlibDisable("_Restart")

and i run it i get in a built in error

C:\Documents and Settings\Kris\Desktop\Programs\Restarter Project\Restarter Project.au3(270,28) : ERROR: AdlibDisable() [built-in] called with wrong number of args.

AdlibDisable("_Restart")

~~~~~~~~~~~~~~~~~~~~~~~^

well the gui was only 3 words before and now have a look XD

post-49351-1244204663_thumb.jpg

Edited by Targus
Link to comment
Share on other sites

ok guys i got it working 95% the other 5% is just testing to see if it does restart and does cancel the timer if i click disable thanks for all your help

next misson tcpsend XD

Edited by Targus
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...