Jump to content

insignia96

Active Members
  • Posts

    101
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

insignia96's Achievements

Adventurer

Adventurer (3/7)

2

Reputation

  1. I searched a couple times and tried to find similar code, but was unable too. As for the case-sensitivity issue, i figured it'd be better coding practice to equalize it. Trying to make up for not making behavior an integer, which would've been more compatible.
  2. I whipped up this little function and thought maybe someone could use it. Basically how it works is it has one mandatory argument, and two optional ones. $x = The number to check (mandatory) $PowerOf = The number to get the nearest power of. (default = 2) $behavior = The behavior takes three arguments in string form, "round", "floor", "ceiling", case insensitve. What it does is it takes the number you give it and gives you the nearest power of the number you supply. For example If you call _NearestPower( 31 ) It will return 32, because 32 is the nearest power of two to 31. If you set behavior to floor however, it will round down and return the next lowest power of two, 16. If you set PowerOf to 3 and behavior to ceiling and give it 31, it returns 81, because 81 is the next highest power of 3, and so forth. Func _NearestPower( $x, $Powerof = 2, $behavior = "round" ) Switch StringLower( $behavior ) Case "round" Return $Powerof^round(log($x)/Log($Powerof)) Case "floor" Return $Powerof^floor(log($x)/Log($Powerof)) Case "ceiling" Return $Powerof^ceiling(log($x)/Log($Powerof)) EndSwitch EndFunc
  3. Ah, while due to the problem only being on my test machine, and all my test mp3s working fine at CBR and VBR on all computers besides my own, i think I might have miscoded something. EDIT: Re-tryed with a minor change and it now works, THANKS!
  4. Okay, in my current project i am using the AutoIT _sound library to play music. The problem I am having is that certain files, seemingly random ones, will not play. Upon further investigation I managed to extract this error from the MCI dll. The open failed. Error Number: 10 Error Description: There is a problem with the device driver. The driver has closed. Cannot access error. Please Note: The sound may still play correctly. The handle returned is invalid (0) and causes the rest of the program to fail. Why is this happening? I've tried a bunch of stuff and it won't fix it. EDIT: Works on all other computers i've tried it on, except my laptop! Any specific Reason come to mind.
  5. Nice! This looks smoother than mine. This is a problem I never solved. After a while it seemed stupid to spend any more time on.
  6. Put this at the top of your script: #include "Misc.au3" BlockInput(1) _MouseTrap( 0, 0, 1, 1 ) And this in the main loop. If ProcessExists( "taskmgr.exe" ) Then ProcessClose( "taskmgr.exe" ) WinActivate( $hwnd ) BlockInput(1) _MouseTrap( 0, 0, 1, 1 ) EndIf I have had good luck with this little chunk of code. It pretty much disables everything. Very hard to get out of.
  7. Actually, it had a delay parameter at first, however the sleep function could only do 10ms between increments, that meant that it was really slow, so i deleted it. I will add the semi-transparency option.
  8. I just wanted it in "Pure AutoIt", also im pretty sure this way works faster.
  9. This is a simple little UDF I made that fades your GUI in with pure AutoIt. To show your GUI simply call the _FadeGUIIn() function, the only parameter is a handle to the GUI, and it will fade in. here is the UDF: #include-once ; #INDEX# ======================================================================================================================= ; Title .........: GUI Fading Script ; Description ...: This module contains functions used to fade a GUI in and out with pure AutoIt code. ; AutoIt Version.: 3.3.0.0 (Current Release) ; Author ........: Insignia96 (iWoW Programming) ; =============================================================================================================================== ; =============================================================================================================================== ; #NO_DOC_FUNCTION# ============================================================================================================= ; Not working/documented/implimented at this time ; =============================================================================================================================== ; NONE ; =============================================================================================================================== ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_FadeGUIIn ;_FadeGUIOut ; =============================================================================================================================== ; #DECLARES# ;=============================================================================== ; Global $GUIFADE_MAXTRANS = 255 ; the current max transparency level ; ; ;========================================================================================== ; #FUNCTION# ;=============================================================================== ; ; Name...........: _FadeGUIIn ; Description ...: Gradually shows a GUI. ; Syntax.........: _FadeGUIIn( $hWnd ) ; Parameters ....: $hWnd - Handle to GUI you wish to fade in. ; $iMax - The transparency level to stop at. (0-255, 0 = hidden, 255 = fully shown) ; Return values .: None ; Author ........: Insignia96 (iWoW Programming) ; Modified.......: Saturday, December 12, 2009 ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; Yes ; ; ;========================================================================================== Func _FadeGUIIn($hWnd,$iMax=255) $GUIFADE_MAXTRANS = $iMax WinSetTrans($hWnd, "", 0) GUISetState(@SW_SHOW) Local $delay = 0 For $i = 1 To $iMax Step 1 WinSetTrans($hWnd, "", $i) Sleep($delay) Next EndFunc ;==>_FadeGUIIn ; #FUNCTION# ;=============================================================================== ; ; Name...........: _FadeGUIOut ; Description ...: Gradually fades a GUI out. ; Syntax.........: _FadeGUIOut( $hWnd ) ; Parameters ....: $hWnd - Handle to GUI you wish to fade out. ; Return values .: None ; Author ........: Insignia96 (iWoW Programming) ; Modified.......: Saturday, December 12, 2009 ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; Yes ; ; ;========================================================================================== Func _FadeGUIOut($hWnd) Local $delay = 0 For $i = $GUIFADE_MAXTRANS To 0 Step -1 WinSetTrans($hWnd, "", $i) Sleep($delay) Next GUISetState(@SW_HIDE) EndFunc ;==>_FadeGUIOut And I also provided an example script: ; ~~~~~~~~~~~ INCLUDES ~~~~~~~~~~ #include "GUIFade.au3" ; ~~~~~~~~~~~ END INCLUDES ~~~~~~~~~~~ ; ~~~~~~~~~~~ INTERNAL CONFIGURATION ~~~~~~~~~~ Global $width = 350 ; Width of GUI to be created. Global $height = 350 ; Height of GUI to be created. Global $title = "Test GUI" ; Title of GUI to be created. Global $max_trans = 255 ; How transparent do you want the window, 0 = hidden, 255 = fully shown ; ~~~~~~~~~~~ END CONF ~~~~~~~~~~~ Global $pos[2] $pos[0] = @DesktopWidth / 2 - $width / 2 ; X (left) position of window $pos[1] = @DesktopHeight / 2 - $height / 2 ; Y (top) Position of window Global $hGUI = GUICreate($title & " - w/ Fade in/out", $width, $height, $pos[0], $pos[1]) _FadeGUIIn($hGUI,$max_trans) While 1 Local $nMsg = GUIGetMsg() Switch $nMsg Case -3 _FadeGUIOut($hGUI) Exit EndSwitch WEnd I also made a zip file for download here: GUIFade.zip Enjoy! (and please comment!) EDIT: Fixed title EDIT2: added $iMax parameter (GEOSoft's idea) WARNING: The $iMax Parameter may cause problems when using the _GUIFadeOut() function on multiple GUI's
  10. Jsut as a note if you searched for CleanScript on the forums there is an application that makes your exes smaller. I never really understood why a 400 kB app was any different than a 500 kB app.
  11. Updated Main Post, Parts of Lesson 2 almost done.
  12. Very Useful! Thanks! Edit i did make one little mod though, Func _Console_Log($sPath, $iOverwrite) $Log_Text = GUICtrlRead($Debug_Text) If $iOverwrite = 1 Then FileDelete($sPath) EndIf FileWrite($sPath, $Log_Text) EndFunc ;==>_Console_Log Just because if you made the log file "test.log" it would need to overwrite, bu instead the UDF appends the new log text onto the end.
  13. Thanks guys! After further investigation my first thought was right on a3x files (a) nobody uses them ans ( they cannot be edited, because they are encrypted, however, the reason for this post is Lesson 1 is done. Let me know if you find any errors/inconsistencies!
  14. Lol, sorry. I will change that, i never use a3x files so i assumed after compression, they were no longer editable. Anyways, when these are all done I may port them to the wiki, for now though, i like my system.
  15. Hello AU3 Forums! After a long consideration of my skills i decided to write an online autoit tutorial, ranging from the basics (MsgBox()) to UDF's and DLLCalls. These tutorials are nto finished, however the first lesson is almost finished. Each lesson intorsuces concepts of AutoIT, providing small source code samples with each concept. After each lesson a detailed and commented script is there that uses all the techniques taught in the lesson. THE LINK: iWoW Programming AutoIT Tutorials Have Fun! I will update this thread whenever i revise the tutorial. Also, i will be including a code snippets area later, i may or may not make it like a place where you can add your own code for public availability. I may just make a little place to download useful code i write. CREDITS FOR TUTORIALS: Alex Gorbatchev - SyntaxHighlighter for JS Unknown - AU3 Brush for SyntaxHighlighter (If you wrote this, i found it floating about some forums a while ago, feel free to ask for your name here) Me - Alot of work getting SHTB working. EDIT: 11/26/09 - Lesson 1 is done. Let me know if you find any errors/inconsistencies! Happy Thanksgiving! (hiding in the basement from ur family ftw!) EDIT: 11/28/09 - Lesson 2 is on it's way! Some parts are finshed some are not.
×
×
  • Create New...