dannymcf2 Posted May 15, 2015 Posted May 15, 2015 (edited) Hey!Im just going to say that im new to autoit and this is my first successful script ! anyway i have a little problem that does notmake sense at all to me.... Maybe you can help me out? Anyone please?? What i have the SCRIPT do is this : The script finds a text box (on the screen) then it clicks the text box, then it sends "guess what...."but after it has sent "guess what...." FOR SOME REASON IT SCROLLS DOWN THEN ENDS THE SCRIPT WITH AN ERROR.... (see below for error...)"C:\Users\yolo\Desktop\bot\best.au3" (47) : ==> Illegal text at the end of statement (one statement per line).: mousewheel("down"), 3) mousewheel("down")^ ERRORHERE IS MY SCRIPT BELOW... That im having problems with.func ns3() $pixel = PixelSearch(416, 295, 882, 315, 0x707070) if IsArray($pixel) = true then MouseClick("left", $pixel[0], $pixel[1]) tn() EndIf EndFunc func tn() send ("guess{SPACE}what.....") sleep ($interval) sleep ($interval) findcombox() EndFuncSo what happens is it searches for the text box, then if it's true then mouse click then Func tn() runs Then func tn sends "guess what...."then sleepsTHEN IS SCROLLS DOWN AND AN ERROR COMES UP?!!?!?!? what the heck ?!oh BTW i have a few "Scroll func's" (See Below)Func scroll() mousewheel("down", 2) EndFunc func scroll3t() mousewheel("down"), 3) EndFunc func scrollup() mousewheel("up"), 20) EndFuncscroll () - scrolls twice downscroll3t() - scrolls 3 timesscrollup() - YOU GUESSED IT! scrolls up SO?! What the heck is happening?! im so confused why it's scrolling down twice for no reason.... it's not like i have the scroll() in the tn() ?? Edited May 15, 2015 by dannymcf2 232showtime 1
Danp2 Posted May 15, 2015 Posted May 15, 2015 You have too many closing parentheses in some of your lines of code. Latest Webdriver UDF Release Webdriver Wiki FAQs
SadBunny Posted May 15, 2015 Posted May 15, 2015 (edited) True. Every opening parenthesis should have exactly one closing parenthesis. Change mousewheel("down"), 3) to mousewheel("down", 3) and you should be fine..Also, next time you open a topic, please choose a more descriptive title. The forum is called "General Help and Support", meaning that virtually all posts on this forum are posts where someone needs some help with a script Try to hint at the sort of problem you are experiencing, and it will be more likely to get a good answer quickly./edit: lastly, as a final tip: don't write "THEN IS SCROLLS DOWN AND AN ERROR COMES UP?!!?!?!?", but rather "Then it scrolls down and an error comes up." ALLCAPS is considered yelling and generally frowned upon by people who try to communicate in a grown-up manner, and as such is better avoided in general. It is unnecessarily irritating. Edited May 15, 2015 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you.
dannymcf2 Posted May 15, 2015 Author Posted May 15, 2015 Okay thanks a lot guys, I'll try harder next time, thanks again.When I'm home I'll change it.i spent 2 hours writing my script so it's just I made a mistake right ? Like in places of my script I forgot to Endif haha and end Funcs. i want to thank autoit for creating this great program! I freakin love it
Danp2 Posted May 15, 2015 Posted May 15, 2015 Func scroll() mousewheel("down", 2) EndFunc func scroll3t() mousewheel("down"), 3) EndFunc func scrollup() mousewheel("up"), 20) EndFuncThese could be written as a single function with default parameters for direction and count. Latest Webdriver UDF Release Webdriver Wiki FAQs
dannymcf2 Posted May 15, 2015 Author Posted May 15, 2015 (edited) Guys, is there a way to show a debug in the console or something like that? Ni need to know what my script is doing . Edited May 15, 2015 by dannymcf2
dannymcf2 Posted May 15, 2015 Author Posted May 15, 2015 Hey danp2,ive split these Funcs up because...in some Funcs I need mouse to scroll up twice and sometimes them to scroll 3 times or more and so on, so I decided to make multiple Funcs because I simply don't know what else i should do.also I made a little script where it scans small areas of the screen for a colour, and if it finds it, its continues to the next Func and if it doesn't find the colour it searches for another part of the screen area and...... Its keeps doing that until it finds something I thought of the idea when was at work and as soon as I got home I worked on it for like 2 hours and it actually worked! I think I should reward my self
Danp2 Posted May 15, 2015 Posted May 15, 2015 For debugging, check out the ConsoleWrite command in the help file.in some Funcs I need mouse to scroll up twice and sometimes them to scroll 3 times or more and so on, so I decided to make multiple Funcs because I simply don't know what else i should do.Again, this could all be handled with a single function. Perhaps like this:Func Scroll($direction = 'down', $count = 1)Then your code would use the values of $direction and $count to control the action to be performed. Here are some examples of calling this function:scroll() ; uses the defaults of down and 1 scroll('up') ; overrides the direction scroll('up', 12) ; overrides both default values Latest Webdriver UDF Release Webdriver Wiki FAQs
Zedna Posted May 15, 2015 Posted May 15, 2015 "C:\Users\yolo\Desktop\bot\best.au3"Don't forget to read forum rules because all game related posts are forbidden here.https://www.autoitscript.com/forum/topic/169097-forum-rules/ Resources UDF ResourcesEx UDF AutoIt Forum Search
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