ViciousXUSMC Posted March 20, 2015 Share Posted March 20, 2015 I just finally figured out how to do an easy thing, put AdlibRegister in my script as a timeout incase something fails.. I also tested today using a full screen splashtext to hide automation work being done by a script, and that worked well. Now I am trying to sort of tie the two together just for fun. My goal is to have splashtext update on a regular interval so you can read it and be entertained while a script runs in the background. This way the text flows on a regular pace rather than being randomly inserted into the script. I have it working... but I know there must be a smarter way than this, I feel like this is more code than should be needed and am looking for alternative ways to set this up with easy code. AdlibRegister("UpdateText", 4000) SplashTextOn("mytext", "Text1") $Roll = 1 Func UpdateText() Switch $Roll Case 1 ControlSetText("mytext", "", "Static1", "Text2") $Roll += 1 Case 2 ControlSetText("mytext", "", "Static1", "Text3") $Roll += 1 Case 3 ControlSetText("mytext", "", "Static1", "Text4") $Roll += 1 Case 4 ControlSetText("mytext", "", "Static1", "Text5") $Roll += 1 Case 5 ControlSetText("mytext", "", "Static1", "Text6") $Roll += 1 EndSwitch EndFunc Sleep(30000) If there is not much a better way I do not mind this, it works. I just would want to also have an Exit at some point for a time out value. Can you run more than one function with AdlibRegister at the same time? If not I guess I would need to add a time based timerinit() exit or something to the existing function. Regards, Link to comment Share on other sites More sharing options...
JohnOne Posted March 20, 2015 Share Posted March 20, 2015 (edited) AdlibRegister("UpdateText", 1000) SplashTextOn("mytext", "Text1") Func UpdateText() Local Static $Roll = 2 ControlSetText("mytext", "", "Static1", "Text" & $Roll) $Roll += 1 EndFunc ;==>UpdateText Sleep(10000) Edited March 20, 2015 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...
ViciousXUSMC Posted March 23, 2015 Author Share Posted March 23, 2015 Thanks JohnOne but the real code will use random/various messages (think nerdy funny stuff) I just used text1, text2 to show that there is a change in text as a placeholder in the script. Link to comment Share on other sites More sharing options...
Solution JohnOne Posted March 23, 2015 Solution Share Posted March 23, 2015 (edited) AdlibRegister("UpdateText", 1000) SplashTextOn("mytext", "Hilarious things") Func UpdateText() Local Static $aRoll[4] = ["Scrotum", _ "Funny bone", _ "Fanny Cradock", _ "Anal sphincter"] ControlSetText("mytext", "", "Static1", $aRoll[Random(0, 3, 1)]) EndFunc ;==>UpdateText Sleep(10000) Edited March 23, 2015 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...
ViciousXUSMC Posted March 23, 2015 Author Share Posted March 23, 2015 (edited) Thats a interesting take, random pull from an array. That works as a solution and I can learn from it. Edited March 23, 2015 by ViciousXUSMC Link to comment Share on other sites More sharing options...
JohnOne Posted March 23, 2015 Share Posted March 23, 2015 Ace. 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...
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