Jump to content

> HowTo: 2Functions on 1Hotkey


Recommended Posts

Use TimerInit() and TimerDiff() to keep track of how much time has passed without pausing the script.

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

Func TogglePause()
    $UnPaused = NOT $UnPaused
    While $UnPaused
        ToolTip("Bot Active",0,0)
        If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then ControlSend ("####", "", "", ("{TAB}"),0)    
        Sleep (500)
        If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then ControlSend ("####", "", "", ("{F12}"),0)    
        If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then ControlSend ("####", "", "", ("{F1}"),0)
        Sleep (1000)
        If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then ControlSend ("####", "", "", ("{F12}"),0)    
        Sleep (500) 
    WEnd

EndFunc

I want that when TogglePause, ((HOME) key) is pressed/run than after 30minutes he will shutdown automaticly. when i write down Sleep (1800000) he wil stop also sending those controlsends. Please Fix this : ( !!

THANKS

ZanaxNL

Link to comment
Share on other sites

something like this perhaps

Global $time
Func TogglePause()
    $UnPaused = NOT $UnPaused
    If $UnPaused Then
        $time  = TimerInit()
    EndIf
    If TimerDiff($time) >= (1000 * 60) * 30 Then
        Exit
    EndIf   
    While $UnPaused
        ToolTip("Bot Active",0,0)
        If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then ControlSend ("####", "", "", ("{TAB}"),0)    
        Sleep (500)
        If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then ControlSend ("####", "", "", ("{F12}"),0)    
        If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then ControlSend ("####", "", "", ("{F1}"),0)
        Sleep (1000)
        If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then ControlSend ("####", "", "", ("{F12}"),0)    
        Sleep (500) 
    WEnd

EndFunc

edit: ZOMG !!!

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

"ToolTip("Bot Active",0,0)"

I'm done. ;)

OMG?

u can better what to fill in.

not giv some script codes.

Yup, he's making a BOT. He won't show us the ControlSend title because he knows we're not going to help him that way. :)

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

Pfffffff, why do you think that. its about mozzilla. but not evrybody has to know that.

Yes its a game. but flash game on game site.

Just wanna know how to stop the scirpt in a time

Im im new, play with it around a week or someting

Edited by ZanaxNL
Link to comment
Share on other sites

Try this:

#include <GUIConstantsEx.au3>

HotKeySet("{HOME}", "FunctionH")

Global $Form1 = GUICreate("Form1", 349, 49, 429, 265)
Global $Label1 = GUICtrlCreateLabel("Press HOME...", 16, 16, 324, 17)
GUISetState(@SW_SHOW)
Global $state = 0

While 1
    Sleep(10)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Form1
    EndSwitch
WEnd

Func FunctionH()
    Switch $state
        Case 0
            TogglePause()
            $state = 1
        Case 1
            Trial()
            $state=0
    EndSwitch
EndFunc

Func TogglePause()
    GuiCtrlSetData($Label1,"ToglePause is called!")
EndFunc

Func Trial()
    GuiCtrlSetData($Label1,"Trial is called!")
EndFunc

M.I.

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