Jump to content

If statement help


Recommended Posts

When running this script it just sends shift down then up and thats it. How do i get it to check whether the right mouse button is clicked?

Thanks in advance

Global $mc

$mc = 0

If MouseClick("right") Then 
Global $mc = $mc + 1
Endif

If $mc = 1 Then
ToolTip('Pressing Shift',0,0)
Send("{SHIFTDOWN}")
Sleep(3000)
Send("{SHIFTUP}")
ToolTip('NO Shift',0,0)
Global $mc = $mc - 2
EndIf

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;
Edited by ImNoHacker
Link to comment
Share on other sites

Global $mc

$mc = 0

If MouseDown("right") Then ;;;; <----- Mouse Down maybe?

Global $mc = $mc + 1

Endif

If $mc = 1 Then

ToolTip('Pressing Shift',0,0)

Send("{SHIFTDOWN}")

Sleep(3000)

Send("{SHIFTUP}")

ToolTip('NO Shift',0,0)

Global $mc = $mc - 2

EndIf

;;;; Body of program would go here ;;;;

While 1

Sleep(100)

WEnd

;;;;;;;;

Link to comment
Share on other sites

  • Moderators

Beta = _IsPressed()

If _IsPressed('02') Then

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

If MouseDown("right") Then ;;;; <----- Mouse Down maybe?

MouseDown would "perform a mouse down event at the current mouse position" while he

wants to trigger something when it happens. If you're using the betas check out _IsPressed.

Edit : crap

Edited by Helge
Link to comment
Share on other sites

Tried, the script still runs through straight away pushing shift down then up. I want it to push sift down then up when i click the right mousebutton but to do it alternatively

e.g.

1 right mouse click press = run shift

2nd = none

3rd = run shift etc

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