Administrators Jon Posted January 14, 2004 Administrators Posted January 14, 2004 Could someone code me up a test script so when I mess around with the internals of AutoIt I can be reasonably sure that I've not broken anything.I was thinking of a script to work out some numbers or something so that when it finishes it compares the result with what it _should_ have calculated - if the two are different then a bug has been introduced. So it must:- Use lots of variables in both the Global and Local scope- Use complicated expressions- Use all sorts of loops and nested loops- Use lots of function calls, with and without ByRefs- Use a little recursion to be sure that it is workingI want it to be pretty silent too, with the only outputs being stuff like:"Complex functions - passed""Expressions - passed""Complex loops - passed"Testing each built in function in detail is not required, if a single built in function works then they should all work, it's more the user functions, expressions, loops I'm concerned with.Seperate scripts to test each area would be fine too.(I know JP has some non-regression code but this is a little different, I don't actually _have_ any complicated AutoIt scripts as I've been too busy writing the thing!) Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
Lemures Posted January 14, 2004 Posted January 14, 2004 lol.. omg.. ok, i seriously just thought this: "i could probably do the loop thing, but im just too lazy... i wonder if i could make a script to do it for me".... lol....
jpm Posted January 14, 2004 Posted January 14, 2004 Jon,Just some precision before I try to fulfill your request.- Use lots of variables in both the Global and Local scope lots means testing perf or just the complexity of global/local/func- Use complicated expressionsusing operator as ^*/+-() and the function as ROUND not math functions return- Use all sorts of loops and nested loopswith function call embedded or not?- Use lots of function calls, with and without ByRefsOK- Use a little recursion to be sure that it is workinghow many level?
Administrators Jon Posted January 14, 2004 Author Administrators Posted January 14, 2004 Lots meaning complexity And just a few levels of recursion. Everything else you said sounds fine. Thanks, JP. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
Lemures Posted January 14, 2004 Posted January 14, 2004 expandcollapse popup;------------------------------------ $loops = 3;3 seems good, takes like 20 seconds for me with $trays set to 5 $trays = 5;shows you whats going on, but slows it down a bit the higher you go, cant go higher than the amount in $var $trayson = 0;if anything but 1, it wont put in the traytip $loopies = 6;how many loops to do $loops = InputBox("Loops", "How many times should each For loops loop?", $loops) if @error=1 Then Exit $trays = InputBox("Trays", "How many loops should show up in TrayTip?", $trays) if @error=1 Then Exit $loopies = InputBox("Total For Loops", "How many For loops do you want? Max is 26.", $loopies) if @error=1 Then Exit if $loopies>26 Then Exit $answer = MsgBox(4,"Trays","Do you want the TrayTip to be on? It slows it down, but atleast you know whats going on.") if @error=1 Then Exit if $answer=6 Then $trayson=1 $var = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z" $var = StringTrimRight($var,(26-$loopies)*2) $var = StringSplit($var,",") if $var[0]<$trays Then MsgBox(0,"Fool","You are trying to show more in the traytip than you actually have.. exiting..") Exit EndIf Run("Notepad") WinWaitActive("Untitled") AutoItSetOption("SendKeyDelay",0) Send("ProgressOn(+'Looping+',+'Looping...+',+'+',0,@DesktopHeight-200){enter}") Send("$loops = " & $loops & "{enter}") Send("$process=0{enter}") Send("For $MainLoop=0 to $loops{enter}") For $i=1 to $var[0] Send("For $" & $var[$i] & "=0 to $loops{enter}") For $t=1 to $i Send("{tab}") Next Next Send(";weee{enter}") if $trayson=1 Then For $t=1 to $var[0] Send("{tab}") Next Send("TrayTip(+'Loop+',$MainLoop & +' +' & " ) For $i=1 to $trays Send("$" & $var[$i] & " & +', +' & ") Next Send("{backspace 10},1){enter}") EndIf For $i=($var[0]-1) to 0 Step -1 For $t=1 to $i Send("{tab}") Next Send("Next{enter}") Next Send("$process=(100/$loops){+}$process{enter}ProgressSet($process)") Send("{enter}Next{enter}") Send("MsgBox(0,+'Finished+',+'Looping is complete.+')") send("^s") Sleep(200) Send("TestLoops.au3") ;------------------------------------ i um... have no life?
jpm Posted January 14, 2004 Posted January 14, 2004 Lots meaning complexity And just a few levels of recursion. Everything else you said sounds fine.Thanks, JP.The process is startedYou will be proud of your student ...I could reach grade 3
Lemures Posted January 14, 2004 Posted January 14, 2004 just edit mine to write the code for you, lol... somebody needs to use my code =P
Manus-Magnus Posted January 16, 2004 Posted January 16, 2004 hello, since 2 month: i have a game bot beta version released in 3 days with 4000 lines script and a 3000 lines ascii database oriented at my job, they have deep loops (up to 15 in certain cases, calling subs with others loops...not "while 1" loops... Every days yet i update immediately to next version, not problems yet...except a special crash causing memory exception but i dont remember what caused it, it was a syntax error, not a core error. If you have D2 lod game at home i think you will have a nice "complex" testing in 3 minutes. :iamstupid: Anyway, that was more a tx you for your core than an help but... http://www.premiumwanadoo.com/manus-magnus/
Administrators Jon Posted January 19, 2004 Author Administrators Posted January 19, 2004 i um... have no life?That script was fun. Thanks. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
Lemures Posted January 20, 2004 Posted January 20, 2004 haha... i have no life, and way to much free time... if you ever need a script that makes another script again, lemme know =P
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