dupa

Author Topic: Wscript.Sleep workaround solved  (Read 6119 times)

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
Wscript.Sleep workaround solved
« on: June 02, 2011, 04:08:14 am »
I found a way to use the Wscript.Sleep function with Ultra Hal.

Here is the workaround:

Code: [Select]
Set objWSHShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

MyDir = "C:\MyVariableDirectory\"

If objFSO.FileExists(MyDir & "MySleep.vbs") Then MyFileExists = True Else MyFileExists = False
If MyFileExists = False Then
Set HalXBrain = CreateObject("UltraHalAsst.Brain")
HalXBrain.AppendFile(MyDir & "MySleep.vbs"), "WScript.sleep 1000"
Do Until objFSO.FileExists(MyDir & "MySleep.vbs") : Loop
End If

objWSHShell.Run """" & MyDir & "MySleep.vbs" & """", ,true

That will set up the file you need, and Wscript.Sleep for one second. Of course the time could be changed.
If you want to go longer, change the 1000 (one second) to 5000 (for five seconds) and so on.

Beautiful. It almost makes me cry.
:)
« Last Edit: June 02, 2011, 04:15:29 am by jasondude7116 »
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Wscript.Sleep workaround solved
« Reply #1 on: June 06, 2011, 06:31:37 pm »
  It looks pretty good, my latest attempts at doing some scripting have failed. I use to be able to get her to change clothes but now the commands stopped working for some reason.
Carl2