
Damein
-
Posts
607 -
Joined
-
Last visited
Reputation Activity
-
Damein got a reaction from onderijw in Zoom In IE
Well, the default key to set zoom, if I remember correctly (I know for sure in Firefox & Chrome) is Ctrl+0 not, ++. Why is this not a reliable way, so long as you first focus the program on the IE window?
-
Damein got a reaction from antonioj84 in How to check if multiple checkboxes are checked
I know you already had your question answered, but I figured I'd post this one up too if anyone else comes by this:
#include <GUIConstantsEx.au3> #CS In this script we will learn how to create multiple checkboxes, and then use a button to determine which are checked or unchecked. #CE GuiCreate("GUI Tutorial: CheckBox 2",280,60) ; Create the GUI to display $CheckBox1 = GuiCtrlCreateCheckBox("Checkbox 1", 15,10) ; Create the GuiCtrl CheckBox, assign var CheckBox1 to it. $CheckBox2 = GuiCtrlCreateCheckBox("Checkbox 2", 190,10) ; Create the GuiCtrl CheckBox2, assign var CheckBox2 to it. $SubmitButton = GuiCtrlCreateButton("Submit", 115, 35) ; Create the GuiCtrl SubmitButton, assign var SubmitButton to it GuiSetState() ; Set GUI state to show to display the GUI While 1 ; Start a while statement to capture the commands from the GUI $GuiMsg = GuiGetMsg() ; Set the var GuiMsg to the commands from the GUI Select ; Begin a select statement Case $GuiMsg = $Gui_Event_Close ; A "If" statement for the command from the GUI, in this case the close button on the GUI Exit ; Tell the program to exit if the command from the GUI is infact the close button Case $GuiMsg = $SubmitButton ; A "If" statement for the command from the GUI, in this case the submit button on the GUI $CheckBoxStatus1 = GuiCtrlRead($CheckBox1) ; Read the status for CheckBox1 $CheckBoxStatus2 = GuiCtrlRead($CheckBox2) ; Read the status for CheckBox2 If $CheckBoxStatus1 = $GUI_UNCHECKED Then ; If CheckBox1 was checked and clicked, then display a MsgBox to show it was unchecked MsgBox(0, "GUI Tutorial: CheckBox 2", "Checkbox 1 is unchecked") ; Display this MsgBox if CheckBox1 is unchecked ElseIf $CheckBoxStatus1 = $GUI_CHECKED Then ; If CheckBox1 was unchecked and clicked, then display a MsgBox to show it was checked MsgBox(0, "GUI Tutorial: CheckBox 2", "Checkbox 1 is checked") ; Display this MsgBox if CheckBox1 is checked EndIf ; End If/ElseIf statement for CheckBox1 If $CheckBoxStatus2 = $GUI_UNCHECKED Then ; If CheckBox2 was checked and clicked, then display a MsgBox to show it was unchecked MsgBox(0, "GUI Tutorial: CheckBox 2", "Checkbox 2 is unchecked") ; Display this MsgBox if CheckBox2 is unchecked ElseIf $CheckBoxStatus2 = $GUI_CHECKED Then ; If CheckBox2 was unchecked and clicked, then display a MsgBox to show it was checked MsgBox(0, "GUI Tutorial: CheckBox 2", "Checkbox 2 is checked") ; Display this MsgBox if CheckBox2 is checked EndIf ; End If/ElseIf statement for CheckBox1 EndSelect ; End the select statement WEnd ; End the while statement -
Damein got a reaction from coffeeturtle in Parts / Inventory / Database Manager
Hey, wasn't quite sure what to call it on here so we'll go with that, lol.
It's pretty simple but pretty efficient IMO and is going to help me out a lot.
When I finish a job I have to present all the part numbers and the serial numbers of whatever I work on. Each facility is different but I can load a database and have it all in one easy location.
It started out as something I just made for myself but turned into something more professional and universal. The Listviews and INI's can be pretty much changed to whatever is needed for anything so I thought I'd share. Thanks!
Images
So when you click on the "Manage Database" button it requests a folder with stored Databases. If the folder contains no Parts/Equipment INI's it will automatically create them.
The rest is pretty self-explanatory.
Sources
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Images\Icon.ico #AutoIt3Wrapper_Compression=0 #AutoIt3Wrapper_Res_Fileversion=1.3.0.0 #AutoIt3Wrapper_Res_LegalCopyright=R.S.S. #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; *** Start added by AutoIt3Wrapper *** ; *** End added by AutoIt3Wrapper *** #include <GUIConstantsEx.au3> #include <Misc.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> #include <Excel.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> #include <Array.au3> #include <WindowsConstants.au3> #include <File.au3> #include "SearchWorkOrdersModule.au3" #include "ManageDatabaseModule.au3" Local $hDLL = DllOpen("user32.dll") Opt("GUIOnEventMode", 1) Opt("WinTitleMatchMode", 3) Global $CurrentGUI, $MainGUI, $ManageGUI, $ManagePartsGUI, $ManageUnitsGUI, $DatabasePath, $WorkOrdersGUI, $ViewWorkOrdersGUI _CreateMainGUI() Func _CreateMainGUI() $CurrentGUI = "Main" $MainGUI = GUICreate("Waddell Power Database Manager", 400, 250) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetBkColor(0xFFFFFF) $ManageDatabasesButton = GUICtrlCreateButton("Manage Databases", 10, 90, 185, 60) GUICtrlSetOnEvent(-1, "_CreateManageGUI") GUICtrlSetFont(-1, 15) $SearchWorkOrdersButton = GUICtrlCreateButton("Search Work Orders", 205, 90, 185, 60) GUICtrlSetOnEvent(-1, "_CreateWorkOrdersGUI") GUICtrlSetFont(-1, 14.5) $ExitButton = GUICtrlCreateButton("Exit", 110, 170, 185, 60) GUICtrlSetOnEvent(-1, "_Exit") GUICtrlSetFont(-1, 15) GUICtrlCreateLabel("© RS Software", 335, 240, 200) GUICtrlSetFont(-1, 7) GUICtrlCreateLabel("Version 1.2", 1, 240, 200) GUICtrlSetFont(-1, 7) GUICtrlCreatePic(@ScriptDir & "\Images\Logo.bmp", 50, 5, 300, 70) GUISetState() EndFunc ;==>_CreateMainGUI Func _CloseGUI() If $CurrentGUI = "Manage" Then GUIDelete($ManageGUI) GUISetState(@SW_ENABLE, $MainGUI) Sleep(100) WinActivate($MainGUI) $CurrentGUI = "Main" EndIf If $CurrentGUI = "Parts" Then GUIDelete($ManagePartsGUI) GUISetState(@SW_ENABLE, $ManageGUI) Sleep(100) WinActivate($ManageGUI) $CurrentGUI = "Manage" EndIf If $CurrentGUI = "Units" Then GUIDelete($ManageUnitsGUI) GUISetState(@SW_ENABLE, $ManageGUI) Sleep(100) WinActivate($ManageGUI) $CurrentGUI = "Manage" EndIf If $CurrentGUI = "Work Orders" Then GUIDelete($WorkOrdersGUI) GUISetState(@SW_ENABLE, $MainGUI) Sleep(100) WinActivate($MainGUI) $CurrentGUI = "Main" EndIf If $CurrentGUI = "View Work Orders" Then GUIDelete($ViewWorkOrdersGUI) GUISetState(@SW_ENABLE, $MainGUI) Sleep(100) WinActivate($MainGUI) $CurrentGUI = "Main" EndIf EndFunc ;==>_CloseGUI Func _Exit() Exit EndFunc ;==>_Exit While 1 Sleep(10) WEnd
ManageDatabaseModule
Global $CurrentGUI, $ManageGUI, $ListView, $ManagePartsGUI, $ManageUnitsGUI, $DatabasePath, $SearchPartsInput, $SearchEquipmentInput, $PartList Global $g_bSortSense = True Func _CreateManageGui() $DatabasePath = FileSelectFolder("Select Folder...", @MyDocumentsDir) If $DatabasePath = "" Then MsgBox(48, "Error", "No database selected, cancelling operation!") Else GUISetState(@SW_DISABLE, $MainGui) $CurrentGUI = "Manage" $ManageGUI = GUICreate("Manage Database's", 400, 250) GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseGUI") GUISetBkColor(0xFFFFFF) $ManagePartsButton = GUICtrlCreateButton("Manage Parts", 10, 90, 185, 60) GUICtrlSetOnEvent(-1, "_ManageParts") GUICtrlSetFont(-1, 15) $ManageUnitsButton = GUICtrlCreateButton("Manage Equipment", 205, 90, 185, 60) GUICtrlSetOnEvent(-1, "_ManageEquipment") GUICtrlSetFont(-1, 15) $ExitButton = GUICtrlCreateButton("Close", 100, 180, 185, 60) GUICtrlSetOnEvent(-1, "_CloseGUI") GUICtrlSetFont(-1, 15) GUICtrlCreatePic(@ScriptDir & "\Images\Logo.bmp", 50, 5, 300, 70) GUISetState() EndIf EndFunc ;==>_CreateManageGui Func _ManageParts() GUISetState(@SW_DISABLE, $ManageGUI) $CurrentGUI = "Parts" If FileExists($DatabasePath & "/Parts Database.ini") Then $ReadData = IniReadSection($DatabasePath & "/Parts Database.ini", "Parts") Else MsgBox(0, "Database Created", "No database was found, creating new database!") FileCopy(@ScriptDir & "/Data/Default Parts Database.ini", $DatabasePath & "/Parts Database.ini") FileCopy(@ScriptDir & "/Data/Default Equipment Database.ini", $DatabasePath & "/Equipment Database.ini") $ReadData = IniReadSection($DatabasePath & "/Parts Database.ini", "Parts") EndIf $ManagePartsGUI = GUICreate("Parts", 600, 660) GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseGUI") GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Search Parts", 12, 20, 130, 40) GUICtrlSetFont(-1, 16) $SearchPartsInput = GUICtrlCreateInput("", 150, 18, 250, 30) GUICtrlSetFont(-1, 16) $SearchPartsButton = GUICtrlCreateButton("Search", 450, 5, 100, 50) GUICtrlSetOnEvent(-1, "_SearchParts") GUICtrlSetFont(-1, 16) $ListView = GUICtrlCreateListView("Part Number|Description|Product Line|Bin Number", 10, 60, 580, 500, $LVS_SORTASCENDING) _GUICtrlListView_SetColumnWidth(-1, 0, 200) _GUICtrlListView_SetColumnWidth(-1, 1, 500) _GUICtrlListView_SetColumnWidth(-1, 2, 200) _GUICtrlListView_SetColumnWidth(-1, 3, 200) For $i = 1 To UBound($ReadData) - 1 GUICtrlCreateListViewItem($ReadData[$i][0] & "|" & $ReadData[$i][1], $ListView) Next $AddNewPartButton = GUICtrlCreateButton("Add", 10, 565, 220, 40) GUICtrlSetOnEvent(-1, "_AddPart") GUICtrlSetFont(-1, 16) $EditPartButton = GUICtrlCreateButton("Edit", 370, 565, 220, 40) GUICtrlSetOnEvent(-1, "_EditPart") GUICtrlSetFont(-1, 16) $RemovePartButton = GUICtrlCreateButton("Remove", 10, 615, 220, 40) GUICtrlSetOnEvent(-1, "_RemovePart") GUICtrlSetFont(-1, 16) $CloseButton = GUICtrlCreateButton("Close", 370, 615, 220, 40) GUICtrlSetOnEvent(-1, "_CloseGUI") GUICtrlSetFont(-1, 16) $ExportButton = GUICtrlCreateButton("Export", 250, 590, 100, 50) GUICtrlSetOnEvent(-1, "_Export") GUICtrlSetFont(-1, 16) GUISetState() GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") EndFunc ;==>_ManageParts Func _Export() SplashTextOn("Exporting...", "Exporting... please wait...", 300, 50, Default, Default, 33) Local $oExcel = _Excel_Open() If @error Then Exit MsgBox(16, "Excel UDF: _Excel_BookOpenText Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Open a text file as delimited, separator = |, pass fieldinfo and set ; DecimalSeparator and ThousandsSeparator. ; ***************************************************************************** _FileReadToArray($DatabasePath & "/Parts Database.ini", $PartList) FileDelete(@TempDir & "/Temp Part Database.txt") FileWrite(@TempDir & "/Temp Part Database.txt", "Part Number|Part Description|Product Line|Bin Number|Count" & @CRLF) For $i = 2 To UBound($PartList) - 1 If StringInStr($PartList[$i], "=") Then $PartList[$i] = StringReplace($PartList[$i], "=", "|") EndIf FileWrite(@TempDir & "/Temp Part Database.txt", $PartList[$i] & @CRLF) Next Local $sTextFile = @TempDir & "/Temp Part Database.txt" $oWorkbook = _Excel_BookOpenText($oExcel, $sTextFile, Default, $xlGeneralFormat, Default, Default, "|") If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookOpenText Example 1", "Error opening '" & $sTextFile & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Exit Else EndIf SplashOff() EndFunc ;==>_Export Func _AddPart() GUISetState(@SW_DISABLE, $ManagePartsGUI) $Stop = 0 $NewPartNumber = InputBox("Add Part", "Please input the part number you wish to add.") If $NewPartNumber = "" Then MsgBox(48, "Error", "No part number input, cancelling addition of a new part!") $Stop = 1 EndIf If $Stop = 0 Then $NewPartDescription = InputBox("Add Part", "Please input the part description you wish to add.") If $NewPartDescription = "" Then MsgBox(48, "Error", "No part description was inputted, cancelling addition of a new part!") $Stop = 1 EndIf EndIf If $Stop = 0 Then $NewPartProductLine = InputBox("Add Part", "Please input the product line associated with this part that you wish to add.") If $NewPartProductLine = "" Then MsgBox(48, "Error", "No product line was inputted, cancelling addition of a new part!") $Stop = 1 EndIf EndIf If $Stop = 0 Then $NewPartBin = InputBox("Add Part", "Please input the part bin number you wish to add.") If $NewPartBin = "" Then MsgBox(48, "Error", "No part bin number was inputted, cancelling addition of a new part!") $Stop = 1 EndIf EndIf If $Stop = 0 Then $CheckMsgBox = MsgBox(4, "Add Part", "Are you sure you wish to add the following part?" & @CRLF & @CRLF & "Part Number: " & $NewPartNumber & @CRLF & "Part Description: " & $NewPartDescription & @CRLF & "Product Line: " & $NewPartProductLine & @CRLF & "Bin Number: " & $NewPartBin) If $CheckMsgBox = 6 Then IniWrite($DatabasePath & "/Parts Database.ini", "Parts", $NewPartNumber, $NewPartDescription & "|" & $NewPartProductLine & "|" & $NewPartBin) MsgBox(0, "Add Part", "Part number: " & $NewPartNumber & " has been added!") GUICtrlCreateListViewItem($NewPartNumber & "|" & $NewPartDescription & "|" & $NewPartProductLine & "|" & $NewPartBin, $ListView) Else MsgBox(48, "Add Part", "You have chosen to cancel the addition of a new part!") EndIf EndIf GUISetState(@SW_ENABLE, $ManagePartsGUI) Sleep(100) WinActivate($ManagePartsGUI) EndFunc ;==>_AddPart Func _EditPart() GUISetState(@SW_DISABLE, $ManagePartsGUI) $ListViewGetSelection = _GUICtrlListView_GetSelectionMark($ListView) $GetPartNumber = _GUICtrlListView_GetItem($ListView, $ListViewGetSelection, 0) $GetPartDescription = _GUICtrlListView_GetItem($ListView, $ListViewGetSelection, 1) $GetPartProductLine = _GUICtrlListView_GetItem($ListView, $ListViewGetSelection, 2) $GetPartBin = _GUICtrlListView_GetItem($ListView, $ListViewGetSelection, 3) If $GetPartNumber[3] = "" Then MsgBox(48, "Error", "No part was selected, cancelling operation!") Else $Stop = 0 $EditPartNumber = InputBox("Edit Part", "Please input a new part number or leave the part number the same.", $GetPartNumber[3]) If $EditPartNumber = "" Then MsgBox(48, "Error", "No part number input, cancelling edit of part!") $Stop = 1 EndIf If $Stop = 0 Then $EditPartDescription = InputBox("Edit Part", "Please input a new part description or leave the description the same.", $GetPartDescription[3]) If $EditPartDescription = "" Then MsgBox(48, "Error", "No part description was inputted, cancelling edit of part!") $Stop = 1 EndIf EndIf If $Stop = 0 Then $EditPartProductLine = InputBox("Edit Part", "Please input a new product line associated with this part that you wish to edit or leave it the same.", $GetPartProductLine[3]) If $EditPartProductLine = "" Then MsgBox(48, "Error", "No product line was inputted, cancelling edit of part!") $Stop = 1 EndIf EndIf If $Stop = 0 Then $EditPartBin = InputBox("Edit Part", "Please input a new part bin number or leave the number the same.", $GetPartBin[3]) If $EditPartDescription = "" Then MsgBox(48, "Error", "No part bin number was inputted, cancelling edit of part!") $Stop = 1 EndIf EndIf If $Stop = 0 Then $CheckMsgBox = MsgBox(4, "Edit Part", "Are you sure you wish to edit the following part?" & @CRLF & @CRLF & "Part Number: " & $EditPartNumber & @CRLF & "Part Description: " & $EditPartDescription & @CRLF & "Product Line: " & $EditPartProductLine & @CRLF & "Bin Number: " & $EditPartBin) If $CheckMsgBox = 6 Then IniDelete($DatabasePath & "/Parts Database.ini", "Parts", $GetPartNumber[3]) IniWrite($DatabasePath & "/Parts Database.ini", "Parts", $EditPartNumber, $EditPartDescription & "|" & $EditPartProductLine & "|" & $EditPartBin) MsgBox(0, "Edit Part", "Part number: " & $EditPartNumber & " has been changed!") _GUICtrlListView_DeleteItem($ListView, $ListViewGetSelection) GUICtrlCreateListViewItem($EditPartNumber & "|" & $EditPartDescription & "|" & $EditPartProductLine & "|" & $EditPartBin, $ListView) Else MsgBox(48, "Edit Part", "You have chosen to cancel the edit of the part!") EndIf EndIf EndIf GUISetState(@SW_ENABLE, $ManagePartsGUI) Sleep(100) WinActivate($ManagePartsGUI) EndFunc ;==>_EditPart Func _RemovePart() GUISetState(@SW_DISABLE, $ManagePartsGUI) $ListViewGetSelection = _GUICtrlListView_GetSelectionMark($ListView) $GetPartNumber = _GUICtrlListView_GetItem($ListView, $ListViewGetSelection, 0) If $GetPartNumber[3] = "" Then MsgBox(48, "Error", "No part was selected, cancelling operation!") Else $CheckMsgBox = MsgBox(4, "Remove Part", "Are you sure you wish to remove the following part?" & @CRLF & @CRLF & $GetPartNumber[3]) If $CheckMsgBox = 6 Then _GUICtrlListView_DeleteItem($ListView, $ListViewGetSelection) IniDelete($DatabasePath & "/Parts Database.ini", "Parts", $GetPartNumber[3]) MsgBox(0, "Remove Part", "The part has been removed from the database!") Else MsgBox(48, "Remove Part", "You have chosen to cancel the removal of the part!") EndIf EndIf GUISetState(@SW_ENABLE, $ManagePartsGUI) Sleep(100) WinActivate($ManagePartsGUI) EndFunc ;==>_RemovePart Func _ManageEquipment() GUISetState(@SW_DISABLE, $ManageGUI) $CurrentGUI = "Units" If FileExists($DatabasePath & "/Equipment Database.ini") Then $ReadData = IniReadSection($DatabasePath & "/Equipment Database.ini", "Equipment") Else MsgBox(0, "Database Created", "No database was found, creating new database!") FileCopy(@ScriptDir & "/Data/Default Parts Database.ini", $DatabasePath & "/Parts Database.ini") FileCopy(@ScriptDir & "/Data/Default Equipment Database.ini", $DatabasePath & "/Equipment Database.ini") $ReadData = IniReadSection($DatabasePath & "/Equipment Database.ini", "Equipment") EndIf $ManageUnitsGUI = GUICreate("Equipment", 600, 660) GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseGUI") GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Search Equipment", 12, 20, 170, 40) GUICtrlSetFont(-1, 16) $SearchEquipmentInput = GUICtrlCreateInput("", 200, 18, 250, 30) GUICtrlSetFont(-1, 16) $SearchEquipmentButton = GUICtrlCreateButton("Search", 480, 5, 100, 50) GUICtrlSetOnEvent(-1, "_SearchEquipment") GUICtrlSetFont(-1, 16) $ListView = GUICtrlCreateListView("Unit Number|Model Number|Serial Number", 10, 60, 580, 500, $LVS_SORTASCENDING) _GUICtrlListView_SetColumnWidth(-1, 0, 100) _GUICtrlListView_SetColumnWidth(-1, 1, 250) _GUICtrlListView_SetColumnWidth(-1, 2, 250) For $i = 1 To UBound($ReadData) - 1 GUICtrlCreateListViewItem($ReadData[$i][0] & "|" & $ReadData[$i][1], $ListView) Next $AddNewUnitButton = GUICtrlCreateButton("Add", 10, 565, 220, 40) GUICtrlSetOnEvent(-1, "_AddUnit") GUICtrlSetFont(-1, 16) $EditUnitButton = GUICtrlCreateButton("Edit", 370, 565, 220, 40) GUICtrlSetOnEvent(-1, "_EditUnit") GUICtrlSetFont(-1, 16) $RemoveUnitButton = GUICtrlCreateButton("Remove", 10, 615, 220, 40) GUICtrlSetOnEvent(-1, "_RemoveUnit") GUICtrlSetFont(-1, 16) $CloseButton = GUICtrlCreateButton("Close", 370, 615, 220, 40) GUICtrlSetOnEvent(-1, "_CloseGUI") GUICtrlSetFont(-1, 16) GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") GUISetState() EndFunc ;==>_ManageEquipment Func _AddUnit() GUISetState(@SW_DISABLE, $ManageUnitsGUI) $Stop = 0 $NewUnitNumber = InputBox("Add Equipment", "Please input the unit number you wish to add.") If $NewUnitNumber = "" Then MsgBox(48, "Error", "No unit number input, cancelling addition of a new unit!") $Stop = 1 EndIf If $Stop = 0 Then $NewUnitModelNumber = InputBox("Add Equipment", "Please input the model number of this unit.") If $NewUnitModelNumber = "" Then MsgBox(48, "Error", "No model number was inputted, cancelling addition of a new unit!") $Stop = 1 EndIf EndIf If $Stop = 0 Then $NewUnitBatterySerial = InputBox("Add Unit", "Please input the serial number with this unit.") If $NewUnitBatterySerial = "" Then MsgBox(48, "Error", "No serial number was inputted, cancelling addition of a new unit!") $Stop = 1 EndIf EndIf If $Stop = 0 Then $CheckMsgBox = MsgBox(4, "Add Unit", "Are you sure you wish to add the following unit?" & @CRLF & @CRLF & "Unit Number: " & $NewUnitNumber & @CRLF & "Model Number: " & $NewUnitModelNumber & @CRLF & "Serial Number: " & $NewUnitBatterySerial) If $CheckMsgBox = 6 Then IniWrite($DatabasePath & "/Equipment Database.ini", "Equipment", $NewUnitNumber, $NewUnitModelNumber & "|" & $NewUnitBatterySerial) MsgBox(0, "Add Unit", "Unit number: " & $NewUnitNumber & " has been added!") GUICtrlCreateListViewItem($NewUnitNumber & "|" & $NewUnitModelNumber & "|" & $NewUnitBatterySerial, $ListView) Else MsgBox(48, "Add Unit", "You have chosen to cancel the addition of a new unit!") EndIf EndIf GUISetState(@SW_ENABLE, $ManageUnitsGUI) Sleep(100) WinActivate($ManageUnitsGUI) EndFunc ;==>_AddUnit Func _EditUnit() GUISetState(@SW_DISABLE, $ManageUnitsGUI) $ListViewGetSelection = _GUICtrlListView_GetSelectionMark($ListView) $GetUnitNumber = _GUICtrlListView_GetItem($ListView, $ListViewGetSelection, 0) $GetUnitModelNumber = _GUICtrlListView_GetItem($ListView, $ListViewGetSelection, 1) $GetUnitBatterySerial = _GUICtrlListView_GetItem($ListView, $ListViewGetSelection, 2) $Stop = 0 If $GetUnitNumber[3] = "" Then MsgBox(48, "Error", "No unit was selected, cancelling operation!") Else $EditUnitNumber = InputBox("Edit Unit", "Please input the unit number you wish to edit.", $GetUnitNumber[3]) If $EditUnitNumber = "" Then MsgBox(48, "Error", "No unit number input, cancelling edit of the unit!") $Stop = 1 EndIf If $Stop = 0 Then $EditUnitModelNumber = InputBox("Edit Unit", "Please input the model number with this unit.", $GetUnitModelNumber[3]) If $EditUnitModelNumber = "" Then MsgBox(48, "Error", "No model number was inputted, cancelling edit of the unit!") $Stop = 1 EndIf EndIf If $Stop = 0 Then $EditUnitBatterySerial = InputBox("Edit Unit", "Please input the serial number with this unit.", $GetUnitBatterySerial[3]) If $EditUnitBatterySerial = "" Then MsgBox(48, "Error", "No serial number was inputted, cancelling edit of the unit!") $Stop = 1 EndIf EndIf If $Stop = 0 Then $CheckMsgBox = MsgBox(4, "Edit Unit", "Are you sure you wish to edit the following Unit?" & @CRLF & @CRLF & "Unit Number: " & $EditUnitNumber & @CRLF & "Model Number: " & $EditUnitModelNumber & @CRLF & "Serial Number: " & $EditUnitBatterySerial) If $CheckMsgBox = 6 Then IniDelete($DatabasePath & "/Equipment Database.ini", "Equipment", $GetUnitNumber[3]) IniWrite($DatabasePath & "/Equipment Database.ini", "Equipment", $EditUnitNumber, $EditUnitModelNumber & "|" & $EditUnitBatterySerial) MsgBox(0, "Edit Unit", "Unit number: " & $EditUnitNumber & " has been changed!") _GUICtrlListView_DeleteItem($ListView, $ListViewGetSelection) GUICtrlCreateListViewItem($EditUnitNumber & "|" & $EditUnitModelNumber & "|" & $EditUnitBatterySerial, $ListView) Else MsgBox(48, "Edit Part", "You have chosen to cancel the edit of the unit!") EndIf EndIf EndIf GUISetState(@SW_ENABLE, $ManageUnitsGUI) Sleep(100) WinActivate($ManageUnitsGUI) EndFunc ;==>_EditUnit Func _RemoveUnit() GUISetState(@SW_DISABLE, $ManageUnitsGUI) $ListViewGetSelection = _GUICtrlListView_GetSelectionMark($ListView) $GetUnitNumber = _GUICtrlListView_GetItem($ListView, $ListViewGetSelection, 0) If $GetUnitNumber[3] = "" Then MsgBox(48, "Error", "No unit was selected, cancelling operation!") Else $CheckMsgBox = MsgBox(4, "Remove Part", "Are you sure you wish to remove the following unit?" & @CRLF & @CRLF & $GetUnitNumber[3]) If $CheckMsgBox = 6 Then _GUICtrlListView_DeleteItem($ListView, $ListViewGetSelection) IniDelete($DatabasePath & "/Equipment Database.ini", "Equipment", $GetUnitNumber[3]) MsgBox(0, "Remove Unit", "The unit has been removed from the database!") Else MsgBox(48, "Remove Unit", "You have chosen to cancel the removal of the unit!") EndIf EndIf GUISetState(@SW_ENABLE, $ManageUnitsGUI) Sleep(100) WinActivate($ManageUnitsGUI) EndFunc ;==>_RemoveUnit Func _SearchParts() Dim $FoundEntries[1] $ReadPartLookupInput = GUICtrlRead($SearchPartsInput) $Found = 0 $SearchAll = 0 $ReadPartsData = IniReadSection($DatabasePath & "/Parts Database.ini", "Parts") If $ReadPartLookupInput = "all" Then $SearchAll = 1 _GUICtrlListView_DeleteAllItems($ListView) For $i = 1 To UBound($ReadPartsData) - 1 GUICtrlCreateListViewItem($ReadPartsData[$i][0] & "|" & $ReadPartsData[$i][1], $ListView) Next Else For $i = 1 To UBound($ReadPartsData) - 1 If StringInStr($ReadPartsData[$i][0], $ReadPartLookupInput) Then $PartInfo = $ReadPartsData[$i][0] & "|" & $ReadPartsData[$i][1] _ArrayInsert($FoundEntries, 0, $PartInfo, 0) $Found = 1 EndIf Next If $Found = 0 Then MsgBox(0, "Searching...", "No parts found matching that part number, searching part descriptions!") For $i = 1 To UBound($ReadPartsData) - 1 $SplitData = StringSplit($ReadPartsData[$i][1], "|") If StringInStr($SplitData[1], $ReadPartLookupInput) Then $PartInfo = $ReadPartsData[$i][0] & "|" & $ReadPartsData[$i][1] _ArrayInsert($FoundEntries, 0, $PartInfo, 0) $Found = 1 EndIf Next EndIf If $Found = 0 Then MsgBox(0, "Searching...", "No parts found matching that part description, searching product lines!") For $i = 1 To UBound($ReadPartsData) - 1 $SplitData = StringSplit($ReadPartsData[$i][1], "|") If StringInStr($SplitData[2], $ReadPartLookupInput) Then $PartInfo = $ReadPartsData[$i][0] & "|" & $ReadPartsData[$i][1] _ArrayInsert($FoundEntries, 0, $PartInfo, 0) $Found = 1 EndIf Next EndIf If $Found = 0 Then MsgBox(0, "Searching...", "No parts found matching that product line, searching part bin numbers!") For $i = 1 To UBound($ReadPartsData) - 1 $SplitData = StringSplit($ReadPartsData[$i][1], "|") If StringInStr($SplitData[3], $ReadPartLookupInput) Then $PartInfo = $ReadPartsData[$i][0] & "|" & $ReadPartsData[$i][1] _ArrayInsert($FoundEntries, 0, $PartInfo, 0) $Found = 1 EndIf Next EndIf If $Found = 0 Then MsgBox(48, "Error", "No parts found matching your input in the database!") Else _ArrayInsert($FoundEntries, 0, "RDaughertyPlaceHolder") _GUICtrlListView_DeleteAllItems($ListView) For $i = 1 To UBound($FoundEntries) - 1 For $a = 1 To UBound($ReadPartsData) - 1 If StringInStr($FoundEntries[$i], $ReadPartsData[$a][0]) Then GUICtrlCreateListViewItem($FoundEntries[$i] & "|" & $ReadPartsData[$a][1], $ListView) EndIf Next Next EndIf EndIf GUICtrlSetData($SearchPartsInput, "") EndFunc ;==>_SearchParts Func _SearchEquipment() Dim $FoundEntries[1] $ReadUnitNumberInput = GUICtrlRead($SearchEquipmentInput) $Found = 0 $SearchAll = 0 $ReadUnitsData = IniReadSection($DatabasePath & "/Equipment Database.ini", "Equipment") If $ReadUnitNumberInput = "all" Then $SearchAll = 1 _GUICtrlListView_DeleteAllItems($ListView) For $i = 1 To UBound($ReadUnitsData) - 1 GUICtrlCreateListViewItem($ReadUnitsData[$i][0] & "|" & $ReadUnitsData[$i][1], $ListView) Next Else For $i = 1 To UBound($ReadUnitsData) - 1 If StringInStr($ReadUnitsData[$i][0], $ReadUnitNumberInput) Then $UnitsInfo = $ReadUnitsData[$i][0] & "|" & $ReadUnitsData[$i][1] _ArrayInsert($FoundEntries, 0, $UnitsInfo, 0) $Found = 1 EndIf Next If $Found = 0 Then MsgBox(0, "Searching...", "No units found matching that number, searching model numbers!") For $i = 1 To UBound($ReadUnitsData) - 1 $SplitData = StringSplit($ReadUnitsData[$i][1], "|") If StringInStr($SplitData[1], $ReadUnitNumberInput) Then $UnitsInfo = $ReadUnitsData[$i][0] & "|" & $ReadUnitsData[$i][1] _ArrayInsert($FoundEntries, 0, $UnitsInfo, 0) $Found = 1 EndIf Next EndIf If $Found = 0 Then MsgBox(0, "Searching...", "No units found matching that model number, searching serial numbers!") For $i = 1 To UBound($ReadUnitsData) - 1 $SplitData = StringSplit($ReadUnitsData[$i][1], "|") If StringInStr($SplitData[2], $ReadUnitNumberInput) Then $UnitsInfo = $ReadUnitsData[$i][0] & "|" & $ReadUnitsData[$i][1] _ArrayInsert($FoundEntries, 0, $UnitsInfo, 0) $Found = 1 EndIf Next EndIf If $Found = 0 Then MsgBox(48, "Error", "No units, model numbers or serial numbers found matching that search criteria!") Else _ArrayInsert($FoundEntries, 0, "RDaughertyPlaceHolder") _GUICtrlListView_DeleteAllItems($ListView) For $i = 1 To UBound($FoundEntries) - 1 For $a = 1 To UBound($ReadUnitsData) - 1 If StringInStr($FoundEntries[$i], $ReadUnitsData[$a][0]) Then GUICtrlCreateListViewItem($FoundEntries[$i] & "|" & $ReadUnitsData[$a][1], $ListView) EndIf Next Next EndIf EndIf GUICtrlSetData($SearchEquipmentInput, "") EndFunc ;==>_SearchEquipment Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndListView = $ListView If Not IsHWnd($ListView) Then $hWndListView = GUICtrlGetHandle($ListView) Local $tNMHDR = DllStructCreate($tagNMLISTVIEW, $lParam) Local $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) Local $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $LVN_COLUMNCLICK ; A column was clicked _GUICtrlListView_SimpleSort($hWndListView, $g_bSortSense, DllStructGetData($tNMHDR, "SubItem")) ; Sort direction for next sort toggled by default EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_WM_NOTIFY
SearchWorkOrdersModule
Global $Found, $ReadSerialNumberInput, $FoundCount = 0, $WorkOrdersGUI, $MainGUI, $DatabasePath, $SerialNumberInput, $SearchOrdersInput Global $SearchAll = 0, $ListView, $ViewWorkOrdersGUI, $MainGUI Global $g_bSortSense = True Dim $FoundEntries[1][4] Func _CreateWorkOrdersGui() Dim $FoundEntries[1] $Found = 0 $FoundCount = 0 $SearchAll = 0 $DatabasePath = FileSelectFolder("Select Folder...", @MyDocumentsDir) If $DatabasePath = "" Then MsgBox(48, "Error", "No database selected, cancelling operation!") Else GUISetState(@SW_DISABLE, $MainGUI) $CurrentGUI = "View Work Orders" $ViewWorkOrdersGUI = GUICreate("Work Orders", 600, 660) GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseGUI") GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Search Orders", 12, 20, 150, 40) GUICtrlSetFont(-1, 16) $SearchOrdersInput = GUICtrlCreateInput("", 160, 18, 250, 30) GUICtrlSetFont(-1, 16) $SearchOrdersButton = GUICtrlCreateButton("Search", 470, 5, 100, 50) GUICtrlSetOnEvent(-1, "_SearchWorkOrders") GUICtrlSetFont(-1, 16) $ListView = GUICtrlCreateListView("Work Orders", 10, 60, 580, 500, $LVS_SORTASCENDING) _GUICtrlListView_SetColumnWidth(-1, 0, 575) $ReadWorkOrders = _FileListToArray($DatabasePath, Default, 1) For $i = 1 To UBound($ReadWorkOrders) - 1 $SplitData = StringSplit($ReadWorkOrders[$i], ".") GUICtrlCreateListViewItem($SplitData[1], $ListView) Next $ViewWorkOrderButton = GUICtrlCreateButton("View", 60, 590, 220, 40) GUICtrlSetOnEvent(-1, "_ViewWorkOrder") GUICtrlSetFont(-1, 16) $CloseButton = GUICtrlCreateButton("Close", 320, 590, 220, 40) GUICtrlSetOnEvent(-1, "_CloseGUI") GUICtrlSetFont(-1, 16) GUISetState() EndIf EndFunc ;==>_CreateWorkOrdersGui Func _SearchWorkOrders() $SearchAll = 0 $Found = 0 Dim $FoundEntries[1] $ReadWorkOrderInput = GUICtrlRead($SearchOrdersInput) $ReadWorkOrders = _FileListToArray($DatabasePath, Default, 1) If $ReadWorkOrderInput = "all" Then $SearchAll = 1 _GUICtrlListView_DeleteAllItems($ListView) For $i = 1 To UBound($ReadWorkOrders) - 1 $SplitData = StringSplit($ReadWorkOrders[$i], ".") GUICtrlCreateListViewItem($SplitData[1], $ListView) Next Else For $i = 1 To UBound($ReadWorkOrders) - 1 $SplitData = StringSplit($ReadWorkOrders[$i], ".") If StringInStr($SplitData[1], $ReadWorkOrderInput) Then _ArrayInsert($FoundEntries, 0, $SplitData[1], 0) $Found = 1 $FoundCount += 1 EndIf Next If $Found = 0 Then MsgBox(48, "Error", "No work orders found with those search criterias!") Else _ArrayInsert($FoundEntries, 0, $FoundCount) _GUICtrlListView_DeleteAllItems($ListView) $ReadWorkOrders = _FileListToArray($DatabasePath, Default, 1) For $i = 1 To UBound($FoundEntries) - 1 For $a = 1 To UBound($ReadWorkOrders) - 1 $SplitData = StringSplit($ReadWorkOrders[$a], ".") If StringInStr($FoundEntries[$i], $SplitData[1]) Then GUICtrlCreateListViewItem($SplitData[1], $ListView) EndIf Next Next EndIf EndIf GUICtrlSetData($SearchOrdersInput, "") EndFunc ;==>_SearchWorkOrders Func _ViewWorkOrder() $ListViewGetSelection = _GUICtrlListView_GetSelectionMark($ListView) $GetSelectionInfo = _GUICtrlListView_GetItem($ListView, $ListViewGetSelection, 0) $ReadWorkOrders = _FileListToArray($DatabasePath & "\" & $ReadSerialNumberInput, Default, 1) For $i = 1 To UBound($ReadWorkOrders) - 1 If StringInStr($ReadWorkOrders[$i], $GetSelectionInfo[3]) Then ShellExecute($DatabasePath & "\" & $ReadSerialNumberInput & "\" & $ReadWorkOrders[$i]) EndIf Next EndFunc ;==>_ViewWorkOrder
-
Damein got a reaction from Skysnake in Using Cmd to launch website via Edge
Ah, that would do it. Thanks @Danyfirex and thanks @Xandy for the attempts.
As a side note, it turns out that you cannot manually run Edge by trying to run the .exe via Windows Explorer, they don't allow it. Weird. You have to create a shortcut linking to it to be able to execute it in any fashion other than the Taskbar/Start Menu.
%windir%\explorer.exe shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge
Funky!
-
Damein got a reaction from Xandy in Using Cmd to launch website via Edge
Ah, that would do it. Thanks @Danyfirex and thanks @Xandy for the attempts.
As a side note, it turns out that you cannot manually run Edge by trying to run the .exe via Windows Explorer, they don't allow it. Weird. You have to create a shortcut linking to it to be able to execute it in any fashion other than the Taskbar/Start Menu.
%windir%\explorer.exe shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge
Funky!
-
Damein got a reaction from argumentum in AutoIt Game: RSS Aim Training
@argumentum - Reuploaded as a ZIP. Thanks.
@mLipok - Thanks and I'll add that!
-
Damein got a reaction from mLipok in AutoIt Game: RSS Aim Training
Simply put, its a game to help your mouse accuracy ect.
Downloads Page Link: Link
Two main modes at the moment:
Classic Mode - Must hit 120 targets in 3:00. Difficulty goes up at 30 targets hit and 80 targets hit (Target gets smaller). Twitch Mode - Hit as many targets as you can without missing 6 times.
Each mode can be played at 4 different difficulties.
Easy Difficulty - You have 1.8seconds to hit target (Counts as a miss) Medium Difficulty - You have 1second to hit target (Counts as a miss) Hard Difficulty - You have .8seconds to hit target (Counts as a miss) Expert Difficulty - You have .6seconds to hit target (Counts as a miss)
Each one has its own results screen and tracks your best results in each game. Show's Hit/Miss/Total Targets/Accuracy
Images
MainGUI: (Selecting a difficulty write to your settings and will default to that always)
Classic Mode:
Classic Mode Miss / Last "Level" (Smallest target):
Classic Mode Results / Win (Loss has a red X in stead of a green checkmark):
Twitch Mode Results:
Records:
And there we have it!
Downloads:
GitHub: GitHub Download
Sources (You'll need images/sounds so to play the game download the .RAR from the GitHub)
Source.au3
DefaultGameModule.au3
TwitchGameModule.au3
-
-
Damein got a reaction from JohnOne in RSS Movie Database
I created one of these awhile back but decided I could do a little better and wrote this up. I think it came out quite nicely myself!
YouTube Demo:
GitHub: https://github.com/Tf2Prophete/RSS-Movie-Database
Screenshots
Main GUI
Movie Info
Add Movie GUI
Source:
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Imgs\Icon.ico #AutoIt3Wrapper_Compression=0 #AutoIt3Wrapper_Res_Fileversion=2.1.0.0 #AutoIt3Wrapper_Res_LegalCopyright=R.S.S. #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <File.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <Timers.au3> #include <TrayConstants.au3> #include <ButtonConstants.au3> #include ".\Skins\Cosmo.au3" #include "_UskinLibrary.au3" _Uskin_LoadDLL() _USkin_Init(_Cosmo(True)) Opt("GUIOnEventMode", 1) Opt("TrayMenuMode", 3) Opt("TrayOnEventMode", 1) Global $CurrentGui, $AZTreeView, $InputMovieDescription = 0, $InputMovieGenre = 0, $InputMovieTitle = 0, $Stop = 0, $CheckMovieAddition = 0 Global $MainGui, $CurrentListSelection, $OldListSelection, $Msg, $StartTimer, $DefaultButton, $CurrentMovieDescription, $CurrentMovieGenre, $CurrentMovieWatchCount Global $CurrentMovieTitle, $MovieDataGui, $GenericPicture, $MoviePicture, $CheckPicture, $CurrentMoviePictureCheck, $DisplayMovieTitle, $CheckFavorite Global $FavoritesList, $CurrentMovieFavoriteCheck, $NumberList, $CurrentMovieGenreDisplay, $CurrentMovieTitleDisplay, $CurrentMovieDescriptionDisplay Global $CurrentMovieFavoriteDisplay, $CurrentMoviePictureDisplay, $EditButton, $SaveButton, $TrimTitleForSelection, $MovieButton Global $MoviePictureYesRadio, $MoviePictureNoRadio, $MovieFavoriteYesRadio, $MovieFavoriteNoRadio, $EditMoviePicture = "0", $EditMovieFavorite = "0" Dim $Alphabet[27] = [26, "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"] Dim $AZList[27] $CheckFirstRun = IniRead(@ScriptDir & "/Data/Settings.ini", "Settings", "FirstRun", "NA") If $CheckFirstRun = 0 Then MsgBox(48, "Warning", "Please be aware, to get the images for movies to work properly you will need to save them as .jpg and will also need to name them the same as you did the movie title!") MsgBox(0, "Note", "If you wish to see this message again you may go into the Settings.ini file in the Data folder and change the 1 to a 0") IniWrite(@ScriptDir & "/Data/Settings.ini", "Settings", "FirstRun", "1") EndIf TrayCreateItem("Exit...") TrayItemSetOnEvent(-1, "_CloseProgram") TrayCreateItem("Refresh Database...") TrayItemSetOnEvent(-1, "_UpdateDatabase") _ReCreateMainGui() _UpdateDatabase() Func _ReCreateMainGui() $CurrentGui = "Main" $MainGui = GUICreate("Movie Database - RSSoftware", 800, 600) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUICtrlCreateLabel("© RS Software", 730, 575, 200) GUICtrlSetFont(-1, 8) GUICtrlCreateLabel("Version 2.1", 738, 585, 200) GUICtrlSetFont(-1, 8) $AZTreeView = GUICtrlCreateTreeView(5, 80, 200, 515, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) $FavoritesList = GUICtrlCreateTreeViewItem("Favorites", $AZTreeView) $NumberList = GUICtrlCreateTreeViewItem("#", $AZTreeView) For $i = 1 To $Alphabet[0] $AZList[$i] = GUICtrlCreateTreeViewItem($Alphabet[$i], $AZTreeView) Next $AddMovieButton = GUICtrlCreateButton("Add Movie", 20, 10, 200, 50) GUICtrlSetOnEvent(-1, "_AddMovie") GUICtrlSetFont(-1, 16) $OptionsButton = GUICtrlCreateButton("Refresh Database", 580, 10, 200, 50) GUICtrlSetOnEvent(-1, "_UpdateDatabase") GUICtrlSetFont(-1, 16) $RemoveMovieButton = GUICtrlCreateButton("Remove Movie", 300, 10, 200, 50) GUICtrlSetOnEvent(-1, "_RemoveMovie") GUICtrlSetFont(-1, 16) $GenericPicture = GUICtrlCreatePic(@ScriptDir & "/Imgs/DefaultImg.jpg", 385, 160, 250, 300) $MoviePicture = GUICtrlCreatePic(@ScriptDir & "/Imgs/DefaultImg.jpg", 385, 160, 250, 300) $DefaultButton = GUICtrlCreateButton("Movie Information", 360, 500, 300, 80) GUICtrlSetOnEvent(-1, "_DefaultButton") GUICtrlSetFont(-1, 22) GUICtrlSetState($AZList[1], $GUI_FOCUS) $DisplayMovieTitle = GUICtrlCreateInput("", 220, 95, 570, 40, BitOR($ES_ReadOnly, $ES_Center)) GUICtrlSetFont(-1, 22) GUICtrlSetColor(-1, 0x00CCFF) GUISetState(@SW_SHOW) EndFunc ;==>_ReCreateMainGui Func _DefaultButton() MsgBox(0, "Hello!", "Please select a movie to see the movie information! Or add a movie if you haven't yet!") EndFunc ;==>_DefaultButton Func _GetMovieData() $GetTitleLength = StringLen($CurrentListSelection) $TrimTitleForSelection = StringTrimRight($CurrentListSelection, $GetTitleLength - 1) If StringIsDigit($TrimTitleForSelection) Then $MovieData = IniReadSection(@ScriptDir & "/Data/# List/" & $CurrentListSelection & ".ini", $CurrentListSelection) EndIf If StringIsAlpha($TrimTitleForSelection) Then $MovieData = IniReadSection(@ScriptDir & "/Data/AZList/" & $TrimTitleForSelection & "/" & $CurrentListSelection & ".ini", $CurrentListSelection) EndIf $CurrentMovieTitle = $CurrentListSelection $CurrentMovieGenre = $MovieData[1][1] $CurrentMovieDescription = $MovieData[2][1] $CurrentMoviePictureCheck = $MovieData[3][1] $CurrentMovieFavoriteCheck = $MovieData[4][1] If $MovieData[3][1] = 1 Then If FileExists(@ScriptDir & "/Imgs/" & $CurrentListSelection & ".jpg") Then GUICtrlDelete($MoviePicture) GUICtrlSetState($GenericPicture, $GUI_HIDE) $MoviePicture = GUICtrlCreatePic(@ScriptDir & "/Imgs/" & $CurrentListSelection & ".jpg", 385, 160, 250, 300) GUICtrlSetState($MoviePicture, $GUI_SHOW) Else GUICtrlSetState($MoviePicture, $GUI_HIDE) GUICtrlSetState($GenericPicture, $GUI_SHOW) EndIf Else GUICtrlSetState($MoviePicture, $GUI_HIDE) GUICtrlSetState($GenericPicture, $GUI_SHOW) EndIf GUICtrlDelete($DefaultButton) GUICtrlDelete($MovieButton) $MovieButton = GUICtrlCreateButton("Movie Information", 360, 500, 300, 80) GUICtrlSetOnEvent(-1, "_ReadMovieData") GUICtrlSetFont(-1, 22) GUICtrlSetData($DisplayMovieTitle, $CurrentMovieTitle) EndFunc ;==>_GetMovieData Func _ReadMovieData() GUISetState(@SW_DISABLE, $MainGui) $CurrentGui = "MovieDataGui" $MovieDataGui = GUICreate($CurrentMovieTitle, 400, 520) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUICtrlCreateLabel("Movie Title", 150, 10, 200) GUICtrlSetFont(-1, 16) GUICtrlSetColor(-1, 0xFFFFFF) $CurrentMovieTitleDisplay = GUICtrlCreateInput($CurrentMovieTitle, 10, 40, 380, 30, BitOR($ES_Center, $ES_ReadOnly)) GUICtrlSetFont(-1, 12) GUICtrlSetColor(-1, 0x00CCFF) GUICtrlCreateLabel("Movie Genre", 140, 90, 200) GUICtrlSetFont(-1, 16) GUICtrlSetColor(-1, 0xFFFFFF) $CurrentMovieGenreDisplay = GUICtrlCreateInput($CurrentMovieGenre, 10, 120, 380, 30, BitOR($ES_Center, $ES_ReadOnly)) GUICtrlSetFont(-1, 12) GUICtrlSetColor(-1, 0x00CCFF) GUICtrlCreateLabel("Movie Picture", 140, 170, 200) GUICtrlSetFont(-1, 16) GUICtrlSetColor(-1, 0xFFFFFF) GUIStartGroup() $MoviePictureYesRadio = GUICtrlCreateRadio("Yes", 145, 210, 60, 20, $BS_Center) GUICtrlSetFont(-1, 14) GUICtrlSetState($MoviePictureYesRadio, $GUI_HIDE) GUICtrlSetOnEvent(-1, "_YesPicture") $MoviePictureNoRadio = GUICtrlCreateRadio("No", 215, 210, 60, 20, $BS_Center) GUICtrlSetFont(-1, 14) GUICtrlSetState($MoviePictureNoRadio, $GUI_HIDE) GUICtrlSetOnEvent(-1, "_NoPicture") If $CurrentMoviePictureCheck = 1 Then $DisplayPicture = "Yes" $EditMoviePicture = "1" GUICtrlSetState($MoviePictureYesRadio, $GUI_CHECKED) Else $DisplayPicture = "No" $EditMoviePicture = "0" GUICtrlSetState($MoviePictureNoRadio, $GUI_CHECKED) EndIf $CurrentMoviePictureDisplay = GUICtrlCreateInput($DisplayPicture, 10, 200, 380, 30, BitOR($ES_Center, $ES_ReadOnly)) GUICtrlSetFont(-1, 12) GUICtrlSetColor(-1, 0x00CCFF) GUICtrlCreateLabel("Movie Favorited", 125, 250, 200) GUICtrlSetFont(-1, 16) GUICtrlSetColor(-1, 0xFFFFFF) GUIStartGroup() $MovieFavoriteYesRadio = GUICtrlCreateRadio("Yes", 145, 290, 60, 20, $BS_Center) GUICtrlSetFont(-1, 14) GUICtrlSetState($MovieFavoriteYesRadio, $GUI_HIDE) GUICtrlSetOnEvent(-1, "_YesFavorite") $MovieFavoriteNoRadio = GUICtrlCreateRadio("No", 215, 290, 60, 20, $BS_Center) GUICtrlSetFont(-1, 14) GUICtrlSetState($MovieFavoriteNoRadio, $GUI_HIDE) GUICtrlSetOnEvent(-1, "_NoFavorite") If $CurrentMovieFavoriteCheck = 1 Then $EditMovieFavorite = "1" $DisplayFavorite = "Yes" GUICtrlSetState($MovieFavoriteYesRadio, $GUI_CHECKED) Else $DisplayFavorite = "No" $EditMovieFavorite = "0" GUICtrlSetState($MovieFavoriteNoRadio, $GUI_CHECKED) EndIf $CurrentMovieFavoriteDisplay = GUICtrlCreateInput($DisplayFavorite, 10, 280, 380, 30, BitOR($ES_Center, $ES_ReadOnly)) GUICtrlSetFont(-1, 12) GUICtrlSetColor(-1, 0x00CCFF) GUICtrlCreateLabel("Movie Description", 120, 330, 200) GUICtrlSetFont(-1, 16) GUICtrlSetColor(-1, 0xFFFFFF) $CurrentMovieDescriptionDisplay = GUICtrlCreateEdit($CurrentMovieDescription, 10, 360, 380, 100, BitOR($ES_Center, $ES_ReadOnly)) GUICtrlSetFont(-1, 12) GUICtrlSetColor(-1, 0x00CCFF) $EditButton = GUICtrlCreateButton("Edit Movie", 10, 470, 180, 50) GUICtrlSetOnEvent(-1, "_EditMovie") GUICtrlSetFont(-1, 16) $SaveButton = GUICtrlCreateButton("Save Movie", 10, 470, 180, 50) GUICtrlSetOnEvent(-1, "_SaveMovie") GUICtrlSetFont(-1, 16) GUICtrlSetState(-1, $GUI_HIDE) $CloseButton = GUICtrlCreateButton("Close", 210, 470, 180, 50) GUICtrlSetOnEvent(-1, "_Exit") GUICtrlSetFont(-1, 16) GUISetState() EndFunc ;==>_ReadMovieData Func _YesPicture() $EditMoviePicture = "1" EndFunc ;==>_YesPicture Func _NoPicture() $EditMoviePicture = "0" EndFunc ;==>_NoPicture Func _YesFavorite() $EditMovieFavorite = "1" EndFunc ;==>_YesFavorite Func _NoFavorite() $EditMovieFavorite = "0" EndFunc ;==>_NoFavorite Func _EditMovie() GUICtrlSetState($EditButton, $GUI_HIDE) GUICtrlSetState($SaveButton, $GUI_SHOW) GUICtrlSetStyle($CurrentMovieGenreDisplay, $GUI_SS_DEFAULT_INPUT) GUICtrlSetStyle($CurrentMovieGenreDisplay, $ES_CENTER) GUICtrlSetColor($CurrentMovieGenreDisplay, 0xfb0000) GUICtrlSetStyle($CurrentMovieDescriptionDisplay, $GUI_SS_DEFAULT_INPUT) GUICtrlSetStyle($CurrentMovieDescriptionDisplay, $ES_CENTER) GUICtrlSetColor($CurrentMovieDescriptionDisplay, 0xfb0000) GUICtrlSetState($CurrentMoviePictureDisplay, $GUI_HIDE) GUICtrlSetState($CurrentMovieFavoriteDisplay, $GUI_HIDE) GUICtrlSetState($MoviePictureYesRadio, $GUI_SHOW) GUICtrlSetState($MoviePictureNoRadio, $GUI_SHOW) GUICtrlSetState($MovieFavoriteYesRadio, $GUI_SHOW) GUICtrlSetState($MovieFavoriteNoRadio, $GUI_SHOW) EndFunc ;==>_EditMovie Func _SaveMovie() $EditMovieGenre = GUICtrlRead($CurrentMovieGenreDisplay) $EditMovieDescription = GUICtrlRead($CurrentMovieDescriptionDisplay) If StringIsDigit($TrimTitleForSelection) Then IniWrite(@ScriptDir & "/Data/# List/" & $CurrentMovieTitle & ".ini", $CurrentMovieTitle, "Genre", $EditMovieGenre) IniWrite(@ScriptDir & "/Data/# List/" & $CurrentMovieTitle & ".ini", $CurrentMovieTitle, "Description", $EditMovieDescription) IniWrite(@ScriptDir & "/Data/# List/" & $CurrentMovieTitle & ".ini", $CurrentMovieTitle, "Picture", $EditMoviePicture) IniWrite(@ScriptDir & "/Data/# List/" & $CurrentMovieTitle & ".ini", $CurrentMovieTitle, "Favorite", $EditMovieFavorite) EndIf If StringIsAlpha($TrimTitleForSelection) Then IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForSelection & "/" & $CurrentMovieTitle & ".ini", $CurrentMovieTitle, "Genre", $EditMovieGenre) IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForSelection & "/" & $CurrentMovieTitle & ".ini", $CurrentMovieTitle, "Description", $EditMovieDescription) IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForSelection & "/" & $CurrentMovieTitle & ".ini", $CurrentMovieTitle, "Picture", $EditMoviePicture) IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForSelection & "/" & $CurrentMovieTitle & ".ini", $CurrentMovieTitle, "Favorite", $EditMovieFavorite) EndIf If $EditMovieFavorite = 1 Then If StringIsDigit($TrimTitleForSelection) Then FileCopy(@ScriptDir & "/Data/# List/" & $CurrentMovieTitle & ".ini", @ScriptDir & "/Data/Favorites/" & $CurrentMovieTitle & ".ini", 1) Else FileCopy(@ScriptDir & "/Data/AZList/" & $TrimTitleForSelection & "/" & $CurrentMovieTitle & ".ini", @ScriptDir & "/Data/Favorites/" & $CurrentMovieTitle & ".ini", 1) EndIf Else FileDelete(@ScriptDir & "/Data/Favorites/" & $CurrentMovieTitle & ".ini") EndIf GUIDelete($MovieDataGui) GUISetState(@SW_ENABLE, $MainGui) _UpdateDatabase() EndFunc ;==>_SaveMovie Func _AddMovie() GUISetState(@SW_DISABLE, $MainGui) $CurrentGui = "MovieDataGui" $MovieDataGui = GUICreate("Add NewMovie", 400, 520) GUICtrlCreateLabel("Movie Title", 150, 10, 200) GUICtrlSetFont(-1, 16) GUICtrlSetColor(-1, 0xFFFFFF) $CurrentMovieTitleDisplay = GUICtrlCreateInput("", 10, 40, 380, 30, $ES_CENTER) GUICtrlSetFont(-1, 12) GUICtrlSetColor(-1, 0x00CCFF) GUICtrlSetColor($CurrentMovieTitleDisplay, 0xfb0000) GUICtrlCreateLabel("Movie Genre", 140, 90, 200) GUICtrlSetFont(-1, 16) GUICtrlSetColor(-1, 0xFFFFFF) $CurrentMovieGenreDisplay = GUICtrlCreateInput("", 10, 120, 380, 30, $ES_Center) GUICtrlSetFont(-1, 12) GUICtrlSetColor(-1, 0x00CCFF) GUICtrlSetColor($CurrentMovieGenreDisplay, 0xfb0000) GUICtrlCreateLabel("Movie Picture", 140, 170, 200) GUICtrlSetFont(-1, 16) GUICtrlSetColor(-1, 0xFFFFFF) GUIStartGroup() $MoviePictureYesRadio = GUICtrlCreateRadio("Yes", 145, 210, 60, 20, $BS_Center) GUICtrlSetFont(-1, 14) GUICtrlSetOnEvent(-1, "_YesPicture") $MoviePictureNoRadio = GUICtrlCreateRadio("No", 215, 210, 60, 20, $BS_Center) GUICtrlSetFont(-1, 14) GUICtrlSetOnEvent(-1, "_NoPicture") If $CurrentMoviePictureCheck = 1 Then $DisplayPicture = "Yes" $EditMoviePicture = "1" GUICtrlSetState($MoviePictureYesRadio, $GUI_CHECKED) Else $DisplayPicture = "No" $EditMoviePicture = "0" GUICtrlSetState($MoviePictureNoRadio, $GUI_CHECKED) EndIf GUICtrlCreateLabel("Movie Favorited", 125, 250, 200) GUICtrlSetFont(-1, 16) GUICtrlSetColor(-1, 0xFFFFFF) GUIStartGroup() $MovieFavoriteYesRadio = GUICtrlCreateRadio("Yes", 145, 290, 60, 20, $BS_Center) GUICtrlSetFont(-1, 14) GUICtrlSetOnEvent(-1, "_YesFavorite") $MovieFavoriteNoRadio = GUICtrlCreateRadio("No", 215, 290, 60, 20, $BS_Center) GUICtrlSetFont(-1, 14) GUICtrlSetOnEvent(-1, "_NoFavorite") If $CurrentMovieFavoriteCheck = 1 Then $EditMovieFavorite = "1" $DisplayFavorite = "Yes" GUICtrlSetState($MovieFavoriteYesRadio, $GUI_CHECKED) Else $DisplayFavorite = "No" $EditMovieFavorite = "0" GUICtrlSetState($MovieFavoriteNoRadio, $GUI_CHECKED) EndIf GUICtrlCreateLabel("Movie Description", 120, 330, 200) GUICtrlSetFont(-1, 16) GUICtrlSetColor(-1, 0xFFFFFF) $CurrentMovieDescriptionDisplay = GUICtrlCreateEdit("", 10, 360, 380, 100, $ES_Center) GUICtrlSetFont(-1, 12) GUICtrlSetColor(-1, 0x00CCFF) GUICtrlSetColor($CurrentMovieDescriptionDisplay, 0xfb0000) $AddMovieFinishedButton = GUICtrlCreateButton("Add Movie", 10, 470, 180, 50) GUICtrlSetOnEvent(-1, "_AddMovieFinished") GUICtrlSetFont(-1, 16) $CloseButton = GUICtrlCreateButton("Cancel", 210, 470, 180, 50) GUICtrlSetOnEvent(-1, "_CancelAddMovie") GUICtrlSetFont(-1, 16) GUISetState() EndFunc ;==>_AddMovie Func _CancelAddMovie() MsgBox(48, "Cancel", "Addition of movie has been cancelled!") $Stop = 0 $InputMovieDescription = 0 $InputMovieGenre = 0 $InputMovieTitle = 0 $CheckMovieAddition = 0 $CheckPicture = 0 $CheckFavorite = 0 GUISetState(@SW_ENABLE, $MainGui) $CurrentGui = "Main" GUIDelete($MovieDataGui) EndFunc ;==>_CancelAddMovie Func _AddMovieFinished() $InputMovieGenre = GUICtrlRead($CurrentMovieGenreDisplay) $InputMovieDescription = GUICtrlRead($CurrentMovieDescriptionDisplay) $InputMovieTitle = GUICtrlRead($CurrentMovieTitleDisplay) If $InputMovieGenre = "" Then $Stop = 1 MsgBox(48, "Error", "You must input a genre to continue!") EndIf If $InputMovieDescription = "" Then $Stop = 1 MsgBox(48, "Error", "You must input a movie description to continue!") EndIf If $InputMovieTitle = "" Then $Stop = 1 MsgBox(48, "Error", "You must input a movie title to continue!") EndIf If $Stop = 0 Then $GetTitleLength = StringLen($InputMovieTitle) $TrimTitleForAZList = StringTrimRight($InputMovieTitle, $GetTitleLength - 1) If StringIsDigit($TrimTitleForAZList) Then IniWrite(@ScriptDir & "/Data/# List/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Genre", $InputMovieGenre) IniWrite(@ScriptDir & "/Data/# List/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Description", $InputMovieDescription) IniWrite(@ScriptDir & "/Data/# List/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Picture", $EditMoviePicture) IniWrite(@ScriptDir & "/Data/# List/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Favorite", $EditMovieFavorite) Else $CheckIfDirExists = DirGetSize(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList) If @error Then DirCreate(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList) IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Genre", $InputMovieGenre) IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Description", $InputMovieDescription) IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Picture", $EditMoviePicture) IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Favorite", $EditMovieFavorite) Else IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Genre", $InputMovieGenre) IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Description", $InputMovieDescription) IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Picture", $EditMoviePicture) IniWrite(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieTitle & ".ini", $InputMovieTitle, "Favorite", $EditMovieFavorite) EndIf EndIf If $EditMovieFavorite = 1 Then If StringIsDigit($TrimTitleForAZList) Then FileCopy(@ScriptDir & "/Data/# List/" & $InputMovieTitle & ".ini", @ScriptDir & "/Data/Favorites/" & $InputMovieTitle & ".ini", 1) Else FileCopy(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieTitle & ".ini", @ScriptDir & "/Data/Favorites/" & $InputMovieTitle & ".ini", 1) EndIf EndIf MsgBox(0, "Movie Added", "Movie " & $InputMovieTitle & " has been added!") $Stop = 0 $InputMovieDescription = 0 $InputMovieGenre = 0 $InputMovieTitle = 0 $CheckMovieAddition = 0 $CheckPicture = 0 $EditMovieFavorite = 0 GUISetState(@SW_ENABLE, $MainGui) GUIDelete($MovieDataGui) EndIf EndFunc ;==>_AddMovieFinished Func _RemoveMovie() $InputMovieToRemove = InputBox("Remove Movie", "Please input the name of the movie you wish to remove.") If @error = 1 Then MsgBox(48, "Cancelled", "Cancel was pushed, cancelling removal of movie!") EndIf If $InputMovieToRemove = "" Then MsgBox(48, "Cancelled", "No movie name input, cancelling removal of movie!") Else $GetTitleLength = StringLen($InputMovieToRemove) $TrimTitleForAZList = StringTrimRight($InputMovieToRemove, $GetTitleLength - 1) If StringIsDigit($TrimTitleForAZList) Then $CheckForIni = IniRead(@ScriptDir & "/Data/# List/" & $InputMovieToRemove & ".ini", $InputMovieToRemove, "Genre", "NA") If $CheckForIni = "NA" Then MsgBox(48, "Error", "Movie name not found, please try again!") Else $CheckDeletion = MsgBox(4, "Delete Movie", "Are you sure you wish to remove this movie?" & @CRLF & @CRLF & $InputMovieToRemove) If $CheckDeletion = 6 Then FileDelete(@ScriptDir & "/Data/# List/" & $InputMovieToRemove & ".ini") FileDelete(@ScriptDir & "/Data/Favorites/" & $InputMovieToRemove & ".ini") Else MsgBox(48, "Cancelled", "Cancelling removal of the movie!") EndIf EndIf Else $CheckIfDirExists = DirGetSize(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList) If @error Then MsgBox(48, "Error", "AZ Listing not found, please double check your input!") Else $CheckForIni = IniRead(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieToRemove & ".ini", $InputMovieToRemove, "Genre", "NA") If $CheckForIni = "NA" Then MsgBox(48, "Error", "Movie name not found, please try again!") Else $CheckDeletion = MsgBox(4, "Delete Movie", "Are you sure you wish to remove this movie?" & @CRLF & @CRLF & $InputMovieToRemove) If $CheckDeletion = 6 Then FileDelete(@ScriptDir & "/Data/AZList/" & $TrimTitleForAZList & "/" & $InputMovieToRemove & ".ini") FileDelete(@ScriptDir & "/Data/Favorites/" & $InputMovieToRemove & ".ini") Else MsgBox(48, "Cancelled", "Cancelling removal of the movie!") EndIf EndIf EndIf EndIf EndIf $InputMovieToRemove = "" GUISetState(@SW_ENABLE, $MainGui) _UpdateDatabase() EndFunc ;==>_RemoveMovie Func _UpdateDatabase() GUIDelete($MainGui) _ReCreateMainGui() $ReadAZListFolders = _FileListToArray(@ScriptDir & "/Data/AZList", Default, 2) If @error Then Sleep(10) Else For $a = 1 To $ReadAZListFolders[0] $ReadAZListFiles = _FileListToArray(@ScriptDir & "/Data/AZList/" & $ReadAZListFolders[$a], Default, 1) If @error Then Sleep(10) Else For $b = 1 To $ReadAZListFiles[0] For $c = 1 To 26 If $Alphabet[$c] = $ReadAZListFolders[$a] Then $AZListLetterToAdd = $c EndIf Next $TrimMovieTitleAZList = StringTrimRight($ReadAZListFiles[$b], 4) GUICtrlCreateTreeViewItem($TrimMovieTitleAZList, $AZList[$AZListLetterToAdd]) Next EndIf Next $ReadFavoritesFiles = _FileListToArray(@ScriptDir & "/Data/Favorites", Default, 1) If @error Then Sleep(10) Else For $d = 1 To $ReadFavoritesFiles[0] $TrimMovieTitleAZList = StringTrimRight($ReadFavoritesFiles[$d], 4) GUICtrlCreateTreeViewItem($TrimMovieTitleAZList, $FavoritesList) Next EndIf $ReadNumberFiles = _FileListToArray(@ScriptDir & "/Data/# List", Default, 1) If @error Then Sleep(10) Else For $d = 1 To $ReadNumberFiles[0] $TrimMovieTitleAZList = StringTrimRight($ReadNumberFiles[$d], 4) GUICtrlCreateTreeViewItem($TrimMovieTitleAZList, $NumberList) Next EndIf EndIf _WinAPI_RedrawWindow(GUICtrlGetHandle($AZTreeView)) EndFunc ;==>_UpdateDatabase Func _CloseProgram() Exit EndFunc ;==>_CloseProgram Func _Exit() If $CurrentGui = "Main" Then Exit EndIf If $CurrentGui = "MovieDataGui" Then GUIDelete($MovieDataGui) GUISetState(@SW_ENABLE, $MainGui) Sleep(100) $CurrentGui = "Main" WinActivate($MainGui) EndIf EndFunc ;==>_Exit While 1 $Msg = GUICtrlRead($AZTreeView, 1) $OldListSelection = $CurrentListSelection $CurrentListSelection = $Msg If $OldListSelection = $CurrentListSelection Then Sleep(10) Else If $CurrentListSelection = "Favorites" Then Sleep(10) Else $CheckStringLength = StringLen($CurrentListSelection) If $CheckStringLength > 1 Then _GetMovieData() EndIf EndIf EndIf Sleep(10) WEnd
-
Damein got a reaction from dynamitemedia in StreamHelper
Possibly, but I used the game logos to minimize the internet usage.
-
Damein got a reaction from dynamitemedia in StreamHelper
1:
I did not set the images, the images get downloaded only if the people you are following are playing that specific game.
That is included in the StreamHelper.au3 in this section starting on line 171
$FilePath = @ScriptDir & "/Imgs/" & $sGame & ".bmp" If FileExists(@ScriptDir & "/Imgs/ " & $sGame & ".bmp") Then Sleep(10) Else $ReplaceWS = StringReplace($sGame, " ", "%20") InetGet("http://static-cdn.jtvnw.net/ttv-boxart/" & $ReplaceWS & "-272x380.jpg", $FilePath) EndIf $ConjoinInfo = $sDisplayName & "|" & $sGame $StreamCount += 1
2:
As for the no images until you close / re-open I don't recall this happening and cannot test at the moment. Might be a bug that I didn't encounter, not sure.
3:
The file in question would be the StreamHelperGUI.au3
For the making the GUI larger, just simply adjust the Width & Height found on line 23. But know that if you do that you will have to adjust everything else too. If this is something you really want and aren't sure how to accomplish it let me know and I can adjust the script for you.
4:
Never used the word paginate before but if you are referring to how it aligns the images / decides how many to input that's done in a couple different ways.
Step 1: Found in StreamHelper.au3 on line 193 and 212 (Depending on an IF/Else statement) it adds +1 to a variable (GameCount) to determine how many different types of games are being played (IE: How many different images we need to produce)
Step 2: Found in StreamHelperGUI.au3 on line 34 is a For statement going from 0 to X depending on how many games we found in StreamHelper.au3.
It goes up +1 each time (Obviously) and then adds +250 to the X axis until it reaches 3 (Currently how many games are shown per row) and then resets the X axis to 40 (Starting Point) and sets a new Y axis to +320 to account for a new row. It then adds +300 to the variable X which is used to determine the length of the Scrollbar needed to view all of the images which is found on line 56 in StreamHelperGUI.au3 still.
Hope that clears it all up. If anything isn't clear let me know and I'll try to rephrase or anything.
-
Damein got a reaction from TheSaint in Set ListView label to fill entire box?
Ah, that is exactly what i needed (Obviously, lol) thanks a bunch. I couldn't think of the proper way to phrase the question nor a good search parameter so I just figured a topic would be the best way
Thanks!
-
Damein got a reaction from andrew2344441 in Various problems, will appreciate any help
I would advise you to check out the Help file since pretty much all your requests are pretty simple and could probably be found easily.
But lets get to some of it.
1: Why would you need to do this through AutoIt? Correct me if I'm wrong but can't you enable screen saver and click the box "On resume, display logon screen"
2: Not someone who has even changed language and stuff on windows so not sure, sorry.
3: This can be accomplished with HotKeySet (In help file) by setting a Hotkey to Win+Tab to anything it over rides default (So if nothing, just make it do a Sleep(100) )
4: Same as above ^ Just set the Hotkey to Send (In help file) the Winkey+Tab
5: _IEBodyReadHTML (In help file) will work out for you.
If you really need some help (I don't know if you have any experience or not) let me/people know and we will help!
-
Damein got a reaction from Guilherme Tocchetto in Duplicate cursor/Double Cursor
Not sure if its possible but maybe you can tell us what program you're manipulating so we have a clear idea if its feasible. Or possibly just use the Window Info to check the controls of the program and see if their accessible.
-
Damein got a reaction from Guilherme Tocchetto in Duplicate cursor/Double Cursor
I don't think that is possible but someone may know something I don't.
As for it using the cursor to do the tasks, are you sure that it needs to? If I may ask what is the cursor doing, I presume clicking things? Most applications you can use ControlSend or ControlClick even to achieve this.
-
Damein got a reaction from Bert in Catch an error and stop it from exiting
I'm sorry, I was asleep
No, nothing like that. It's for a card game made in AutoIt.
Here is the full code.
The game is called Tichu, a very fun game!
Card Module to give player's a new hand
#include <Array.au3> Func _CreateHands() Global $FoundCard = 0 Dim $Cards[57], $Card[57], $Player1Cards[0], $Player2Cards[0], $Player3Cards[0], $Player4Cards[0] For $i = 1 To 56 $Cards[$i] = "0" Next $Card[1] = "2C" $Card[2] = "2S" $Card[3] = "2D" $Card[4] = "2H" $Card[5] = "3C" $Card[6] = "3S" $Card[7] = "3D" $Card[8] = "3H" $Card[9] = "4C" $Card[10] = "4S" $Card[11] = "4D" $Card[12] = "4H" $Card[13] = "5C" $Card[14] = "5S" $Card[15] = "5D" $Card[16] = "5H" $Card[17] = "6C" $Card[18] = "6S" $Card[19] = "6D" $Card[20] = "6H" $Card[21] = "7C" $Card[22] = "7S" $Card[23] = "7D" $Card[24] = "7H" $Card[25] = "8C" $Card[26] = "8S" $Card[27] = "8D" $Card[28] = "8H" $Card[29] = "9C" $Card[30] = "9S" $Card[31] = "9D" $Card[32] = "9H" $Card[33] = "10C" $Card[34] = "10S" $Card[35] = "10D" $Card[36] = "10H" $Card[37] = "JC" $Card[38] = "JS" $Card[39] = "JD" $Card[40] = "JH" $Card[41] = "QC" $Card[42] = "QS" $Card[43] = "QD" $Card[44] = "QH" $Card[45] = "KC" $Card[46] = "KS" $Card[47] = "KD" $Card[48] = "KH" $Card[49] = "AC" $Card[50] = "AS" $Card[51] = "AD" $Card[52] = "AH" $Card[53] = "Dog" $Card[54] = "Dragon" $Card[55] = "Bird" $Card[56] = "Phoenix" While $FoundCard < 14 $Random = Random(1, 56, 1) If $Cards[$Random] = "0" Then _arrayAdd($Player1Cards, $Card[$Random]) $FoundCard += 1 $Cards[$Random] = "1" EndIf WEnd $FoundCard = 0 While $FoundCard < 14 $Random = Random(1, 56, 1) If $Cards[$Random] = "0" Then _arrayAdd($Player2Cards, $Card[$Random]) $FoundCard += 1 $Cards[$Random] = "1" EndIf WEnd $FoundCard = 0 While $FoundCard < 14 $Random = Random(1, 56, 1) If $Cards[$Random] = "0" Then _arrayAdd($Player3Cards, $Card[$Random]) $FoundCard += 1 $Cards[$Random] = "1" EndIf WEnd $FoundCard = 0 While $FoundCard < 14 $Random = Random(1, 56, 1) If $Cards[$Random] = "0" Then _arrayAdd($Player4Cards, $Card[$Random]) $FoundCard += 1 $Cards[$Random] = "1" EndIf WEnd EndFunc ;~ _ArrayDisplay($Player1Cards) ;~ _ArrayDisplay($Player2Cards) ;~ _ArrayDisplay($Player3Cards) ;~ _ArrayDisplay($Player4Cards) The current code that I have made up, haven't gotten very far.
#include <GUIConstantsEx.au3> #include <EditConstants.au3> #include ".\Skins\Hex.au3" #include "_UskinLibrary.au3" #include "Cards Module.au3" _Uskin_LoadDLL() _USkin_Init(_Hex(True)) Opt("GUIOnEventMode", 1) Global $Player1Cards, $Player2Cards, $Player3Cards, $Player4Cards Global $CurrentGui, $MainGui, $HandGui, $CardCount Dim $Player1Card[20], $Player1Cards[20] _DealCards() _CreateGui() Func _CreateGui() $CurrentGui = "MainGui" $MainGui = GuiCreate("Tichu", 800,500) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GuiSetFont(11) $DisplayTeamAName = GuiCtrlCreateInput("", 5,5,140,20, BitOr($ES_READONLY, $ES_Center)) $DisplayTeamAPoints = GuiCtrlCreateInput("0", 50, 30, 40,20, BitOr($ES_ReadOnly, $ES_Center)) $DisplayTeamBName = GuiCtrlCreateInput("", 655,5,140,20, BitOr($ES_READONLY, $ES_Center)) $DisplayTeamBPoints = GuiCtrlCreateInput("0", 705, 30, 40,20, BitOr($ES_ReadOnly, $ES_Center)) GuiCtrlCreateLabel("Player 1:", 0, 380) GuiCtrlCreateLabel("Player 2:", 0, 410) GuiCtrlCreateLabel("Player 3:", 0, 440) GuiCtrlCreateLabel("Player 4:", 0, 470) $DisplayPlayer1Name = GuiCtrlCreateInput("Prophete", 60, 378, 100,20, BitOr($ES_ReadOnly, $ES_Center)) $DisplayPlayer2Name = GuiCtrlCreateInput("Prophete", 60, 408, 100,20, BitOr($ES_ReadOnly, $ES_Center)) $DisplayPlayer3Name = GuiCtrlCreateInput("Prophete", 60, 438, 100,20, BitOr($ES_ReadOnly, $ES_Center)) $DisplayPlayer4Name = GuiCtrlCreateInput("Prophete", 60, 468, 100,20, BitOr($ES_ReadOnly, $ES_Center)) GuiCtrlCreatePic(@ScriptDIr & "/Images/TichuBackOfCard.Bmp", 350, 30, 80,130) GuiCtrlCreatePic(@ScriptDIr & "/Images/TichuBackOfCard.Bmp", 350, 340, 80,130) GuiCtrlCreatePic(@ScriptDIr & "/Images/TichuBackOfCard.Bmp", 30, 200, 80,130) GuiCtrlCreatePic(@ScriptDIr & "/Images/TichuBackOfCard.Bmp", 680, 200, 80,130) $DisplayPlayer1CardsRemaining = GuiCtrlCreateInput("14 Cards Left", 340, 3,100, 20, BitOr($ES_ReadOnly, $ES_Center)) $DisplayPlayer2CardsRemaining = GuiCtrlCreateInput("14 Cards Left", 340, 475,100, 20, BitOr($ES_ReadOnly, $ES_Center)) $DisplayPlayer3CardsRemaining = GuiCtrlCreateInput("14 Cards Left", 20, 335,100, 20, BitOr($ES_ReadOnly, $ES_Center)) $DisplayPlayer4CardsRemaining = GuiCtrlCreateInput("14 Cards Left", 670, 335,100, 20, BitOr($ES_ReadOnly, $ES_Center)) GuiCtrlCreatePic(@ScriptDIr & "/Images/TichuPlayingFIeld.bmp", 200, 180, 380,140) GuiCtrlCreatePic(@ScriptDIr & "/Images/Bomb.bmp", 200, 180, 380,140) $PlayButton = GuiCtrlCreateButton("Hand", 240, 470, 80,30) GuiCtrlSetOnEvent(-1, "_HandGUI") $PassButton = GuiCtrlCreateButton("Pass", 465, 470, 80,30) GuiSetState() EndFunc Func _HandGUI() $CurrentGui = "Hand" $HandGui = GuiCreate("Hand", 800,400) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GuiSetBkColor(0xFFFFFF) GuiSetFont(11) $Cards = _ArrayToString($Player1Cards, "|") $SplitCards = StringSplit($Cards, "|") $CardCount = $SplitCards[0] $X = 15 For $i = 0 To $CardCount - 1 If $i = 9 Then $X = 185 EndIf If $i < 9 Then $Player1Card[$i] = GuiCtrlCreatePic(@ScriptDir & "/Images/Deck/" & $Player1Cards[$i] & ".bmp", $X, 20, 80,130) $X += 85 Else $Player1Card[$i] = GuiCtrlCreatePic(@ScriptDir & "/Images/Deck/" & $Player1Cards[$i] & ".bmp", $X, 170, 80,130) $X += 85 EndIf Next $X = 50 For $i = 0 To 8 GuiCtrlCreateLabel($i, $X,0, 80,20) GuiCtrlSetFont(-1, 12) $X += 85 Next $X = 215 For $i = 9 To 13 GuiCtrlCreateLabel($i, $X, 150, 80, 20) GuiCtrlSetFont(-1, 12) $X += 85 Next $MoveCard = GuiCtrlCreateButton("Move Card", 10,360,120,40) GuiCtrlSetOnEvent(-1, "_MoveCard") $TradeCards = GuiCtrlCreateButton("Trade Cards", 10,360,120,40) GuiCtrlSetOnEvent(-1, "_TradeCards") $RemoveCard = GuiCtrlCreateButton("Remove Card", 300,360,120,40) GuiCtrlSetOnEvent(-1, "_RemoveCard") GuiSetState() EndFunc Func _TradeCards() $TradePlayer1 = InputBox("Trade Cards", "Please input the player you would like to trade with." & @CRLF & @CRLF & "IE: 1, 2 or 3") $TradePlayer1Card = InputBox("Trade Cards", "Please input the card you would like to trade." & @CRLF & @CRLF & "0 being position 1 - 13") $TradePlayer2 = InputBox("Trade Cards", "Please input the player you would like to trade with." & @CRLF & @CRLF & "IE: 1, 2 or 3") $TradePlayer2Card = InputBox("Trade Cards", "Please input the card you would like to trade." & @CRLF & @CRLF & "0 being position 1 - 13") $TradePlayer3 = InputBox("Trade Cards", "Please input the player you would like to trade with." & @CRLF & @CRLF & "IE: 1, 2 or 3") $TradePlayer3Card = InputBox("Trade Cards", "Please input the card you would like to trade." & @CRLF & @CRLF & "0 being position 1 - 13") EndFunc Func _RemoveCard() _ArrayDelete($Player1Cards, 3) GuiDelete($HandGui) _HandGui() EndFunc Func _MoveCard() $Card1ToMove = InputBox("Move Card", "Please type a number from 0-13 of the position of the first card to move." & @CRLF & "0 being position 1.") $Card2ToMove = InputBox("Move Card", "Please type a number from 0-13 of the position of the second card to move." & @CRLF & "0 being position 1.") $Card1ToMoveData = $Player1Cards[$Card1ToMove] $Card2ToMoveData = $Player1Cards[$Card2ToMove] If $Card2ToMoveData = "" Then SetError(1) Else _ArraySwap($Player1Cards[$Card1ToMove], $Player1Cards[$Card2ToMove]) GuiDelete($HandGui) _HandGui() EndIf EndFunc Func _DealCards() _CreateHands() EndFunc Func _Exit() If $CurrentGui = "Hand" Then GuiDelete($HandGui) $CurrentGui = "MainGui" ElseIf $CurrentGui = "MainGui" Then Exit EndIf EndFunc While 1 Sleep(10) WEnd There's a bunch of images and stuff related but that should be enough to prove that
And thanks Shane for the info, I'll look into that.
-
Damein got a reaction from usera in Search in Text the report
This should get you started.
I advise you to read the help file a bit more, pretty basic stuff.
#include <Array.au3> Local $KeyWordArray[6] $KeyWordArray[1] = "Test" $KeyWordArray[2] = "Test2" $KeyWordArray[3] = "Test3" $KeyWordArray[4] = "Test4" $KeyWordArray[5] = "Test5" $File = FileOpen("x") $FileRead = FileRead($File) For $i = 1 To 5 If StringInStr($FileRead, $KeyWordArray[$i]) Then MsgBox(0, "Found", "Found the keyword" & @CRLF & $KeyWordArray[$i]) EndIf Next -
Damein got a reaction from iamtheky in Games made in Autoit.
http://sourceforge.net/projects/phoenixlabyrinth/
Phoenix Labyrinth (Beta, not yet 100% but it is playable 1 player)
-
Damein reacted to BrewManNH in Creating a file using var, name is used in file
FileOpenDialog will look for files, FileSelectFolder will let you look for folders, you're using the wrong function to do what you're looking to do.
-
Damein reacted to Melba23 in Bot Designing for flash games
moundsy,
Please take the time to read the Forum Rules. You will see that discussion of game automation is not premitted here.
I look forward to helping you with future, legitmate questions.
9M23
-
Damein got a reaction from Clark in your opinion on GUI difficulty
I wrote you a quick script (Not complete) I think it should be well more than enough to get you started
If you have any questions/need further help then PM me as I probably will forget to check this often ^^;
Code:
#include <Array.au3> #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Global $ProductListBox, $Gui1, $Gui2 $Products = IniReadSection("Products.ini", "Product") If @error Then MsgBox(48, "Error", "An error has occured!" & @CR & "There was no INI file to load." & @CR & "Please speak with <Name> to fix this problem!") Exit Else _CreateGUI() EndIf Func _CreateGUI() $Gui1 = GuiCreate("Supply Order Form", 600,500) GUISetOnEvent($GUI_EVENT_CLOSE, "_Close") $ProductListBox = GuiCtrlCreateList("",200,80,200,300) For $i = 1 To $Products[0][0] GuiCtrlSetData($ProductListBox, $Products[$i][0]) Next GuiCtrlCreateLabel("Please select a product to order", 160,400,350,30) GuiCtrlSetFont(-1,17) $NextButton1 = GuiCtrlCreateButton("Next", 400,470,80,25) GUICtrlSetOnEvent($NextButton1, "_Gui2") $CancelButton = GuiCtrlCreateButton("Cancel", 490,470,80,25) GUICtrlSetOnEvent($CancelButton, "_Close") GuiSetState() EndFunc Func _Gui2() $ProductSelection = GuiCtrlRead($ProductListBox) If $ProductSelection = "" Then MsgBox(48, "Error", "Please select a product before proceeding!") Else GuiDelete($Gui1) $Gui2 = GuiCreate("Product Details",600,500) GUISetOnEvent($GUI_EVENT_CLOSE, "_Close") $ProductDetailsListBox = GuiCtrlCreateList("",200,80,200,300) $ProductDetails = IniReadSection("Products.ini", "Product") For $i = 1 To $ProductDetails[0][0] If $ProductDetails[$i][0] = $ProductSelection Then $NewProductDetails = IniRead("Products.ini", "Product", $ProductSelection, "Error") $NewString = StringSplit($NewProductDetails, ",") Else Sleep(10) EndIf Next For $i = 1 To $NewString[0] GuiCtrlSetData($ProductDetailsListBox, $NewString[$i]) Next $NextButton1 = GuiCtrlCreateButton("Next", 400,470,80,25) GUICtrlSetOnEvent($NextButton1, "_EmployeeID") $CancelButton = GuiCtrlCreateButton("Cancel", 490,470,80,25) GUICtrlSetOnEvent($CancelButton, "_Close") GuiSetState() EndIf EndFunc Func _EmployeeID() $ID = InputBox("Employee ID", "Please enter your employee ID") $IDList = IniReadSection("EmployeeID.ini", "IDS") For $i = 1 To $IDList[0][0] MsgBox(0, "Test", $IDList[$i][0] & @CR & @CR & $ID) If $IDList[$i][0] = $ID Then MsgBox(0, "Test", "Welcome!") ExitLoop Else Sleep(10) EndIf If $i = $IDList[0][0] Then MsgBox(0, "Test", "Not Welcome!") ExitLoop EndIf Next EndFunc Func _Close() Exit EndFunc While 1 Sleep(10) WEnd
You WILL have to write your own INI's in order for this to work. I thought this would be best since only your company would know the values.
For testing purposes create the following INI/INI entries.
INI Name:
Products.ini
INI Contents
[Product]
Toner=1,2,3,4
Paper=1,2,3,4
INI Name:
EmployeeID.ini
INI Contents:
[iDS]
Jon=1
Ted=1
Bob=1
I think this ID setup would be useful in more than one way. If say, your employee ID does not grant you access to sending a request form (Say only managers can do it) then you can set the value to either 1 or 0. And then run a If statement and if they do not have a 1 exit the script so they cannot send the invoice.
Once again, hope this helps and let me know what you think/need!