Jump to content
Sign in to follow this  
Varsity

Need help: Intricate Script!!

Recommended Posts

Varsity

AdLibRegister( "AutoMessage3", GUICtrlRead($Message3d) )
Func Message3()

    Send( Message3 )
Sleep(50000)
    EndFunc
    
AdLibRegister( "AutoMessage2", GUICtrlRead($Message2d) )
Func Message2()

    Send( Message2 )
Sleep(25000)
    EndFunc
    
AdLibRegister( "AutoMessage1", GUICtrlRead($Message1d) )
Func Message1()

    Send( Message1 )
Sleep(12500)
    EndFunc

With the above being given, how can I make a script to send each message with the delay given from an input box (Message1d), etc. All, one at a time, without associating with eachothers timers?

I tried using

Message1()
Message2()
Message3()

But that sends each message right after one another, and completely disregards the input time variable.. Any suggestions? Thanks in advance!

Cheers.

Share this post


Link to post
Share on other sites
JoHanatCent

AdLibRegister( "AutoMessage3", GUICtrlRead($Message3d) )
Func Message3()

    Send( Message3 )
Sleep(50000)
    EndFunc
    
AdLibRegister( "AutoMessage2", GUICtrlRead($Message2d) )
Func Message2()

    Send( Message2 )
Sleep(25000)
    EndFunc
    
AdLibRegister( "AutoMessage1", GUICtrlRead($Message1d) )
Func Message1()

    Send( Message1 )
Sleep(12500)
    EndFunc

With the above being given, how can I make a script to send each message with the delay given from an input box (Message1d), etc. All, one at a time, without associating with eachothers timers?

I tried using

Message1()
Message2()
Message3()

But that sends each message right after one another, and completely disregards the input time variable.. Any suggestions? Thanks in advance!

Cheers.

Without seeing the rest of the script a few questions?

Do you have a loop eg While Wend to keep AdLibRegister alive?

Did you consider the fact each time AdLibRegister fires everything is paused until done?

Are you sure GUICtrlRead is returning a number?


Share this post


Link to post
Share on other sites
Varsity

1. There is a loop integrated, and it does loop; however each message fires one after another, without waiting the time of the input variable from the designated GUIControlRead section.

2. Yes, I'm wanting it to send line 1, put line 1 to sleep, fire line 2 (Line 1 is still sleeping, but line 2 doesn't wait), etc. ****I hope that made sense?****

3. The GUICtrlRead is set at a numeric value for each: 1) 1500, 2) 35000, 3) 60000.

Share this post


Link to post
Share on other sites
JoHanatCent

1. There is a loop integrated, and it does loop; however each message fires one after another, without waiting the time of the input variable from the designated GUIControlRead section.

2. Yes, I'm wanting it to send line 1, put line 1 to sleep, fire line 2 (Line 1 is still sleeping, but line 2 doesn't wait), etc. ****I hope that made sense?****

3. The GUICtrlRead is set at a numeric value for each: 1) 1500, 2) 35000, 3) 60000.

This seems to work?

Global $Message1d = 1000, $Message2d = 2000, $Message3d = 3000
AdlibRegister("AutoMessage3", $Message3d)
Func AutoMessage3()
    Send("Message3")
    Send("{asc 013}")
    Sleep(5000)
EndFunc   ;==>AutoMessage3
AdlibRegister("AutoMessage2", $Message2d)
Func AutoMessage2()
    Send(" Message2")
    Send("{asc 013}")
    Sleep(2500)
EndFunc   ;==>AutoMessage2
AdlibRegister("AutoMessage1", $Message1d)
Func AutoMessage1()
    Send("   Message1")
    Send("{asc 013}")
    Sleep(1250)
EndFunc   ;==>AutoMessage1
While 1
    Sleep(13)
WEnd

Share this post


Link to post
Share on other sites
MvGulik

And I put this in both the General Support section, as well as this one; because I didn't know which section could help. So, sorry!.

Just don't. If your not sure, stick to "General help". And if your wrong, you can always ask for the topic to be moved.

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites
Varsity

Just don't. If your not sure, stick to "General help". And if your wrong, you can always ask for the topic to be moved.

Thanks for the heads up :)

Share this post


Link to post
Share on other sites
Varsity

This seems to work?

Global $Message1d = 1000, $Message2d = 2000, $Message3d = 3000
AdlibRegister("AutoMessage3", $Message3d)
Func AutoMessage3()
    Send("Message3")
    Send("{asc 013}")
    Sleep(5000)
EndFunc   ;==>AutoMessage3
AdlibRegister("AutoMessage2", $Message2d)
Func AutoMessage2()
    Send(" Message2")
    Send("{asc 013}")
    Sleep(2500)
EndFunc   ;==>AutoMessage2
AdlibRegister("AutoMessage1", $Message1d)
Func AutoMessage1()
    Send("   Message1")
    Send("{asc 013}")
    Sleep(1250)
EndFunc   ;==>AutoMessage1
While 1
    Sleep(13)
WEnd

Thanks! I'll try it out in a sec

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.