Taudy Posted June 17, 2011 Share Posted June 17, 2011 (edited) Hi, so I have a piece of code that i wrote to do an action 20 times and then do a different action and then repeat, not sure why it isn't happy to do it though the error that i get is ==> "Wend" statement with no matching "While" statement.: i have a while statement but for some reason, it isn't being related to the wend. $a = 0 While 1 $variable4 = PixelSearch(0, 0,1920, 1080,"0xEC883D") if IsArray($variable4) = True Then SoundPlay("C:\WINDOWS\media\notify.wav",1) sleep (1000) MouseMove($variable4 [0], $variable4 [1],1) MouseClick("left") $a = $a +1 if $a = 20 Then $variable2 = PixelSearch(0, 0,1920, 1080,"0x26286B") if IsArray($variable2) = True Then MouseMove($variable2 [0], $variable2 [1],1) MouseClick("left") $a = 0 EndIf sleep (25000) else sleep (10) EndIf wend previously i had my code without the extra part to do another action after 20 loops but i wanted to make it do one more thing, can anyone see what is wrong with my code? Edited June 17, 2011 by Taudy Link to comment Share on other sites More sharing options...
sleepydvdr Posted June 17, 2011 Share Posted June 17, 2011 Poker bots are against the rules http://www.autoitscript.com/forum/forum-2/announcement-13-forum-rules/ #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
Taudy Posted June 17, 2011 Author Share Posted June 17, 2011 (edited) sorry, to clarify, it isn't being used as a poker bot, it's a simple script made for a friend namd poe kerrington, the way i was taught to name programs during my SDD(software development and design) course was to include first 2 letters of first name and abbreviated last name, sorry if it has caused confusion. speaking of which, what game of poker could possibly be played with this script, if you choose not to believe me, then that is understandable, i hope someone is willing to help. Edited June 17, 2011 by Taudy Link to comment Share on other sites More sharing options...
JohnOne Posted June 17, 2011 Share Posted June 17, 2011 Chances are that its the rest of your code which is at fault. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Taudy Posted June 17, 2011 Author Share Posted June 17, 2011 Thanks for your reply john, that may be the case, but each piece of code works singularly, it's when i try to stick it all together that i get the problem. i can't get it to recognise the entire piece of code as a while loop Link to comment Share on other sites More sharing options...
JohnOne Posted June 17, 2011 Share Posted June 17, 2011 Press ctrl + t in scite to see the real problem with that piece of code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jaberwacky Posted June 17, 2011 Share Posted June 17, 2011 Well, what is it for then? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
JohnOne Posted June 17, 2011 Share Posted June 17, 2011 Am I missing something here? I dont see anything in that code to suggest its for a game. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Taudy Posted June 17, 2011 Author Share Posted June 17, 2011 the code merely automates a program that my friend coded but has a feature where a large button appears over the middle of the screen at intervals of 80 seconds and disappears after 20 seconds, unless clicked, where it vanishes instantly, the program spits out a box of a specific color at an interval of 80 seconds after 20 alerts, it brings up a different box prompting to buy. the feature was intended to be a nuisance for anyone trying to steal the program, and if they purchased it for some ridiculously cheap price, she would give them the version without the code, however it has been a couple years since she coded and doesn't have the source code any more, so i thought i would make a little program that fixed the bug, Link to comment Share on other sites More sharing options...
JohnOne Posted June 17, 2011 Share Posted June 17, 2011 Marvelous, did you see the missing EndIf? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Maffe811 Posted June 17, 2011 Share Posted June 17, 2011 (edited) I ran it and got this: (27,1) : ERROR: missing EndIf. wend ^ REF: missing EndIf. if IsArray($variable4) = True Then ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ Do you get it now ? I tried placing an EndIf, but then i got this: (9) : ==> Subscript used with non-Array variable.: MouseMove($variable4 [0], $variable4 [1],1) MouseMove($variable4 ^ ERROR You do know you get a window wich tells you the error and its also written in the console. Edited June 17, 2011 by Maffe811 [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
JohnOne Posted June 17, 2011 Share Posted June 17, 2011 (edited) ;EDIT Edited June 17, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Maffe811 Posted June 17, 2011 Share Posted June 17, 2011 okay, thats probably more right.... since i just... added a endif... in a place it seemed to fit... [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
sleepydvdr Posted June 17, 2011 Share Posted June 17, 2011 Am I missing something here?I dont see anything in that code to suggest its for a game.He modified his first post. The code clearly said poker bot. #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
JohnOne Posted June 17, 2011 Share Posted June 17, 2011 Ah, I see. Sorry. Always best to quote code like that. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Taudy Posted June 18, 2011 Author Share Posted June 18, 2011 Hi guys, thanks for your help, i added the endif, which seems to be what the actual problem was after using the syntax stepthrough and that removed the error. now i'm just need to revise the code and make sure it is actually doing what it should is there a way to quickly check it is working. i suppose i could start a at 19 and see what happens. 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