akke92 Posted October 18, 2014 Share Posted October 18, 2014 Hello everyone! So im really new to this whole Autoit thing and i just started to learn it! I have this unanswered question that i would like to see if anyone here could answer? Im not 100% sure how to use the loop function "While" as the last time i tried it, it didn't work out very well! So if anyone has the time to explain how to use it correctly then i would really appreciate that! Thank you guys! Cheers. Link to comment Share on other sites More sharing options...
Paulie Posted October 18, 2014 Share Posted October 18, 2014 Why not post what you've tried? It's a lot easier to explain when we can see what you're shooting for. Link to comment Share on other sites More sharing options...
akke92 Posted October 18, 2014 Author Share Posted October 18, 2014 Why not post what you've tried? It's a lot easier to explain when we can see what you're shooting for. Last time i did the owner removed the thread and told me to read rules.. Should i try again? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 18, 2014 Moderators Share Posted October 18, 2014 akke92, Should i try again?Given what happened last time, I would strongly suggest not. And if you read the rules to which I linked you then know why. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
akke92 Posted October 18, 2014 Author Share Posted October 18, 2014 (edited) akke92, Given what happened last time, I would strongly suggest not. And if you read the rules to which I linked you then know why. M23 Hehe, thats what i thought! i've read the rules but im unclear on which point you mean i do wrong, it could be that "i ask for help with a autoit script" but i've seen others done that alot on this forum! or it could be "Running or injecting any code (in any form) intended to alter the original functionality of another process" but im not sure, do you think i could post the code again if i remove the top part and just send the code starting from the "While 1" appeared in the code? Edited October 18, 2014 by akke92 Link to comment Share on other sites More sharing options...
Paulie Posted October 18, 2014 Share Posted October 18, 2014 It seems you were trying to automate a game. You definitely should not post about it again. As it says in the Forum Rules, you're not supposed to ask about that here for many reasons, among them being that it is often a violation of the Terms of Service of many applications, and also because encouraging it generally attracts unsavory clientele to the forum. It's a shame you didn't read the rule before posting. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 18, 2014 Moderators Share Posted October 18, 2014 akke92,Your earlier thread was locked, as I explained when I did so, because it involved automating a game server - as that is pops up when I Google "Extalia". Limiting your question to understanding While loops I am just about prepared to accept - but not if you make it too obviously linked. M23 232showtime 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
akke92 Posted October 18, 2014 Author Share Posted October 18, 2014 Yep, that was really immature of me. What If i remove everything that leads to automation of the game? Would you mind helping me then? please! Link to comment Share on other sites More sharing options...
Paulie Posted October 18, 2014 Share Posted October 18, 2014 (edited) Well here's a While Loops crash course: ;While Loop Structure While {Expression} ;. ; Do actions ;. WEnd While loops are used to repeat a block of code several times based on a expression. Expression are conditions that evaluate to Boolean values (True/False) As long as the condition at the top of the loop evaluates to True, everything inside it (between it and the WEnd keyword) will be continuously executed. Hope that helps You can read more about it Here at the Autoit Helpfile! Edited October 18, 2014 by Paulie Link to comment Share on other sites More sharing options...
akke92 Posted October 18, 2014 Author Share Posted October 18, 2014 (edited) Well here's a While Loops crash course: ;While Loop Structure While {Condition} ;. ; Do actions ;. WEnd While loops are used to repeat a block of code several times based on a condition. Conditions are expressions that evaluate to Boolean values (True/False) As long as the condition at the top of the loop evaluates to True, everything inside it (between it and the WEnd keyword) will be continuously executed. Hope that helps It doesn't really help me... As i've tried following code already and it only loops maximum two times it really seems not to be working? maybe it's a bug or something with the current AutoIT version i have on my computer? but im supposed to have the latest? if i understand what you said you mean that it should be like i wrote right? but it doesn't work?... or have i made it wrong? while 1 Send("{HOME}") Sleep(52000) WEnd Edited October 18, 2014 by akke92 Link to comment Share on other sites More sharing options...
Paulie Posted October 18, 2014 Share Posted October 18, 2014 It doesn't really help me... As i've tried following code already and it only loops maximum two times it really seems not to be working? maybe it's a bug or something with the current AutoIT version i have on my computer? but im supposed to have the latest? if i understand what you said you mean that it should be like i wrote right? but it doesn't work?... or have i made it wrong? while 1 Send("{HOME}") Sleep(52000) WEnd Well you do have it set to wait for 52 seconds in between each keypress... perhaps you aren't waiting long enough? Link to comment Share on other sites More sharing options...
akke92 Posted October 18, 2014 Author Share Posted October 18, 2014 Well you do have it set to wait for 52 seconds in between each keypress... perhaps you aren't waiting long enough? Thats not it, im waiting long enough! I've tried waiting 3 minutes but it just stops there? Is it maybe a to long delay/sleep? Maybe it's having a hard time counting that much? i have a other script, which looks like this that works just fine? on that one, im using while 1=1 though but i've tried that on the other script aswell and that didn't fix it? while 1 = 1 Send("{LEFT down}") Sleep(5000) Send("{LEFT up}") Send("{RIGHT down}") Sleep(6000) Send("{RIGHT up}") Send("{LEFT down}") Sleep(4710) Send("{LEFT up}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Sleep(1000) Wend Link to comment Share on other sites More sharing options...
232showtime Posted October 19, 2014 Share Posted October 19, 2014 Yep, that was really immature of me. What If i remove everything that leads to automation of the game? Would you mind helping me then? please! I think no one will help you, it too obvious... :whisper: ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
akke92 Posted October 19, 2014 Author Share Posted October 19, 2014 I think no one will help you, it too obvious... :whisper: Yep i guess you're right.... Link to comment Share on other sites More sharing options...
Zedna Posted October 19, 2014 Share Posted October 19, 2014 (edited) while 1 Send("{HOME}") Sleep(52000) WEnd Try this to see that loop is working finewhile 1 Consolewrite("{HOME}" & @CRLF) Sleep(1000) WEnd Edited October 19, 2014 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
JohnOne Posted October 19, 2014 Share Posted October 19, 2014 Works perfectly fine for me. The below demonstrates it. ShellExecute("http://www.autoitscript.com/forum/topic/165081-loops/") While 1 Sleep(2000) MouseWheel("down", 10) Sleep(2000) Send("{HOME}") WEnd Probably the game blocking it, and that's what you won't get help with. 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...
akke92 Posted October 19, 2014 Author Share Posted October 19, 2014 Works perfectly fine for me. The below demonstrates it. ShellExecute("http://www.autoitscript.com/forum/topic/165081-loops/") While 1 Sleep(2000) MouseWheel("down", 10) Sleep(2000) Send("{HOME}") WEnd Probably the game blocking it, and that's what you won't get help with. Yep, i think you're right! probably the game that blocks it, and thats why i wont ask for anymore help! But thanks to everyone who tried to help me! Cheers. 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