Sign in to follow this  
Followers 0
sd333221

I am going crazy with the most easy script :)

8 posts in this topic

#1 ·  Posted (edited)

:whistle:

I want my script, if "{SPACE}" gets pressed, to do nothing (Sleep(1500)), and after 1.5sec

to interrupt it for 1 Sec, by "BlockInput(1)"...

Then it can go on...

So i need the Space-Key to be still sended and to be interrupted for 1 sec after 1.5 sec...

Also i need multi-call protection (i get recursion overflow sometimes)

My problem is, that if i do it like its in the bottom, the {Space} Key wont be sent...

also if i do Send( "{Space}" ) but i dont want to send Space i want the key to be hold down..

not only to send it :)

I hope you can help me,

thank you so much :)

HotKeySet("{SPACE}", "Input")

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;



Func Input()
    ;Send( "{SPACE}" ) <- this aint gonna work lol......
    Sleep( 1500 )
        blockinput( 1 )
    Sleep( 1000 )
    blockinput( 0 )
EndFunc
Edited by sd333221

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

HotKeySet("{SPACE}", "Input")

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func Input()
    HotKeySet('{SPACE}')
    Send(' ') 
    Sleep(1500)
    blockinput( 1 )
    Sleep(1000)
    blockinput(0)
    HotKeySet('{SPACE}', 'Input')
EndFunc

Edit:

Oops, Larry already did it.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

HotKeySet("{SPACE}", "Input")
HotKeySet("{ESC}", "ESC")

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;



Func Input()
    HotKeySet("{SPACE}")
    Send("{SPACE}")
    HotKeySet("{SPACE}","Input")
    Sleep( 1500 )
    blockinput( 1 )
    Sleep( 2000 )
    blockinput( 0 )
EndFunc

Func ESC()
    EXIT
EndFunc oÝ÷ Ù8b²+'¢Ü(®H§«"·l²êi¢Ç¶h"×+jÈ^vl¢jnµêç£pÇ·ß}÷ß}÷ß}÷ß}È*.Á©çjIèÃrr©W¢µ©Ýµë-bjxhÔ©iǧ£§v+p¢¹,nëbµÚ²}ý¶­²Ú)¥çZ~׫×q8^~éܶ*'ÆÞxjY^vh¥*'²íg¬ü¨ºËh¦Þ²È§+ZÜ×è¯],yËayÊ&¦ë^­úÞ{7¬jwb·l~Þ½êç¢Ö¬f§jx®zH"-¢yr«-¡·jY^vÜzì¢g­)à¢Ø^¯Ó¨¢l¶§*.Jj$z+l)ºÆ¢vl®åzl°Ú-jëh×6Func Input()
    HotKeySet("{SPACE}")
    Send("{SPACE}")
    HotKeySet("{SPACE}","Input")
    Sleep( 1500 )
    blockinput( 1 )
    Sleep( 2000 )
    blockinput( 0 )
EndFuncoÝ÷ Ù¬jëh×6
Func Input()
    HotKeySet("{SPACE}")
    Send("{SPACE}")
    Sleep( 1500 )
    blockinput( 1 )
    Sleep( 2000 )
    blockinput( 0 )
    HotKeySet("{SPACE}","Input")
EndFunc

Was a missunderstanding,

thousands thanks go to you, guys :whistle:

Edited by sd333221

Share this post


Link to post
Share on other sites

I wonder why

blockinput( 1 )

:whistle:

It interrupts Space for 1 secound,

do you know a better solution to block a single key?

If yes, let me know :)

Share this post


Link to post
Share on other sites

Opt("SendKeyDownDelay", 1500)

Func Input()

Send("{Space}")

Sleep(2000)

EndFunc

There. It holds space for 1,5 second and waits 2 seconds


[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Share this post


Link to post
Share on other sites

I think what volleyman was thinking about was something more like:

HotKeySet("{SPACE}", "SleepyTime")

Func SleepyTime()
    Sleep(1500)
EndFunc

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  
Followers 0