Jump to content

Im a newb.


Legacy1
 Share

Recommended Posts

K, so my friend started using AutoIt and he said it was good so I downloaded it and tried it. I have written a little simple script and it doesn't work? The tooltips work but the hotkeys dont.

While 1
    
ToolTip("Launch Steam F1",600,0,"HotKeys")
Sleep(2000)

ToolTip("Launch Firefox F2",600,0,"HotKeys")
Sleep(2000)

ToolTip("Launch MSN F3",600,0,"HotKeys")
Sleep(2000)

ToolTip("Launch SPaMR F4",600,0,"HotKeys")
Sleep(2000)
Wend



HotKeySet("{F1}","Steam")
HotKeySet("{F2}","Firefox")
HotKeySet("{F3}","MSN")
HotKeySet("{F4}","SPaMR")



While 1
    Sleep(100)
WEnd

Func Steam()
    Run("C:\Program Files\Steam\Steam.exe")
EndFunc

Func Firefox()
    Run("C:\Program Files\Firefox\Firefox.exe")
EndFunc

Func MSN()
    Run("C:\Program Files\Windows Live\Messenger\msnmsgr.exe")
EndFunc

Func SPaMR()
    Run("C:\Documents and Settings\Harry\My Documents\SPaMR\SPaMR.exe")
EndFunc

While 1
    Sleep(100)
WEnd

Maybe some unnecessary stuff, but I'm a newb. So, any help?

Link to comment
Share on other sites

You have to declare the hotkeys before the loop. Also you don't need that second while loop. Like this:

HotKeySet("{F1}", "Steam")
HotKeySet("{F2}", "Firefox")
HotKeySet("{F3}", "MSN")
HotKeySet("{F4}", "SPaMR")

While 1

    ToolTip("Launch Steam F1", 600, 0, "HotKeys")
    Sleep(2000)

    ToolTip("Launch Firefox F2", 600, 0, "HotKeys")
    Sleep(2000)

    ToolTip("Launch MSN F3", 600, 0, "HotKeys")
    Sleep(2000)

    ToolTip("Launch SPaMR F4", 600, 0, "HotKeys")
    Sleep(2000)
WEnd

While 1
    Sleep(100)
WEnd

Func Steam()
    Run("C:\Program Files\Steam\Steam.exe")
EndFunc   ;==>Steam

Func Firefox()
    Run("C:\Program Files\Firefox\Firefox.exe")
EndFunc   ;==>Firefox

Func MSN()
    Run("C:\Program Files\Windows Live\Messenger\msnmsgr.exe")
EndFunc   ;==>MSN

Func SPaMR()
    Run("C:\Documents and Settings\Harry\My Documents\SPaMR\SPaMR.exe")
EndFunc   ;==>SPaMR
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...