Jump to content
Sign in to follow this  
ImNoHacker

If statement help

Recommended Posts

ImNoHacker

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

Share this post


Link to post
Share on other sites
FifteenFifty

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

;;;;;;;;

Share this post


Link to post
Share on other sites
SmOke_N

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.

Share this post


Link to post
Share on other sites
Helge

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

Share this post


Link to post
Share on other sites
ImNoHacker

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

Share this post


Link to post
Share on other sites
SmOke_N

Edit : crap

:whistle:

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.

Share this post


Link to post
Share on other sites
FifteenFifty

sry, im new :whistle:

Share this post


Link to post
Share on other sites
ImNoHacker

Thanks alot Helge i've made a version that works tahts along teh same lines :whistle:

Edited by ImNoHacker

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  

×