
Celeri
Active Members-
Posts
146 -
Joined
-
Last visited
Everything posted by Celeri
-
Google File Finder (UPDATED for AutoIt 3.2.10)
Celeri replied to orange's topic in AutoIt Example Scripts
Wow ... amazing! It's missing a "clear" button however. If you do 2 consecutive searches, both results are merged. Which might be wanted sometimes, but not all the time. I'm presently checking if there's anything at any place that can be streamlined to go faster. I'll keep you guys posted (and so far nothing ) -
Tested and so far it's true - 3.2.6.0 is very much FASTER. I suggest you upgrade and test again P.S.: Thanks for the encouragement Sandman Where do I apply for the toaster?
-
Ok so it looks I'm going to have to reply to myself to get any input here So anyways, just discovered 3.2.6.0 is out and it boasts a 30%-40% speed increase ... we'll be the judge of that Download the new version here: http://www.autoitscript.com/forum/index.php?showtopic=51967 I'll keep you posted with some observations in the following days. See ya!
-
Not possible to pass var to function using HotKeySet?
Celeri replied to coasty's topic in AutoIt General Help and Support
Nope. But it all depends what you want to do. In my case, I use hotkeys to set a variable named $Hotkey and $Hotkey is evaluated at different points parts in the program like so: If $Hotkey Then ConsoleWrite("Number "&$Hotkey&" is the winner!") And here's some typical code to setup the hotkeys ... read the comments! Func Set_HOTKEY() For $i = 1 to 8; Keys 1 to 8 on the keyboard HotKeySet($i,"Def_HOTKEY"); Notice all point to the same function - There's a trick! Next EndFunc Func Def_HOTKEY() If @HotKeyPressed > 0 And @HotKeyPressed < 9 Then; @HotKeyPressed can be used to set a variable $Hotkey = @HotKeyPressed; In this case the variable is the hotkey pressed. You could use switch Else; and set up different variables/functions depending on what you want to do and what key is $Hotkey = 0; pressed ... EndIf; The check on the first line is superfluous but you never know;) EndFunc Don't forget to set Global $Hotkey at the top of your program! -
As far as reducing pictures go (if that's your bag), you can use Photoshop, load your photo --> Mode --> Indexed Color --> Palette = Local (selective) --> Forced (none) --> NO transparency --> Dither (none) --> and then reduce the colors from 255 to 0 until it hurts Photofilter (which is free) also does something similar although with less finesse. http://photofiltre.free.fr/ After that you can save a gif and use a program like "gifopt1.0" to remove all useless headers. Or the online version (one of them!) http://tools.dynamicdrive.com/imageoptimizer/ If you use GUICtrlCreateGraphic you'll see it accepts Gifs and Png (I suspect this is related to Internet Explorer). In your case BTW, I would also try JPG, and then strip all the headers with a program called stripper (in google type "stripper jpg" without the quotes)
-
That much is clear However my mom can program AutoIT3, but I doubt she'd get along with C++ or C# ahahahah
-
Mind you, it depends. If you're working with files and file transfers in AutoIT3, the difference in speed with C# or C++ will be minimal since the program will be dependent upon Harddrive latency. I once made a cleaning program in AutoIT3 and it was up there with CCleaner in terms of speed
-
I wonder ... I never tried it but do you think copying files to a burner on XP/Vista will automagically have windows prompt the user to burn the files? I'm saying this because I already tackled the CD/DVD burning question a while ago and honestly, there was little solutions at that time. If that doesn't work, there's IMGBurn which has an interesting command line, CDIMAGE which is freeware and a few others that I can't remember for the moment. In any case It's a pretty big project and last time I tried I litteraly broke my neck Thanks and keep up the good work!!!
-
Since AutoIt is an interpreted language (as compared to a compiled language) the difference will probably pretty big (not in favor of AutoIT3). Hey anyone here can prove me wrong?
-
Ok, I don't want to pick a fight (ahahahah) Anyways we almost agree So here's my take on this. Take a smal program that checks a filename (hey I'm working on that!) Here's what can go wrong: 1. Does it contain illegal characters? 2. Is it null ""? 3. Is it too long? 4. Does it contain too many wildcards? ("*" and "?") So in fact there are at least 4 different types of error here. There is only one instance where there is no error and that's when all the four previous checks are ok. So it makes more sense if the returned values are: 0. No problemo 1. Invalid characters 2. Null string 3. String too long 4. Too many wildcards. In any case we usually check to see if there is an error rather than the reverse. So ... If _CheckMyFilename("Celeri_?????_with_his_RunDLL_Calls.bak") Then ConsoleWrite("I made a boo-boo")makes perfect sense. However If _CheckMyFilename("Celeri_?????_with_his_RunDLL_Calls.bak") Then ConsoleWrite("Wow you made it!")is not quite as practical. Oh well, to each is own I guess
-
Not sure. Let me quote the help file for Set Error: SO unless I read wrong, no error, no returned value. If error, than a value that correspond to a specific error. Per example, error 1 would be "One of the windows does not exist". Error 2 could be error returned by RunDll, the extended code could be that error #. BTW I'm a complete dork with DllCalls so you got me there
-
I'd also combine both verifications: If WinExists($TitleP) And WinExists($TitleC) Then And add Opt("WinTitleMatchMode", 2) into the function Now it's looking good too
-
Allright just a fast reply ... since I read the code (didn't run it yet). You should declare all variables Local Local $HwndP, $HwndC, $user32 For quickness and standardisation, on error you should return 1, on no error you should return 0 Why? If _SetParent("- SciTE", "Mozilla Firefox") Then MsgBox(0,,"","Big ERROR") You save a few lines of code also. If NOT _SetParent(... will do something if there is no error BTW.
-
Good timing! I was looking for something like this! I'll test it this week and come back to you. P.S.: A lot of people here just download and go, they don't bother to comment. Don't despair there's still a few good guys (and gals) around to help you out and comment.
-
Thanks! I started learning C++ but I'm lazy and I have a limited amount of time. AutoIt's learning curve is really, really low Although there's a few quirks here and there but you get used to it. I'll keep on comparing - if any of you has anything interesting, post it and I'll add it to the first post
-
I'll see what I can do However this might require a thinking cap! --> it implies a self-modifying code. But I'm all for it if it is possible. One way this could be done is by #including a file which contains bunch of UDFs to be speedtested. The user would then have to specify which UDF to speed test. (i.e.: _speedtest1() ) EDIT: In retrospect, it can be done with Execute() but since you're going to have to code it anyways, an input box or an input file is in my opinion not the best way to go. Don't forget this program tests code snippets that sometimes requires preset variables and/or calling parameters, which is way beyond Execute() (I was lead to believe it is used to return the result of a simple expression like 1 + $B [the function returns the equal part of the formula and $B in this case must be previously declared]). In any case if it's what you want it's easy to add two lines to the code: Put this at the start: $Input_CODE = InputBox("AutoIT Speed Test","Enter command to test it's speed"&@CR&"(One line only!)") Put this line at line after the "For $j = 1 To 9999" and the comments that follow $Result = Execute($Input_CODE) You can ConsoleWrite the variable $Result after the loops if you want to see what happened. There are also issues with syntax checking but if it's used by someone who knows his stuff than I guess it's OK. In any case I commented every line so that unexperimented users can take a peek and understand how this works. If any of you modifies the code (make it faster?) than I'd really appreciate seeing what you did
-
I've done a backup program before It's a nice project but it can get monstruous if you put a lot of whizzes and bells! What would be nice is a way for a user to easily add really common stuff: Outlook Express folder : @UserProfileDir&"\Local Settings\Application Data\Identities\*.*" Outlook Express adress book : @AppDataDir&"\Microsoft\Address Book\*.*" Outlook folder : @UserProfileDir&"\Local Settings\Application Data\Microsoft\Outlook\*.*" Desktop : @DesktopDir&"\*.*" Favorites: @FavoritesDir&"\*.*" There are more places but those five usually stump 90% of all users searching for their stuff. On top of all that "\Local Settings" is a hidden folder. Geeez. Microsoft really doesn't like it's users.
-
SetError($ErrNum)<BR>Return Or Return SetError($ErrNum) On my computer Return SetError($ErrNum) is marginally slower than SetError($ErrNum) Return But by so little that there's nothing to write home about
-
Wow, I've never used GetTickCount() I'll add a line to the first post just in case BTW there are other functions that can't really be tested by my program. There's "Exit" (duh!) and "Return". I guess you could call a function and return but you can never test "Return" all alone. Which makes me think ... Hmmm what's fastest? SetError($ErrNum) Return Or Return SetError($ErrNum)
-
Well maybe it's me (it surely is) but I like my AutoIT code when it's FAST. So here's a little program I whipped up in about an hour. AutoIT_Speed.au3 Updated 19Aug2007 with more comments and more test results It will execute commands of your choice through two loops, 20 packs of 9999 iterations to be precise. Making two loops increased the reliability of the reading (since it seems the first iteration is really slow because of cache issues and what not). For example, you could compare $Val = $Val +1to ... $Val += 1(in this case, the obvious winner is $Val += 1 but it isn't always so evident) The code is as simple as can be, I guess if you don't get it than it's not for you In any case, the results you get might make you change your programming habits! If you do a lot of looping then I suggest you try out the commands in those loops and see what's better. Good luck! EDIT: It's been brought to my attention by chris95219 that GetTickCount() cannot be properly timed. Also if you use the $i and $j variables in your code (both loop counters) you will obviously get incorrect results! TESTED BY YOURS TRUELY: 1. For/Next loops are champions. Try not to use While/Wend or Do/Until 2. If $Val is faster than If $Val = 1 or $Val = TRUE 3. If $Val = 1 is faster than $Val = TRUE 4. If Not $Val is faster than If $Val = 0 or $Val = FALSE 5. If $Val = 0 is faster than If $Val = FALSE 6. < and > are faster than =, >= or <= (Wow!) 7. $i += 1 is faster than $i = $i + 1 $i -= 1 is faster than $i = $i - 1 $i *= 1 is faster than $i = $i * 1 $i /= 1 is faster than $i = $i / 1 8. If doing a lot of verifications on a single variable: Switch is fastest, Select is second (but slow) and If is slowest. 9. If $Val is a string, If Not $Val is faster than If $Val = "" If $Val is faster than If $Val <> "" 10. When doing binary operations, If $Val -128 > 0 is twice as fast as If BitAnd($Val, 128). 11. Using Hex numbers is faster than using decimal numbers 12 Replacing dec/hex numbers by variables slows down execution. Use hex/dec numbers when possible 13. Longer variable names = longer execution time. Keep variable names short and clear! 14. StringRegExpReplace() is slower than StringReplace(). Use it only if necessary! 15. StringRegExp() is slower than StringInStr(). Use only if necessary! 16. Opt("ExpandEnvStrings",1) makes $Val = "%TEMP%" faster than $Val = EnvGet("temp") or $Val = @TempDir 17. $Val = @TempDir is faster than $Val = EnvGet("temp") 18. Opt("ExpandVarStrings",1) makes $Val = "$String$" slightly faster than $Val = $String 19. However $Val = "@TempDir@" is slower than $Val = @TempDir (go figure!)
-
Hey thanks a million for the reply ... 50 odd downloads for v.1.07 and only one comment? My my the ice is getting thin!!! You don't happen to speak swahili or klingon do you? I'd love to add a few languages to this!
-
I'll second that - good script! What would be nice however are some comments in your code so that users with less experience will be able to learn something Don't need to comment all the lines, just the lines that contain stuff that is not so evident. BTW, I've only seen one defective lan card that didn't show any MAC adress in my life. So any problems reading the MAC is either AutoIT based or Windows based. I've also checked the registry and although the main Lan card's MAC serves to brand your harddrives, the actual MAC never appears in the registry. So when you ask for it, Windows calls up the hardware every time.
-
Hey same idea here! If you check out my sig, you'll see I've tackled the problem also. As far as constants and the like are concerned, you should check out the excellent "Constants Generator" that enables a user to integrate all the constants in your AU3 file without ever using #include for constants (which bloats up the code like there's no tomorrow). I've also show on that page how how to adapt Constants generator to the latest version of AutoIT. Also if you have #include for other modules, you should consider integrating the functions you use into your AU3 file; unless you expect these includes to change in the future, it just makes more sense to have all your stuff integrated. Hopefully this will help you squeeze even more juice out of AUtoIt3. Obi Wan Celeri BTW: I didn't check lately but last time I was around (2005ish) running FOR/NEXT loops was waaaay faster than DO/UNTIL and the lot. Worth checking out if you're crunching a lot of lines!
-
Hey welcome to the AutoIT forums! Your project is a bit steep for a first program. Start simple or else you're likely to get discouraged and abandon. If I was you I would decompose your project into smaller parts and do them all individually until you are satisfied they work properly. Once all the different modules are done, you will have gained enough experience to merge all the parts together as a whole. Keep us posted!
-
There is usually some empty space in the last cluster of a file. But someone would have to write a UDF to read raw sectors, which is not too evident. There are also ways to hide registry keys, and that would do the trick. Now will this trick work with AUtoIT3, that's something else... But the best solution (in my opinion) is to keep the price of your software so low as to make the most out of the situation; sure you can find someone to crack a program but if the software costs 10$, 20$, it makes no sense.