Jump to content
Sign in to follow this  
AlphaWolf

Sleep And Finish

Recommended Posts

AlphaWolf

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


Share this post


Link to post
Share on other sites
Mobius

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!

Share this post


Link to post
Share on other sites
d3mon

Hello, you sould not to sleep 5sec on while because you would have 5000sec sleep perfile so...

If $progress=100 Then
Sleep(4990) ;While take 10 sleep so 4990=5000-10
MsgBox(64,"Complete", "Installation complete! Now Go Own Some Noobs!")
EndIf

While 1
Sleep(10)
Wend

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE

Share this post


Link to post
Share on other sites
d3mon

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

Share this post


Link to post
Share on other sites
Mobius

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

Share this post


Link to post
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
Sign in to follow this  

×