Sign in to follow this  
Followers 0
BlueForce

im getting bad func but why?

7 posts in this topic

#1 ·  Posted (edited)

i have this code and it keeps giving me Bad Func format. can anyone tell me what's wrong? thanks

HotKeySet ("^!c", "Exit")

While 1 = 1
;bottom right car
 MouseMove (759, 807, 0)
 MouseClick ("left")
;bottom right guy
 MouseMove (731, 830, 0)
 MouseClick ("left")
;top
 MouseMove (535, 533, 0)
 MouseClick ("left")
;building top
 MouseMove (414, 557, 0)
 MouseClick ("left")
;pillars
 MouseMove (691, 684, 0)
 MouseClick ("left")
;left car
 MouseMove (456, 734, 0)
 MouseClick ("left")
Wend

Func Exit ()
  Exit
EndFunc
Edited by BlueForce

Share this post


Link to post
Share on other sites



well i had a nice little thing there. after i ran the program, i pressed ctrl+alt+c and it didn't stop it. so i had to manually restart my computer with the button to turn it off :\ anyways any idea's on why it's not exiting? and is there a default exit sequence for autoit that works for all programs/scripts that you make?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

for some reason i have had similar trouble with the hotkeys. keep it simple

use "{ESC}" instead of "^!c"

EDIT: also increase the sleep time, or add a message box until you know it works

or you wont be able to stop it (mouse pointer moving around too fast)

and you will have to kill the power again lol (like me more than once)

EDIT2: oh yeah, you dont HAVE any sleep time in there lol

make it sleep for about 5 seconds in between clicks, so you have time to right click the icon and select exit, or put a msgbox after the first mouseclick then while thats up, try to use the hotkey

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

hmmm.. interesting ill give that a try.

yay the escape button has worked. thanks

Edited by BlueForce

Share this post


Link to post
Share on other sites

np.

just remember before you finish writing a script that you cant close, to put safeguards in it or you will have to turn your computer off, such as message boxes, or make it sleep long enough to actually stop it via task manager or icon


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

i would like to make some improvements to my script. but im not sure how, i did look at help but i didnt really understand what it was trying to tell me.

anyways i want to make it so it only left clicks if there is white or black underneath the mouse pointer. how would i go about doing this? i know black is 0x000000 and white is 0xffffff

small part of my current code:

;bottom right car
 Sleep (30)
 MouseMove (759, 807, 0)
 MouseClick ("left")
Edited by BlueForce

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  
Followers 0