Jump to content
Sign in to follow this  
Ultrimo

Setting a toggle

Recommended Posts

Ultrimo

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

Share this post


Link to post
Share on other sites
AdmiralAlkex

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.

Share this post


Link to post
Share on other sites
Ultrimo

Oh, well if possible could someone explain how to make a toggle script disregarding the whole concept of the game?

Share this post


Link to post
Share on other sites
Ultrimo

Nevermind, done it after a tedious amount of reading. Thanks for the help everyone.

Share this post


Link to post
Share on other sites
somdcomputerguy

The teacher(s) who taught you how to read and the authors of the Helpfile deserve your thanks..


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.