Jump to content
Sign in to follow this  

Need help adding a send function to Auto It

Recommended Posts

I have been working on a program to auto send a few keys.

I need to add a feature that sends the TAB key every 4 seconds, but i don't know where and how to add it. I would like it to work in addition to the current program. Here it is:

$hkt = IniRead ( "Settings.ini", "Hotkeys", "Togglekey", "Not Set" )
$hkc = IniRead ( "Settings.ini", "Hotkeys", "Exitkey", "Not Set" )
$slpn = IniRead ( "Settings.ini", "Sleep Time", "Minimum", "Not Set" )
$slpx = IniRead ( "Settings.ini", "Sleep Time", "Maximum", "Not Set" )
If $hkt = "Not Set" AND $hkc = "Not Set" Then
    MsgBox ( 0 , "Error", "No settings.ini detected, or some data missing. Creating one now and setting to default." )
    IniWrite ( "Settings.ini", "Hotkeys", "Togglekey", "^!z" )
    IniWrite ( "Settings.ini", "Hotkeys", "Exitkey", "^!x" )
    IniWrite ( "Settings.ini", "Sleep Time", "Minimum", "30" )
    IniWrite ( "Settings.ini", "Sleep Time", "Maximum", "75" )
$toggle = 0
HotKeySet ( $hkt , "toggle" )
HotKeySet ( $hkc , "close" )
While 1
    Sleep ( 5000 )

Func toggle()
    If $toggle = 0 Then
        $toggle = 1
        $toggle = 0

Func start()
        $sleept = Random ( $slpn , $slpx , 0 )
        $sleept = $sleept * 1000
        Sleep ( 1000 )
        Sleep ( $sleept )
    Until $toggle = 0

Func close()

Share this post

Link to post
Share on other sites

At the top of you script put:

AdlibEnable('_SendTab', 4000)oÝ÷ Ø   Ýiº/{*.¬[§qÉh±ênµ«­¢+ÙÕ¹}M¹Q ¤(M¹ ÌäííQ    ôÌäì¤)¹Õ¹

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.

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  

  • Create New...