Sign in to follow this  
Followers 0
Archman

IF Then & Shift

6 posts in this topic

Hi all as you can see this is my first post, I only discovered this prog yesterday and have very little coding experience.

Any how i have gotten hold of a script that was posted on a different forum so that people could modify and edit for themselves. ( How i found out about AutoIt)

My problem is i do not now how to properly use the if, then, and functions or how to make it Send(GUICtrlRead($input)) with Shift

so if $input was 9 i want it to press Shift and 9.

Origional Code ----- $input = 9 ---- ( if Tick box is ticked then Send $input so it presses the number 9 key)

; ATTACK 1
    If GUICtrlRead($checkboxattack1) = 1 Then        
    Send(GUICtrlRead($input))
    Sleep(2000+Random(1,25))
    EndIfoÝ÷ Ø̶צ¦×
^Ó~¢­

So please can somebody Tell me how my attempted script should be layed out, and how i make it use Shift + 9

Share this post


Link to post
Share on other sites



If GUICtrlRead($Input) = 9 Then Send("{LSHIFT}")


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Naw sorry u missunderstand i dont want it so if $attack = 9 it sends shift

I want it so that if The Shift box is ticked it will send Shift & 9 together

If the shift box is not ticked it will just send 9

Share this post


Link to post
Share on other sites

Ok iv sussed i can use Shit with {SHIFTDOWN} & {SHIFTUP}

but what is the proper format for testing the 2 variables are ticked.

If GUICtrlRead($checkboxattack1) = 1 And    
    If GUICtrlRead($checkboxattack1a) = 1 Then
    Send{SHIFTDOWN}
    Send(GUICtrlRead($input))
    Send{SHIFTUP}
    ElseIf  GUICtrlRead($checkboxattack1) = 1 And             
    if GUICtrlRead($checkboxattack1a) = 0 Then
    Send(GUICtrlRead($input))
    Sleep(2000+Random(1,25))
    EndIf

When i try using And i get an error message

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If GUICtrlRead($checkboxattack1) = 1 And GUICtrlRead($checkboxattack1a) = 1 Then
    Send{SHIFTDOWN}
    Send(GUICtrlRead($input))
    Send{SHIFTUP}
ElseIf GUICtrlRead($checkboxattack1) = 1 And GUICtrlRead($checkboxattack1a) = 0 Then
    Send(GUICtrlRead($input))
    Sleep(2000 + Random(1, 25))
EndIfoÝ÷ ÚÚºÚ"µÍYÕRPÝXY
    ÌÍØÚXÚØÞ]XÚÌJHHH[RYÕRPÝXY
    ÌÍØÚXÚØÞ]XÚÌXJHHH[BTÙ[ÔÒQÕÓBBTÙ[
ÕRPÝXY
    ÌÍÚ[]
JBBTÙ[ÔÒQTBQ[ÙRYÕRPÝXY
    ÌÍØÚXÚØÞ]XÚÌXJHH[BTÙ[
ÕRPÝXY
    ÌÍÚ[]
JBBTÛY

È[ÛJKJJBQ[Y[Y

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Nice one Thank you :)

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