Jump to content

Start & End Hot Key Functions


Recommended Posts

Hello all. Im fairly new to autoit, I used it a year or so ago back on notepad. Things have changed a bit and Im a bit stuck. I cant seem to get the hot key functions for strating and exiting the program to work. heres what I'v got so far (if there is anything else that looks wrong point it out, Ill take all the help I can get)

HotKeySet("{F8}", "_Start")

HotKeySet("{F7}", "_Pause")

HotKeySet("{Esc}", "_Exit")

While 1 = 1

WEnd

While 1 = 1

Sleep(500)

Send ("{j}")

Sleep(500)

Send ("{=}")

Sleep(2600)

Send ("{]}")

Sleep(9600)

Send ("{j}")

Sleep(500)

Send ("{2}")

Sleep(1600)

Send ("{2}")

Sleep(1600)

Send ("{2}")

Sleep(1600)

Send ("{Tab}")

Sleep(1600)

Send ("{1}")

Sleep(1600)

WEnd

While 1 = 1

Sleep(500)

Send ("{j}")

Sleep(500)

Send ("{]}")

Sleep(9600)

Send ("{j}")

Sleep(500)

Send ("{2}")

Sleep(1600)

Send ("{2}")

Sleep(1600)

Send ("{2}")

Sleep(1600)

Send ("{Tab}")

Sleep(1900)

Send ("{3}")

Sleep(1900)

Send ("{3}")

Sleep(1900)

Send ("{3}")

Sleep(1600)

WEnd

Func _Start()

While 1 = 1

WEnd

EndFunc ;==>_Start

Func _Pause()

While 1 = 0

WEnd

EndFunc ;==>_Pause

Func _Exit()

Exit

EndFunc ;==>_Exit

Thanks for the help!

Link to comment
Share on other sites

HotKeySet("{F8}", "_Start")
HotKeySet("{F7}", "_Pause")
HotKeySet("{Esc}", "_Exit")

$loop = 0
$pause = 0

While $loop = 1
Sleep(500)
Send ("j")
Sleep(500)
Send ("=")
Sleep(2600)
Send ("]")
Sleep(9600)
Send ("j")
Sleep(500)
Send ("2")
Sleep(1600)
Send ("2")
Sleep(1600)
Send ("2")
Sleep(1600)
Send ("Tab")
Sleep(1600)
Send ("1")
Sleep(2500)
Send ("j")
Sleep(500)
Send ("]")
Sleep(9600)
Send ("j")
Sleep(500)
Send ("2")
Sleep(1600)
Send ("2")
Sleep(1600)
Send ("2")
Sleep(1600)
Send ("{Tab}")
Sleep(1900)
Send ("3")
Sleep(1900)
Send ("3")
Sleep(1900)
Send ("3")
Sleep(1600)
WEnd

while $pause = 1
    Sleep(250)
WEnd

Func _Start()
    $loop = 1
EndFunc

Func _Pause()
    if $pause = 0 Then
        $pause = 1
    ElseIf $pause = 1 Then
        $pause = 0
    EndIf
EndFunc

Func _Exit()
    Exit
EndFunc

try tht. u dont need {}'s for send unless its a button such as tab or enter etc. also u cannot change the value of 1 its a set in stone number :mellow:

Link to comment
Share on other sites

try tht. u dont need {}'s for send unless its a button such as tab or enter etc. also u cannot change the value of 1 its a set in stone number :mellow:

Ah thank you so much, but I cant get it to run the script. after iv converted it and try to run it, there is no Autoit icon that pops up on my taskbar which means its not running. I did everthing the same as I always do. I tryed a running a different script and it did work, but the coding you gave me wolnt seem to run.

Link to comment
Share on other sites

Ah thank you so much, but I cant get it to run the script. after iv converted it and try to run it, there is no Autoit icon that pops up on my taskbar which means its not running. I did everthing the same as I always do. I tryed a running a different script and it did work, but the coding you gave me wolnt seem to run.

Voila! loop needs to be = to 1 not 0 :mellow: I know it doesnt seem like much to someone w/ a lot of coding knowleged but to me its like I just fix Einsteins theory of relativity (not saying its wrong I just needed an example =P)

I still have more to do to the script and I'm sure Ill screw up again somewhere so Ill keep in touch thanks :P

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...