AU3Newbie Posted January 15, 2007 Posted January 15, 2007 It doesn't work,but what's wrong with my code below? Global $pos1,$pos2 HotKeySet("{F7}","one") HotKeySet("{F8}","two") HotKeySet("{F9}","exitit") Func one() $pos1 = MouseGetPos() EndFunc Func two() $pos2 = MouseGetPos() while 1 MouseClick("left",$pos1[0],$pos1[1]) Sleep(200) MouseClick("left",$pos2[0],$pos2[1]) sleep(200) WEnd EndFunc Func exitit() Exit EndFunc
BrettF Posted January 15, 2007 Posted January 15, 2007 Can i ask what your' trying to achive in the end??? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
BrettF Posted January 15, 2007 Posted January 15, 2007 Global $pos1,$pos2 HotKeySet("{F7}","one") HotKeySet("{F8}","two") HotKeySet("{F9}","exitit") While 1 Sleep (100) WEnd Func one() $pos1 = MouseGetPos() EndFunc Func two() $pos2 = MouseGetPos() while 1 MouseClick("left",$pos1[0],$pos1[1]) Sleep(200) MouseClick("left",$pos2[0],$pos2[1]) sleep(200) WEnd EndFunc Func exitit() Exit EndFunc For it to work you needed to of have the While.... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
xcal Posted January 15, 2007 Posted January 15, 2007 Not sure if it matters for what you're doing, but when you use two() you're stuck inside the loop in that function. How To Ask Questions The Smart Way
BALA Posted January 15, 2007 Posted January 15, 2007 (edited) Not sure if it matters for what you're doing, but when you use two() you're stuck inside the loop in that function.Actually no, that's what the F9 key is for.(This script sorta reminds me of my unfinished BA-AUTO program) Edited January 15, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
jvanegmond Posted January 15, 2007 Posted January 15, 2007 It immediately exits, as you give it no commands to perform a.k.a. "There is no while loop" Global $pos1, $pos2 HotKeySet("{F7}", "one") HotKeySet("{F8}", "two") HotKeySet("{F9}", "exitit") While 1 Sleep(1000) Wend Func one() $pos1 = MouseGetPos() EndFunc ;==>one Func two() $pos2 = MouseGetPos() While 1 MouseClick("left", $pos1[0], $pos1[1]) Sleep(200) MouseClick("left", $pos2[0], $pos2[1]) Sleep(200) WEnd EndFunc ;==>two Func exitit() ExitEndFunc ;==>exitit github.com/jvanegmond
BALA Posted January 15, 2007 Posted January 15, 2007 (edited) It immediately exits, as you give it no commands to perform a.k.a. "There is no while loop" Global $pos1, $pos2 HotKeySet("{F7}", "one") HotKeySet("{F8}", "two") HotKeySet("{F9}", "exitit") While 1 Sleep(1000) Wend Func one() $pos1 = MouseGetPos() EndFunc ;==>one Func two() $pos2 = MouseGetPos() While 1 MouseClick("left", $pos1[0], $pos1[1]) Sleep(200) MouseClick("left", $pos2[0], $pos2[1]) Sleep(200) WEnd EndFunc ;==>two Func exitit() ExitEndFunc ;==>exitit Isn't that sorta what bert already said... For it to work you needed to of have the While.... Edited January 15, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
jvanegmond Posted January 15, 2007 Posted January 15, 2007 lol, I totally missed Bert's post. github.com/jvanegmond
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now