Jump to content

Recommended Posts

Posted

Guys i need help with my script , i tried to do this to when i press f1 the script press shift and click on the screen , move to another pixel and click again , with shift pressed , but when i try it the shift doesnt work. There's my code, Can someone help me with that ?

HotKeySet("{F1}", "use")
HotKeySet("+{F5}","exitt")




$sla = FALSE


While(1)
    If $sla = TRUE THEN
    Send("{SHIFTDOWN}")
    MouseClick("left",868,480)
    MouseClick("left",953,480)
    MouseClick("left",1033,480)
    MouseClick("left",868,557)
    MouseClick("left",953,557)
    MouseClick("left",1033,557)
    MouseClick("left",838,612)
    MouseClick("left",953,612)
    MouseClick("left",1033,612)
    Send("{SHIFTUP}")
    Else
        Sleep(100)
    EndIf
WEnd
Func use()
    If $sla = TRUE THEN
        $sla = FALSE
    ElseIf $sla = FALSE THEN
        $sla = TRUE
    EndIf
    EndFunc
Func exitt()
    Exit
EndFunc

 

Posted

What application are you trying to automate ?  Without knowing it, that will be very hard to understand where is the issue.  You should also consider using other tools than MouseClick as this approach is truly not the best way to automate an application.

Posted

The script seems to work for me, but as Nine said, it's difficult to know if it's doing what you want it to do without you telling us what you want it to do.

Posted

It works as in it shift-clicks, moves, shift-clicks, moves, ad nauseum. No idea what the end goal is, but seems to function as reading through the script would suggest it does. I used the term 'work' loosely, perhaps 'function' would be a better description.

  • Developers
Posted

Not trying to be a smart-ass, but I was wondering how you determined that is was actually do a shift+Click with that code?
I am not bothered about the OP's request myself as I guess this is a game related thing anyways as I can't think of any other application requiring this. ;) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)
6 hours ago, Jos said:

as I guess this is a game related thing anyways

Coordinates are consistent with strafing.

Edited by JockoDundee

Code hard, but don’t hard code...

Posted

With the script running on the desktop, all files between the given positions would highlight (Yes, I have way too many files on my desktop).

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
×
×
  • Create New...