Jump to content

Recommended Posts

Posted

Can someone explain the Autoit error to me I'm not sure what I did wrong 

#Include <MsgBoxConstants.au3>
Local $PanMan = InputBox("Title Im on top", "Prompt Im at bottom", "Im the PassCode Part", "","M2" _
             - 1, -1, 0, 0)
Sleep("1000", $PanMan)
;MsgBox($MB_SYSTEMMODAL, "", $PanMan)
;MsgBox($MB_OK, "", $PanMan)

Here's a gif I've created (To give you a better perspective)

825644059_ScreenRecording2021-01-01at11_19_17_03AM.gif.da9e991dd81afcf141eadb1e0f5d93d6.gif

I put 1000 so that the sleep time could be 1000
But I don't know what the error is telling me, hopefully you can make it sound more simple

 

Posted (edited)
9 minutes ago, Subz said:

Sleep only has one parameter it should just be Sleep(1000), which is 1 second although unsure why you need the sleep.

I need sleep, to change the value of it by using the input GUI

And thank you

Edited by IcantCodeHelp
Posted

Sorry that doesn't make sense, inputbox will pause until the user has clicked the OK button, so there is no need for the sleep, your parameters are also incorrect it should be something like:

Local $sValue = InputBox("Title Im on top", "Prompt Im at bottom", "", " M2")
MsgBox(4096, "", $sValue)

 

Posted

You can simply use 

Sleep ($PanMan)

or better:

#Include <MsgBoxConstants.au3>
Local $PanMan = InputBox("Title Im on top", "Prompt Im at bottom", "5000", "","M2" _
             - 1, -1, 0, 0)

Sleep((IsNumber($PanMan)=1) ? $PanMan : 3000)           ;Check if the $PanMan is a number, then sleep for that amount, or if not, sleep for 3 seconds.
MsgBox($MB_SYSTEMMODAL, "", $PanMan)

 

Some of my script sourcecode

Posted (edited)
32 minutes ago, Dan_555 said:

You can simply use 

Sleep ($PanMan)

or better:

#Include <MsgBoxConstants.au3>
Local $PanMan = InputBox("Title Im on top", "Prompt Im at bottom", "5000", "","M2" _
             - 1, -1, 0, 0)

Sleep((IsNumber($PanMan)=1) ? $PanMan : 3000)           ;Check if the $PanMan is a number, then sleep for that amount, or if not, sleep for 3 seconds.
MsgBox($MB_SYSTEMMODAL, "", $PanMan)

 

@Dan_555

The data type of the return value of InputBox() is a string, regardless of the value.  Therefore, in your second example, IsNumber($PanMan) will always return FALSE.  IsNumber() checks the variable's data type not its value.  It does not check if the value is numeric.

 

Edited by TheXman
Posted

Thanks for mentioning it, ... @TheXman

When i tested the code, it worked. Anyway this should work now:

 

Local $PanMan = int(InputBox("Title Im on top", "Prompt Im at bottom", "5000", "","M2" _
             - 1, -1, 0, 0))

Sleep((IsNumber($PanMan)=1) ? $PanMan : 3000)           ;Check if the $PanMan is a number, then sleep for that amount, or if not, sleep for 3 seconds. MsgBox($MB_SYSTEMMODAL, "", $PanMan)

should work ;)

Some of my script sourcecode

Posted

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...