Jump to content

Simple script not running


LNGS
 Share

Recommended Posts

I'm doing something wrong here..

#include <Misc.au3>
#include <AutoItConstants.au3>

HotKeySet("F5", "StartStop")
HotKeySet("F7", "TWIN")
HotKeySet("F8", "CTWIN")

While 1
Sleep(100)
WEnd

Func StartStop()
   MouseClick ( "left" [, 937, 700 [, clicks = 1 [, speed = 10]]] )
EndFunc

Func TWIN()
   MouseClick ( "right" [, 265, 128 [, clicks = 1 [, speed = 10]]] )
   Sleep (500)
   MouseClick ( "left" [, 324, 144 [, clicks = 1 [, speed = 10]]] )
EndFunc

#include <Misc.au3>
#include <AutoItConstants.au3>

HotKeySet("F5", "StartStop")
HotKeySet("F7", "TWIN")
HotKeySet("F8", "CTWIN")

While 1
Sleep(100)
WEnd

Func StartStop()
   MouseClick ( "left" [, 937, 700 [, clicks = 1 [, speed = 10]]] )
EndFunc

Func TWIN()
   MouseClick ( "right" [, 265, 128 [, clicks = 1 [, speed = 10]]] )
   Sleep (500)
   MouseClick ( "left" [, 324, 144 [, clicks = 1 [, speed = 10]]] )
EndFunc


Func CTWIN()
   MouseClick ( "right" [, 265, 168 [, clicks = 1 [, speed = 10]]] )
   Sleep (500)
   MouseClick ( "left" [, 318, 181 [, clicks = 1 [, speed = 10]]] )
EndFunc

 

Link to comment
Share on other sites

  • Developers

You get syntax errors ..... right?

Get rid of all [ and ] as they represent an optional parameter in the help file but should not be there as the examples show.

Jos

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

3 minutes ago, Jos said:

You get syntax errors ..... right?

Get rid of all [ and ] as they represent an optional parameter in the help file but should not be there as the examples show.

Jos

I get no syntax errors when I build.

I will try that tho.

Link to comment
Share on other sites

  • Developers
Just now, LNGS said:

I get no syntax errors when I build.

but you do when you run it!

Jos

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

  • Developers

Open it in SciTE and press F5 (run) ....  what happens?

Edited by Jos

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

  • Developers

.... yes ...and?   (As long as it doesn't terminate only this line is shown).
What do you expect to happen .... and when?

 

By the way: Did you also remove the "clicks=" and "speed="?

Edited by Jos

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

2 minutes ago, Jos said:

.... yes ...and?   (As long as it doesn't terminate only this line is shown.
What do you expect to happen .... and when?

 

By the way: Did you also remove the "clicks=" and "speed="?

I removed clicks and speed.

 

When I press F5 I want the mouse to click on a button.

Same with the other functions, but nothing is happening when I press the hotkeys I set for my functions.

Link to comment
Share on other sites

  • Developers

What is the answer to?:

4 minutes ago, Jos said:

What do you expect to happen .... and when?

also: Simply add a MSGBOX() in the func's you activate with F5/F7/F8 so you can ensure yourself they are fired.

Which application are you trying to click or are you still messing with that game and expecting it to work?

Jos

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

5 minutes ago, Jos said:

What is the answer to?:

also: Simply add a MSGBOX() in the func's you activate with F5/F7/F8 so you can ensure yourself they are fired.

Which application are you trying to click or are you still messing with that game and expecting it to work?

Jos

Streamlabs, their macro options are not working properly so I have to make a bot that clicks all the gui buttons instead.

I did answer that, but I can do it again. 

 

I expect my script to click a button when i press f5, f7, f8.

Edited by LNGS
Link to comment
Share on other sites

  • Developers

Try:

HotKeySet("{F5}", "StartStop")
HotKeySet("{F7}", "TWIN")
HotKeySet("{F8}", "CTWIN")

Jos

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