Sign in to follow this  
Followers 0
ihenvyr

Merging Or Joing 3 Scripts

6 posts in this topic

HELLO everyone!! :think:

i have 3 scripts..

Keyboard script - hotkey which disable some keyboard keys

mouse script - which has a mouse trap script

Timer script - hotkey which has a start and countdown timer..

when timer gets zero, some keyboard keys will be disabled and mouse will be mousetrapped

when you add time, keyboard keys will be enabled and mouse will be free to move again..

is it possible to merge all the 3 script?

i have no experience about merging or joining script..

any ideas or advice.. for me to work with? :(

here is my script:

Timer script:

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

Dim $min = 0, $sec = 60, $start = False, $first_S = False, $finish_S = False

Func add4Min()
    If $first_S = False Then
        $min += 4
        $first_S = True
        $start = True
    ; script to enable mouse and keyboard
    Else
        $min += 4
        $start = True
    EndIf
    $finish_S = False
EndFunc

While 1
    If $finish_S = False Then
        If $start = True Then
            $sec -= 1
            If $sec = 0 Then
                $sec = 59
                If $min = 0 Then
                    $finish_S = True
                ;script to disable mouse and keyboard
                EndIf
                $min -= 1
            EndIf
            ToolTip('' & StringFormat('%i:%i', $min, $sec), 0, 0)
        Else
            ToolTip('' & StringFormat('%i:%i', 0, 0), 0, 0)
        EndIf
    Else
        ToolTip('' & StringFormat('%i:%i TIMED OUT', 0, 0), 0, 0)
        $first_S = False
    EndIf
    Sleep(1000)
WEnd

keyboard script:

;Other
HotKeySet("a", "OtherA")
HotKeySet("{UP}", "OtherUP")
HotKeySet("{ENTER}", "OtherENTER")

While 1
    Sleep(10)
WEnd

;Other
Func OtherA()
    Send("")
EndFunc

Func OtherUP()
    Send("")
EndFunc

Func OtherENTER()
    Send("")
EndFunc

mouse script:

#include <Misc.au3>
HotKeySet("{PGUP}", "TerminateMouseTrap")

While 1
    _MouseTrap(100, 100, 100, 100)
    Sleep(100)
WEnd

Func TerminateMouseTrap()
    _MouseTrap()
    Exit
EndFunc

Umbrella Member

Share this post


Link to post
Share on other sites



HELLO everyone!! :think:

i have 3 scripts..

Keyboard script - hotkey which disable some keyboard keys

mouse script - which has a mouse trap script

Timer script - hotkey which has a start and countdown timer..

when timer gets zero, some keyboard keys will be disabled and mouse will be mousetrapped

when you add time, keyboard keys will be enabled and mouse will be free to move again..

is it possible to merge all the 3 script?

i have no experience about merging or joining script..

any ideas or advice.. for me to work with? :(

Since the bulk of your three individual scripts are clustered in functions anyways, you can just put them all in one script without interferring with each other. Then you just need to specify the criteria for each of those functions being called... If it makes it easier, you could put the criteria that exists in each individual script into their own respective functions.. Would make things easier to keep straight.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

criteria? :think:

i've search criteria on the help file, but i failed..

there is no specific example to begin with my/this script..

may be an example will be much helpful .. :)

anybody here knows about merging/joining scripts? ;)

please help.. :D

thanks for ur time.. :(

Edited by ihenvyr

Umbrella Member

Share this post


Link to post
Share on other sites

criteria? :think:

i've search criteria on the help file, but i failed..

there is no specific example to begin with my/this script..

omg, this has had me almost rolling on the ground.


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

omg, this has had me almost rolling on the ground.

Hi,

me too. :think:

Try this:

#include <Misc.au3>
HotKeySet("{PGUP}", "TerminateMouseTrap"); the backdoor for disableing the mouseTrap.
HotKeySet("t", "add4Min")
HotKeySet("{F2}", "end")

Dim $min = 0, $sec = 60, $start = False, $first_S = False, $finish_S = False

While 1
    If $finish_S = False Then
        If $start = True Then
            $sec -= 1
            If $sec = 0 Then
                $min -= 1
                If $min = 0 Then
                    $finish_S = True
                    MouseTrap()
                    HotKeySet("a", "doNothing")
                    HotKeySet("{UP}", "doNothing")
                    HotKeySet("{ENTER}", "doNothing")
                EndIf
                $sec = 59
            EndIf
            ToolTip('TIME LEFT: ' & StringFormat('%i minute(s) and %i second(s)', $min, $sec), 0, 0)
        Else
            ToolTip('TIME LEFT: ' & StringFormat('%i minute(s) and %i second(s)', 0, 0), 0, 0)
        EndIf
    Else
        ToolTip('TIME LEFT: ' & StringFormat('%i minute(s) and %i second(s) - FINISHED!!!', 0, 0), 0, 0)
        $first_S = False
    EndIf
    Sleep(5)
WEnd

Func add4Min()
    TerminateMouseTrap()
    HotKeySet("a")
    HotKeySet("{UP}")
    HotKeySet("{ENTER}")
    If $first_S = False Then
        $min += 3
        $first_S = True
        $start = True
    Else
        $min += 4
        $start = True
    EndIf
    $finish_S = False
EndFunc  ;==>add4Min

Func MouseTrap()
    _MouseTrap(100, 100, 100, 100)
EndFunc  ;==>MouseTrap

Func TerminateMouseTrap()
    _MouseTrap()
EndFunc  ;==>TerminateMouseTrap

Func doNothing()
EndFunc  ;==>doNothing

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

Func OnAutoItExit()
    TerminateMouseTrap()
EndFunc  ;==>OnAutoItExit

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Since the bulk of your three individual scripts are clustered in functions anyways, you can just put them all in one script without interferring with each other. Then you just need to specify the criteria for each of those functions being called... If it makes it easier, you could put the criteria that exists in each individual script into their own respective functions.. Would make things easier to keep straight.

From the user guide (Functions):

User Functions

User functions are declared using the Func...EndFunc statements.

Functions can accept parameters and return values as required.

Yes, I know, not everybody has English (or AutoIT) as their first language. Maybe the translator should have translated criteria as parameter.

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