Jump to content
LNGS

Simple script not running

Recommended Posts

LNGS

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

 

Share this post


Link to post
Share on other sites
Jos

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
LNGS
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.

Share this post


Link to post
Share on other sites
LNGS
1 minute ago, Jos said:

but you do when you run it!

Jos

I removed [ and ], still nothing is happening when I run it :/

Share this post


Link to post
Share on other sites
LNGS
2 minutes ago, Jos said:

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

"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Cecilia\Desktop\autoit.au3"  

 

Share this post


Link to post
Share on other sites
Jos

.... 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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
LNGS
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.

Share this post


Link to post
Share on other sites
Jos

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
LNGS
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

Share this post


Link to post
Share on other sites
LNGS

I get no return when I use msgbox

Share this post


Link to post
Share on other sites
LNGS

No difference :/

Edited by LNGS

Share this post


Link to post
Share on other sites
LNGS

Turns out the script works on another computer.

Trusting the app in my antivirus and even turning it off completely was not enough.

I had to uninstall my antivirus for it to work.

 

Thanks for helping out.

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

×