Jump to content

Recommended Posts

Posted

I am fairly new to using Autoit but have been learning to write some simple scripts. I am having problems with this scritp and wonder if somebody might help me out.

I have been using this script for a game that I play. I would like to add alt+tab to the script so that I can: 1st) run script once 2nd) alt tab to a second window 3) run the same script again 4) alt tab back to the first window and continue to repeat.

This is what I have so far...

Global $Paused

HotKeySet("`", "TogglePause")

HotKeySet("{DEL}", "Terminate")

$a = InputBox( "Question", "Delay between clicks?", "11250" )

WinWaitActive( "Darkfall Online" )

Sleep( 2000 )

While 1

MouseClick( "Left" )

Sleep( $a )

WEnd

Func TogglePause( )

$Paused = NOT $Paused

While $Paused

sleep(100)

ToolTip('Script is "Paused"',0,0)

WEnd

ToolTip("")

EndFunc

Func Terminate( )

Exit 0

EndFunc

Posted

Global $Paused

HotKeySet("`", "TogglePause")
HotKeySet("{DEL}", "Terminate")
HotKeySet("{F9}", "Switcher")

$a = InputBox("Question", "Delay between clicks?", "11250")
WinWaitActive("Darkfall Online")

Sleep(2000)

While 1
    MouseClick("Left")
    Sleep($a)
WEnd

Func Switcher()
    Send("!{TAB}")
EndFunc

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

8)

NEWHeader1.png

Posted

Thank you very much for your reply Valuater. I tried this and it does nto seem to work. My hope is for the script to switch to the second window every 3 seconds (roughly) run again then switch back to the first window and run again. Then continue to repeate.

I tried to use your script and it does not seem to switch back and forth between the windows.

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
×
×
  • Create New...