Jump to content

Project Problem


Recommended Posts

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?

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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
Link to comment
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 :)

Link to comment
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
 Share

  • Recently Browsing   0 members

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