
Pickpocketz88
Members-
Posts
11 -
Joined
-
Last visited
About Pickpocketz88
- Birthday 06/08/1988
Profile Information
-
Location
Manassas, VA
Pickpocketz88's Achievements

Seeker (1/7)
0
Reputation
-
Func _Binary($Int) ;Uncomment To Only Accept Integers #cs If IsInt($Int) = 0 Then Return 0 EndIf #ce If $Int < 0 Then ;Negative Numbers Will Break The Function Return 0000 EndIf Local $Integer = $Int Dim $Bin[1] = [Mod($Integer, 2)] Local $Counter = 1 Do $Integer = Floor($Integer / 2) _ArrayAdd($Bin, Mod($Integer, 2)) Until $Integer = 0 _ArrayReverse($Bin) ;Reverses The Array Because As Is, The Product Is Backwards ;A Loop To Remove Any Preceding 0's or Add 0's To Keep At Least Four Digits Select Case $Int <= 1 $Integer = "00" & _ArrayToString($Bin, "") Case $Int = 2 Or $Int = 3 $Integer = "0" & _ArrayToString($Bin, "") Case $Int >= 8 $Integer = StringTrimLeft(_ArrayToString($Bin, ""), 1) Case Else $Integer = _ArrayToString($Bin, "") EndSelect ;You Can Comment It Out Without Anything Else Having A Problem Return $Integer EndFunc I made this because I was writing something that I could use to play with Bitwise Operations and using Binary() by itself wasn't helping. It's very basic and will only take positive integers because that's all I needed but I'm sure with a little tweaking you could make it fit with negative and float types. It returns a string essentially but doesn't pose a problem when just changing numbers into binary digits. Example: If you were to do _Binary(5) you would get "0101" and _Binary(8) would return "1000" Between this last sentence and here I've changed this about a half dozen times to refine it a bit because without it checking if your number is < 0 it would break if a negative number was inserted and it wouldn't even have a problem if you put in Float Values, Regular or Special Characters but that negative value will do the trick lol. Anyway, I hope someone finds some use of this and thank you for reading! -Pick
-
Well this completely nullifies what I was trying to do! lol. Well I'm still going to create my own personal "debugger" for my own coding necessities but this is pretty much exactly what I was attempting to do. I hate that my searches didn't include "Debug" or "Debugger" instead it was "How to read vars from running script to another" etc... Thank you so much for this reply because it completely answered my question essentially since everything I need should be in this script. Once again the incredible AutoIt community comes to my aid and saves my butt! I'll have to include you as well as the DBUG creators in my script so if I release a public version you guys will get your credit!
-
First I would just like to say HELLO! to anyone reading. It has been a while since I've posted to the Forums but I'm always crawling around. Now to the matter at hand. I have been looking high and low for a simplistic answer my burned out brain can find but to no avail. I've only recently upped my AutoIt skill and only by a little bit such as ordering my script neatly with my own UDFs and using Global/Dim more often to make my GUI creation understandable and easy to keep things orderly. My current problem however is figuring out how to make my newest endeavor work which is my own "Debugger". I've made a GUI with an Edit Control to display what my Variables are holding and other information from a concurrently running Script. I have access to all of the scripts I'm attempting to connect but I'm dumbfounded on how I would separately read variable information from one running script into another. I'll provide my "Debugger" script that I want to read variables into and a "Meta Script" I'd want to pass info from. #Region Include Files #include <AutoItConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ColorConstantS.au3> #EndRegion #Region AutoIt Options ;Opt("TrayAutoPause", 0) ;Opt("TrayMenuMode", 3) #EndRegion #Region Hotkeys HotKeySet("{ESC}", "ExitProgram") HotKeySet("{PGDN}", "PauseProgram") HotKeySet("!1", "Snippet_1") HotKeySet("!2", "Snippet_2") HotKeySet("!3", "Snippet_3") HotKeySet("!4", "Snippet_4") HotKeySet("!5", "Snippet_5") HotKeySet("!6", "Snippet_6") HotKeySet("!7", "Snippet_7") HotKeySet("!8", "Snippet_8") HotKeySet("!9", "Snippet_9") #EndRegion #Region Global Variables #Region Globals Global $gMain, $ctrlEdit ;, $gParent #EndRegion #Region $gMain Params Dim $gMainW = @DesktopWidth / 2 Dim $gMainH = @DesktopHeight / 2 Dim $gMainX = (@DesktopWidth / 2) - ($gMainW / 2) Dim $gMainY = (@DesktopHeight / 2) - ($gMainH / 2) Dim $gMainStyle = $WS_POPUP Dim $gMainStyleEx = -1 ;Dim $gMainParent = $gParent #EndRegion #Region $ctrlEdit Params Dim $ctrlEditW = Round($gMainW * 0.98) Dim $ctrlEditH = Round($gMainH * 0.98) Dim $ctrlEditX = ($gMainW - $ctrlEditW) / 2 Dim $ctrlEditY = ($gMainH - $ctrlEditH) / 2 Dim $ctrlEditStyle = -1 Dim $ctrlEditStyleEx = -1 #EndRegion #EndRegion #Region GUI Initialization ;$gParent = GUICreate("", -1, -1, -1, -1, -1, $WS_EX_TOOLWINDOW) $gMain = GUICreate("", $gMainW, $gMainH, $gMainX, $gMainY, $gMainStyle, $gMainStyleEx) GUISetBkColor($COLOR_BLACK, $gMain) $ctrlEdit = GUICtrlCreateEdit("MainW: " & $gMainW & @CRLF & "MainH: " & $gMainH & @CRLF & "EditW: " & $ctrlEditW & @CRLF & "EditH: " & $ctrlEditH, $ctrlEditX, $ctrlEditY, $ctrlEditW, $ctrlEditH, $ctrlEditStyle, $ctrlEditStyleEx) GUISetState(@SW_SHOW, $gMain) #EndRegion MainFunction() #Region Main Function (GUI) Func MainFunction() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit EndIf WEnd EndFunc #EndRegion #Region Functions Func Functions() EndFunc #EndRegion #Region Program 1 Func Snippet_1() EndFunc #EndRegion #Region Program 2 Func Snippet_2() EndFunc #EndRegion #Region Program 3 Func Snippet_3() EndFunc #EndRegion #Region Program 4 Func Snippet_4() EndFunc #EndRegion #Region Program 5 Func Snippet_5() EndFunc #EndRegion #Region Program 6 Func Snippet_6() EndFunc #EndRegion #Region Program 7 Func Snippet_7() EndFunc #EndRegion #Region Program 8 Func Snippet_8() EndFunc #EndRegion #Region Program 9 Func Snippet_9() EndFunc #EndRegion #Region Pause/Exit Functions Func PauseProgram() While 1 Sleep(1000) WEnd EndFunc Func ExitProgram() Exit EndFunc #EndRegion Pause/Exit Functions #Region Snippets #CS #CE #EndRegion #Region Other Information #CS #CE #EndRegion That's the Debugger script. Please forgive anything ignorant but point it out if you will, I'll take any pointers to get better! (I usually use a Select to get $GUI_EVENT_CLOSE but this is early on) Now if I made another script with a basic GUI similar to this and wanted to read say the GUI Width ($gMainW) into the Debugger Edit Control could I do it? If so, could I do it for every variable I have in a script? I read something about the Run function and adding the variables as an option parameter I believe which I think I could do with an array to keep it from being super long and ugly but would that be the only way to do this? Any information is going to be appreciated and thank you in advance for your time! Edit: Sadly it just dawned on me that I could make a UDF that will create a child window that will do this instead of having a separate script trying to invade another... I'll still be keeping an eye on this for any comments but I apologize if I wasted your time!
-
Hey BrewManNH! Sorry for the extremely late update. I actually ended up giving up on the project due to frustration I suspect. (Cannot truly remember why). I just read through here again and picked it back up. I finally understand everything you've been telling me since I have been away so now I have a working project due to your diligence! Thank you so much for your patience and assistance.
-
Yea I noticed that when I looked at it with the AutoIt Window Info Tool but wasn't sure how to change it or if it needed to be changed. Thank you for this info. I just need to hit the hay and try again tomorrow. I think I've just been up for too long and the brain needs to do a reset lol. Thank you again for being so patient with me and I will update tomorrow on my progress .
-
Oh jeez I'm sorry lol I understand now. When 0 is Returned the Select Loop ends. So when the loop hit $Btn_Min (Equaling 0) it would just exit and While Loop back again... I feel so dumb haha. Well I fixed it by running the Max_Win() function to initialize it right before running Min_Win(). Thank You so much for giving me some of your time. Any idea on why the $Btn_Min won't work correctly now? If I start it -> Click $Btn_Max -> Click $Btn_Min it only continues to recreate the Max Win. Here's the Updated Code. (Just added the Max_Win() prior to the initial Min_Win()) ;Includes #include <GUIConstantsEx.au3> ;HotKeys HotKeySet("{ESC}", "QUIT") ;Globals: Global $WinWid = 600, $WinHgt = 250, $WinWidMin = 100, $WinHgtMin = 15 Global $WinMinX = @DesktopWidth - ($WinWidMin + 50), $WinMinY = @DesktopHeight - ($WinHgtMin + 100) Global $WinX = @DesktopWidth - ($WinWid + 50), $WinY = @DesktopHeight - ($WinHgt + 100) Global $Min_Win, $Btn_Max, $Max_Win, $Btn_Min ;Start Program Mini_Calender() ;Create Start Window & Main Function Func Mini_Calender() Max_Win() Min_Win() ;Runs Min_Win() Function (Creates Mini Window) While 1 ;Begins While Loop $msg = GUIGetMsg() ;Watches GUI Events Select ;Begins Select Loop Case $msg = $Btn_Max ;If Max(<) Button Pressed Max_Win() ;Runs Max_Win() Function (Creates Full Window) Case $msg = $Btn_Min ;If Min(>) Button Pressed Min_Win() ;Runs Min_Win() Function (Creates Mini Window) Case $msg = $GUI_EVENT_CLOSE ;If Close(X) Button Pressed Exit ;Close Program EndSelect ;Ends Select Loop WEnd ;Ends While Loops EndFunc ;Creates Mini Window Func Min_Win() GUIDelete() ;Deletes Current GUI Window $Min_Win = GUICreate("Mini Calender", $WinWidMin, $WinHgtMin, $WinMinX, $WinMinY) ;Creates Mini Window $Btn_Max = GUICtrlCreateButton("<", 25, 0, 50, 15) ;Creates Max Button GUISetState(@SW_SHOW) ;Makes GUI Window Visible EndFunc ;Creates Max Window Func Max_Win() GUIDelete() ;Deletes Current GUI Window $Max_Win = GUICreate("Mini Calender", $WinWid, $WinHgt, $WinX, $WinY) ;Creates Max Window $Btn_Min = GUICtrlCreateButton(">", $WinWid - 75, $WinHgt - 16, 50, 15) ;Creates Min Button GUISetState(@SW_SHOW) ;Makes GUI Window Visible EndFunc ;Emergency Exit (ESC Key) Func QUIT() Exit ;Exits The Program EndFunc
-
That sure enough fixed it. Thank You for the swift reply! I supposed I'm confused on how the GUIMsg/Select Loop/GUICtrlCreate mechanics work together. Such as when the loop runs why is there even an issue until the $Btn_Min is even clicked by the user etc. If the Select Loop is waiting for the GUIMsg to match up with something then why is $Btn_Min even an issue when it does not exist yet? No need to explain it to me unless you really wish to. I'll read up on this more on my own .
-
Hello Everyone , My name is Will and I have used AutoIt for quite some time now to make mini apps for myself such as Video Game Bibles(Game Encyclopedias), Desktop/Folder Locks and other goofy projects. I am currently working on a little "reminder" project to keep things in mind since my memory is very selective . So to get to my point I am having trouble with swapping GUIs when using a Select Loop nested inside of a While Loop. I have one GUI create initially and then the loop begins. It waits for buttons to be pressed but after adding the Btn_Min (Button to Minimize) Case things get screwy. After adding this Case then running my program the GUI is created/deleted infinitely. Now I do have the function to create the other GUI deleting the current one which is why the GUIs do not pile up but rather re-create. I have searched a bit to find out if there have been similar issues but I have not been able to find anything on it (probably because I don't know exactly what to search) but if anyone could point me in the correct direction it would be much appreciated! Here is my script: (Lines 28 & 29 are commented out. Those are the ones that cause the issue. Can press ESC Button for an emergency exit) ;Includes #include <GUIConstantsEx.au3> ;HotKeys HotKeySet("{ESC}", "QUIT") ;Globals: Global $WinWid = 600, $WinHgt = 250, $WinWidMin = 100, $WinHgtMin = 15 Global $WinMinX = @DesktopWidth - ($WinWidMin + 50), $WinMinY = @DesktopHeight - ($WinHgtMin + 100) Global $WinX = @DesktopWidth - ($WinWid + 50), $WinY = @DesktopHeight - ($WinHgt + 100) Global $Min_Win, $Btn_Max, $Max_Win, $Btn_Min ;Start Program Mini_Calender() ;Create Start Window & Main Function Func Mini_Calender() Min_Win() ;Runs Min_Win() Function (Creates Mini Window) While 1 ;Begins While Loop $msg = GUIGetMsg() ;Watches GUI Events Select ;Begins Select Loop Case $msg = $Btn_Max ;If Max(<) Button Pressed Max_Win() ;Runs Max_Win() Function (Creates Full Window) ; Case $msg = $Btn_Min ;If Min(>) Button Pressed ; Min_Win() ;Runs Min_Win() Function (Creates Mini Window) Case $msg = $GUI_EVENT_CLOSE ;If Close(X) Button Pressed Exit ;Close Program EndSelect ;Ends Select Loop WEnd ;Ends While Loops EndFunc ;Creates Mini Window Func Min_Win() GUIDelete() ;Deletes Current GUI Window $Min_Win = GUICreate("Mini Calender", $WinWidMin, $WinHgtMin, $WinMinX, $WinMinY) ;Creates Mini Window $Btn_Max = GUICtrlCreateButton("<", 25, 0, 50, 15) ;Creates Max Button GUISetState(@SW_SHOW) ;Makes GUI Window Visible EndFunc ;Creates Max Window Func Max_Win() GUIDelete() ;Deletes Current GUI Window $Max_Win = GUICreate("Mini Calender", $WinWid, $WinHgt, $WinX, $WinY) ;Creates Max Window $Btn_Min = GUICtrlCreateButton(">", $WinWid - 75, $WinHgt - 16, 50, 15) ;Creates Min Button GUISetState(@SW_SHOW) ;Makes GUI Window Visible EndFunc ;Emergency Exit (ESC Key) Func QUIT() Exit ;Exits The Program EndFunc If you have any questions please ask me and I will do my best to answer.
-
Button Creation Loop Triggers GUIGetMsg
Pickpocketz88 replied to Pickpocketz88's topic in AutoIt GUI Help and Support
Wow that was a complete derp moment. I apologize for not realizing that I wasn't actually assigning the controls to the array. It's funny because it almost hit me in a dream. I was just lying my head down starting to nod off and *BAM*! the solution hits me like a ton of bricks. -
Button Creation Loop Triggers GUIGetMsg
Pickpocketz88 replied to Pickpocketz88's topic in AutoIt GUI Help and Support
Thank you for the Hints! I'm not sure why GUIGetMsg is coming up with 0 and $Button_Array[0], $Button_Array[1] etc... aren't showing anything being stored as far as I can tell. My guess now is that it's not possible to use an array to store controls. -
I'm working on a small practice project that allows a user to 1. Choose between moving multiple files to a single target location or 2. Moving multiple files to Multiple locations. The problem I am having is creating all the buttons I wish to use. I have created them with a loop and it seems to cause a problem with the GUIGetMsg() Function. If I create each button seperatly I have no problems except the load of lines used to create them seperatly. I was wondering if there is a work around for this or not. Here is my code (Please bare with me if it looks a mess...) #include #include #include HotKeySet("{ESC}", "Destroy") $Version = "1.0" $WindowW = 100 $WindowH = 100 $CenterW = (@DesktopWidth / 2) - ($WindowW / 2) $CenterH = (@DesktopHeight / 2) - ($WindowH / 2) Startup_Window() Func Main_Window($Win_Style) If $Win_Style = 1 Then $WindowW = 500 $WindowH = 500 $CenterW = (@DesktopWidth / 2) - ($WindowW / 2) $CenterH = (@DesktopHeight / 2) - ($WindowH / 2) $SD_Window = GUICreate("Installation Manager " & $Version, $WindowW, $WindowH, $CenterW, $CenterH) $File_Menu = GUICtrlCreateMenu("&File") $Prefrences_Sub_Menu = GUICtrlCreateMenuItem("Prefrences", $File_Menu) $Exit_Sub_Menu = GUICtrlCreateMenuItem("Exit", $File_Menu) Local $Button_Array[15] $ButtonW = 60 $ButtonH = 20 $ButtonColumn = $WindowW - ($ButtonW + 5) $ButtonRow = 5 $i = 1 While $i <= 15 GUICtrlCreateButton("Browse", $ButtonColumn, $ButtonRow, $ButtonW, $ButtonH) $ButtonRow = $ButtonRow + 25 $i = $i + 1 WEnd GUISetIcon(@ScriptDir & "\PPzIcon.ico") GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $Button_Array[1] MsgBox(0, "", "Button 1") Case $msg = $GUI_EVENT_CLOSE ;MsgBox(0, "Goodbye", "Thanks for using Pickpocketz Installation Manager!") Exit Case $msg = $Exit_Sub_menu Exit EndSelect WEnd ElseIf $Win_Style = 2 Then $WindowW = 500 $WindowH = 500 $CenterW = (@DesktopWidth / 2) - ($WindowW / 2) $CenterH = (@DesktopHeight / 2) - ($WindowH / 2) $MD_Window = GUICreate("Installation Manager " & $Version, $WindowW, $WindowH, $CenterW, $CenterH) GUISetIcon(@ScriptDir & "\PPzIcon.ico") GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ;MsgBox(0, "Goodbye", "Thanks for using Pickpocketz Installation Manager!") Exit EndSelect WEnd Else MsgBox(0, "Error", "Window Style Not Recognized!") Exit EndIf EndFunc Func Destroy() Exit EndFunc Func Startup_Window() $S_Win = GUICreate("", $WindowW, $WindowH, $CenterW, $CenterH) GUISetBkColor(0x000000) $SD_Button = GUICtrlCreateButton("Single Dir Install", 0, $WindowH - 40, 100, 20) $MD_Button = GUICtrlCreateButton("Multi Dir Install", 0, $WindowH - 20, 100, 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $SD_Button $Win_Style = 1 GUIDelete($S_Win) Main_Window($Win_Style) Case $msg = $MD_Button $Win_Style = 2 GUIDelete($S_Win) Main_Window($Win_Style) Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd EndFunc