Jump to content

Sleep And Finish


Recommended Posts

Hi,

i need help with the sleep command,i have done the following:

#include <GUIConstants.au3>
#include "Misc.au3"
if _Singleton("Installer",1) = 0 Then
    Msgbox(0,"Warning","An occurence of This is already running")
    Exit
EndIf
Msgbox(65,"Hells Army Installer http://www.pspwzrd.com/HellsArmy","Hello there, this will install aThe Hells Army Server Files For Your Use. Press ok to continue.")
$sloc = RegRead("HKEY_CURRENT_USER\Software\Valve\Steam", "SteamPath")
If @error == 1 Then
msgbox(48,"Steam not found.", "Error 8, Steam Directory was not Found.")
Exit
EndIf
If @error == 2 Then
msgbox(48,"Steam not found.", "Error 12, Steam Registration was not Found.")
Exit
EndIf
If @error == 3 Then
msgbox(48,"Connection Failed.", "Error 16, Unable to remote connect to the registry.")
Exit
EndIf
If @error == -1 Then
msgbox(48,"Error!", "Error 20, Unable to open requested value.")
Exit
EndIf
$id = InputBox("Enter steamId", "Please Enter your steam id.")
If @error == 1 Then
msgbox(48,"Need Id!", "Steam Id is needed to Find the Directory. Installer will now close.")
Exit
EndIf
If @error == 1 Then
msgbox(48,"Error!", "ERROR 29!")
Exit
EndIf
$fdir = $sloc & "\steamapps\" & $id & "\counter-strike source\cstrike\maps\"
DirGetSize ( $fdir , 2)
If @error == 1 Then
msgbox(48,"Steam Id not found.", "Steam Id does not Exist on this computer. Make sure you entered it correctly. Installer will now close.")
Exit
EndIf
$bdir = $sloc & "\steamapps\" & $id & "\counter-strike source\cstrike\"
$r = Msgbox(65,"Ready to Install", "Directory For Maps Found! Instalation will now begin. Press ok to Contine.")
If $r=2 Then
Exit
EndIf
GuiCreate("Steam Install",500,60)
$File=GUICtrlCreateLabel("File :",5,5,390,17)
$progress=GUICtrlCreateProgress(5,25,390,20)
GUISetState()
FileInstall("I:/File Pack/aim_ag_texture2.bsp",$fdir)
GUICtrlSetData($progress,1*50);First file=1 for have percent you divide files per 100 so 2files=50
GUICtrlSetData($File,"File : Aim_ag_texture2")
FileInstall("I:/File Pack/aim_ag_texture1695.bsp",$fdir)
GUICtrlSetData($progress,1*100)
GUICtrlSetData($File,"File : Aim_ag_texture1695")
FileInstall("I:/File Pack/ReadMe.txt",$fdir)
GUICtrlSetData($File,"File : Finalizing Installation")
If $progress=100 Then
    
While 1
Sleep(5000)
Wend
MsgBox(64,"Complete", "Installation complete! Now Go Own Some Noobs!")

But whenever i complete it,it just hangs on the last file,i puts it there,but it "sleeps" for wasy over 5 seconds,what have i done wrong?

Thanks

Joe

Link to comment
Share on other sites

There is no Endif to youre final if statement!

Plus you could do

IF $progress=100 THEN
Sleep(5000)
MsgBox(...)
ENDIF

Hope this helps AlphaWolf!

No endif is optionnal for exemple if the "if" have only one line like that :

If $progress=100 then sleep(5000)

you won't have error...

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE
Link to comment
Share on other sites

No endif is optionnal for exemple if the "if" have only one line like that :

If $progress=100 then sleep(5000)

you won't have error...

Yeah, but in the ops code he had a multiline if statement without a closing endif, plus unessesary while loop! Edited by MOBIUS

wtfpl-badge-1.png

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...