Jump to content

Setting a toggle


Recommended Posts

I have downloaded a script from someone that basically helps in playing a game. The buttons Q, E, W and R are used to cast spells but unfortunately the script is active even when typing and so screws up what you typed by clicking away from the text box and thus removing focus from it. I'd like to be able to make this script be disabled whenever enter is pressed and then re-enable the next time enter is pressed. The reason for this is that when you chat in game you must first press enter to bring up the text box so I would like the script disabled then. You then press enter again to send the message, at which point I'd like the script to function once again.

Here is the script:

#include <Misc.au3>
$typing = 0
$dll = DllOpen("user32.dll")
HotKeySet("+{PAUSE}", "exitsc")
$qpressed = False
$wpressed = False
$epressed = False
$rpressed = False
While 1
    if (_IsPressed("51", $dll)) Then
            $qpressed = True
    ElseIf ($qpressed) Then
            $qpressed = False;
            MouseClick("left");
    endIf
    if (_IsPressed("57", $dll)) Then
            $wpressed = True
    ElseIf ($wpressed) Then
            $wpressed = False;
            MouseClick("left");
    endIf
    if (_IsPressed("45", $dll)) Then
            $epressed = True
    ElseIf ($epressed) Then
            $epressed = False;
            MouseClick("left");
    endIf
    if (_IsPressed("52", $dll)) Then
            $rpressed = True
    ElseIf ($rpressed) Then
            $rpressed = False;
            MouseClick("left");
    endIf
WEnd
Func exitsc()
    DllClose($dll)
    Exit
EndFunc

As you can see I attempted to create a variable called typing but everything I tried from there didn't work. I have basically no understanding of how this scripting works.

Thank you.

Edited by Ultrimo
Link to comment
Share on other sites

Hi and Welcome to the forums!

Please note that we can't help you with this subject as it's strictly forbidden by the forum rules to discuss any game automation.

I hope you'll understand.

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