Jump to content

Help with coding (im a new guy on it)


 Share

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Developers
20 minutes ago, Sidley said:

The script seems to work for me,

Wondering how you established that unless the automate the same "application"?

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Developers

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

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