AlmarM Posted September 11, 2007 Share Posted September 11, 2007 (edited) Hi, My script isn't working... I mean the Pause and Unpause wont work when the script is activated, and the exit func wont work too... The problem is: All things work but i think i didn't set all things in right order.. Can someone help ?? expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.6.0 Author: AlmarM Script Function: Auto Loots Extra information: AutoIT v3 Script #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) WinWait("2Moons","") ;Waits for 2Moons If Not WinActive("2Moons","") Then WinActivate("2Moons","") ;If 2Moons is not active, it will make it active WinWaitActive("2Moons","") ;Waits untill 2Moons is active HotKeySet('{esc}', '_Exit') ;ESC to Exit (put any other key you want, but it need to be between the { and } HotKeySet('{pause}', 'TogglePause') ;PAUSE to Pause and Unpause While 1 ControlSend("2Moons","","","{space}") ;Sends the key space into 2Moons Sleep(500) ;Time in Miliseconds (1000 = 1 Second) Wend Global $Paused = False While 1 If $Paused Then Sleep(100) ToolTip('Script is "Paused"', 0, 0) Else ToolTip("") EndIf WEnd Func TogglePause() $Paused = Not $Paused EndFunc ;==>TogglePause Func _Quit() Exit EndFunc Func _Exit() ;ToolTip(' '&@CRLF&' EXITING '&@CRLF&' ') Sleep(500) Exit EndFunc Edited September 11, 2007 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Wooltown Posted September 11, 2007 Share Posted September 11, 2007 Do it like this instead, then it works. expandcollapse popupOpt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) ;WinWait("2Moons","");Waits for 2Moons ;If Not WinActive("2Moons","") Then WinActivate("2Moons","");If 2Moons is not active, it will make it active ;WinWaitActive("2Moons","");Waits untill 2Moons is active HotKeySet('{ESC}', '_Exit');ESC to Exit (put any other key you want, but it need to be between the { and } HotKeySet('{pause}', 'TogglePause');PAUSE to Pause and Unpause Global $Paused = False While 1 ControlSend("2Moons","","","{space}");Sends the key space into 2Moons Sleep(500);Time in Miliseconds (1000 = 1 Second) Wend Func TogglePause() $Paused = Not $Paused If $Paused Then Sleep(100) ToolTip('Script is "Paused"', 0, 0) Else ToolTip("") EndIf EndFunc ;==>TogglePause Func _Quit() Exit EndFunc Func _Exit() ;ToolTip(' '&@CRLF&' EXITING '&@CRLF&' ') Sleep(500) Exit EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now