NehpetsDoom Posted August 10, 2009 Share Posted August 10, 2009 (edited) Ok I'm a super noob with this language and program however I got what I needed done in my script however I keep running into error after error. I'll solve one and run into another. Normally I wouldn't ask this but I got this program like 2 hours ago and have been trying to fix this for about an hour and 58 minutes. Could someone fix this for me and possibly tell me why you have to do it that way. expandcollapse popupWinActivate("The Duel") WinWaitActive("The Duel") &HotKeySet("{UP}","Butterfly Forward") &HotKeySet("{DOWN}",'Butterfly Backwards') &HotKeySet("{LEFT}","Butterfly Left") &HotKeySet("{RIGHT}","Butterfly Right") &Func Butterfly Forward() Send("{RCTRL}") Send("{UP}") Send("{UP}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true &EndFunc &Func Butterfly Left() Send("{RCTRL}") Send("{LEFT}") Send("{LEFT}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true &EndFunc &Func Butterfly Right() Send("{RCTRL}") Send("{RIGHT}") Send("{RIGHT}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true &EndFunc &Func Butterfly Backwards() Send("{RCTRL}") Send("{DOWN}") Send("{DOWN}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true &EndFunc P.S. It probably wouldn't have as many problems if I didn't mess with stuff I didn't need too. P.S.S. I want to be able to press the arrow keys to the adjacent macro and have each macro send the Right CTRL button then the corresponding key twice then left-click then pause for 0.2 seconds then send 0 on the numpad. Please strip out all useless items as it will help me learn =D Edited August 10, 2009 by NehpetsDoom Link to comment Share on other sites More sharing options...
colafrysen Posted August 11, 2009 Share Posted August 11, 2009 (edited) You don't give an description on your error. but from looking briefly at your code; doesn't the send() trigger the HotKeySet()? EDIT: And why is there &Func instead of just Func? Edited August 11, 2009 by colafrysen [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
NehpetsDoom Posted August 11, 2009 Author Share Posted August 11, 2009 (edited) You don't give an description on your error. but from looking briefly at your code; doesn't the send() trigger the HotKeySet()?EDIT: And why is there &Func instead of just Func?Like I said I'm a complete noob so IDK. And also like I said I added a lot of extra crap because I was messing with items I didn't need too; but I actually think that fixed one of my problems. Edited August 11, 2009 by NehpetsDoom Link to comment Share on other sites More sharing options...
colafrysen Posted August 11, 2009 Share Posted August 11, 2009 Ok, but does the script run at all? if not what output do you get from the SciTE console? If it runs but not as expected, whats wrong? [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
NehpetsDoom Posted August 11, 2009 Author Share Posted August 11, 2009 Ok, but does the script run at all? if not what output do you get from the SciTE console?If it runs but not as expected, whats wrong?It switches to the program (runs the first two lines) then gives me and error in line 3 with "Unable To Parse File". Link to comment Share on other sites More sharing options...
GEOSoft Posted August 11, 2009 Share Posted August 11, 2009 (edited) That code won't work with those ampersands at the beginning of the lines, get rid of them. What is the reason for using the {RCtrl}? If you just need to send CTRL + Right arrow twice then try Send("^{Right 2}") Edited August 11, 2009 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
colafrysen Posted August 11, 2009 Share Posted August 11, 2009 First, what AutoIT version are you running? I get Syntax Error at line three. (Because of the & prefixing the HotKeySet()) So is it this little & that messes it up, I would think so (If your running the exact same as you posted) Reason: It IS a syntax error, so why did you put them there from the start? The & is used when combining strings like "this is a" & " String thats " & "Combined with a Number: " & 1 & "and a variable " & $var [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
NehpetsDoom Posted August 11, 2009 Author Share Posted August 11, 2009 (edited) First, what AutoIT version are you running? I get Syntax Error at line three. (Because of the & prefixing the HotKeySet())So is it this little & that messes it up, I would think so (If your running the exact same as you posted)Reason: It IS a syntax error, so why did you put them there from the start?The & is used when combining strings like "this is a" & " String thats " & "Combined with a Number: " & 1 & "and a variable " & $varI don't remember the error but it fixed it so I left them there. And "I get Syntax Error at line three." I just said that in so many words."It switches to the program (runs the first two lines) then gives me and error in line 3 with 'Unable To Parse File'." And also like I said I downloaded it today so I assume the most current version.Oh and because I need the right CTRL button (there's usually two on regular desktop keyboards.) It's not a necessity but I didn't even get to the point of testing my macro to see if it would work. Edited August 11, 2009 by NehpetsDoom Link to comment Share on other sites More sharing options...
storme Posted August 11, 2009 Share Posted August 11, 2009 G'day NehpetsDoom Try thisexpandcollapse popupWinActivate("The Duel") WinWaitActive("The Duel") HotKeySet("{UP}","ButterflyForward") HotKeySet("{DOWN}",'ButterflyBackwards') HotKeySet("{LEFT}","ButterflyLeft") HotKeySet("{RIGHT}","ButterflyRight") Func ButterflyForward() Send("{RCTRL}") Send("{UP}") Send("{UP}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true EndFunc Func ButterflyLeft() Send("{RCTRL}") Send("{LEFT}") Send("{LEFT}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true EndFunc Func ButterflyRight() Send("{RCTRL}") Send("{RIGHT}") Send("{RIGHT}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true EndFunc Func ButterflyBackwards() Send("{RCTRL}") Send("{DOWN}") Send("{DOWN}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true EndFuncI'm not sure if it does what you want to do but it's now syntactically correct adn it runs.Don't append & on to the front of Func, EndFunc, HotKeySet or any other keyword.Function names can't contain spaces (eg ButterflyRight works Butterfly Right doesn't)Hope that gets you restarted. Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
NehpetsDoom Posted August 11, 2009 Author Share Posted August 11, 2009 G'day NehpetsDoom Try this expandcollapse popupWinActivate("The Duel") WinWaitActive("The Duel") HotKeySet("{UP}","ButterflyForward") HotKeySet("{DOWN}",'ButterflyBackwards') HotKeySet("{LEFT}","ButterflyLeft") HotKeySet("{RIGHT}","ButterflyRight") Func ButterflyForward() Send("{RCTRL}") Send("{UP}") Send("{UP}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true EndFunc Func ButterflyLeft() Send("{RCTRL}") Send("{LEFT}") Send("{LEFT}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true EndFunc Func ButterflyRight() Send("{RCTRL}") Send("{RIGHT}") Send("{RIGHT}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true EndFunc Func ButterflyBackwards() Send("{RCTRL}") Send("{DOWN}") Send("{DOWN}") MouseClick("left") Sleep(200) Send("{N 0}") $paused = true EndFunc I'm not sure if it does what you want to do but it's now syntactically correct adn it runs. Don't append & on to the front of Func, EndFunc, HotKeySet or any other keyword. Function names can't contain spaces (eg ButterflyRight works Butterfly Right doesn't) Hope that gets you restarted. Ty soo much I knew it was going to be something really stupid that I didn't think about like that. Havn't tested it but if it runs it should work. >_< Link to comment Share on other sites More sharing options...
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