Sign in to follow this  
Followers 0
ZanaxNL

> HowTo: 2Functions on 1Hotkey

20 posts in this topic

Hey.

I need to do 2 function on the {Home} Key

when i do

HotKeySet("{Home}", "TogglePause")

HotKeySet("{Home}", "Trial")

it dont work.

Fix please : D

Thx

ZanaxNL

Share this post


Link to post
Share on other sites



Ok,

but i have on that [home] key a sending key script. but i want that he automatic close in 30minutes. but than will the sending keys stops by the line. sleep(1800000) so he will only wait.. how to fix that ?

Share this post


Link to post
Share on other sites

With the HOME key he will start the progress (Sending keystrokes)

And when the HOME key is pressed then there most be a timer that says Over 30minutes > Exit

Help me : (

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

It only count how long it takes... can u fix it in the scirpt what i post in my last post.

I dont understand what u mean...

Sorry,

ZanaxNL

Share this post


Link to post
Share on other sites

OMG?

u can better what to fill in.

not giv some script codes.

Just tell what to do. timerinit just count how much 1 loop cost in time.

i want that that over 30minutes the looping stopt and > exit

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

i think it is close.

Now he will close if you press {home} key again.

Maybe most it be set in the Whil>Wend part?

Help : D

Ty

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Ah yes, makes sences.


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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Pfffffff, why do you think that.

Perhaps because of this post?

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

In that case you could link the game so we can see for ourselves and to clarify what you are trying to achieve.

Share this post


Link to post
Share on other sites

Closed did it other way.

Share this post


Link to post
Share on other sites

a other guy on the internet, give me a the edited script.

$x = $x+2   
if $x = 1800 then
exit

and than in begin $x=0

. Closed

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  
Followers 0