Sign in to follow this  
Followers 0
Dx3

Project Problem

6 posts in this topic

Hi again everyone, I'm kinda just working on scraps on AutoIt. I have this script:

HotKeySet("^{END}", "Stop")

Func stop()
    Beep(50, 100)
    Beep(4000, 100)
    Sleep(2)
EndFunc

(sorry I'm really new to AutoIt, so this may be a "duh" or "noob" question)

I run it in SciTe but it ends right when I start it. What it's supposed to do is

beep an alarm sound when I press Ctrl+End. What's wrong?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe,

HotKeySet("^{END}", "Stop")

while 1
sleep(500)
wend

Func stop()
    Beep(50, 100)
    Beep(4000, 100)
    Sleep(2)
EndFunc

Not tested.

By the way using Beep requires Beta.

And welcome to autoit :)

Edited by Infinitex0

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Share this post


Link to post
Share on other sites

Thanks so much! I hope I can become very useful to the AutoIt community. :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks so much! I hope I can become very useful to the AutoIt community. :(

Just to let you know, you may want to look into the "_ispressed" function, because HotKeySet has a tendency to steal the keys from othere uses

Ex:

Hotkeyset("a","example")

Func example()
Send("Script")
Endfunc

This(when ran in Notepad) sends "script" not "ascript"

However

If _ispressed(31) then
While _ispressed(31)
Send("Myscript")
Wend
EndIf

Will constantly send "1Myscript1Myscript" as long as the button is held

Which could be good for a Beep alarm :)

Just a bit of info

Note: "_IsPressed" requires the udf

Edited by Paulie

Share this post


Link to post
Share on other sites

requires misc.au3

Share this post


Link to post
Share on other sites

Actually, this would be kinda funny form of parental controls. you make a list of site titles that you don't want you kids visiting, and the say

While 1 
if Winexists($Predifined_Window_Title) then
Beep(3000,300)
Beep(300,300)
Endif
Wend

and beep can't be muted or turned off with volume controls

You could make a list with GUI that you can add window names to and if any ever exist, then that alarm sounds till they are gone

Thats would be cool or, better yet, it sounds that alarm then blocks input so the kid gets caught with that site open.

That would be cool

sorry that was off topic, but when you said alarm it got me thinking :)

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