Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/21/2016 in all areas

  1. youtuber, Let me try to follow that code: - You look for files with a particular extension in @ScriptDir (you should really use "*" as the filter - the "." in the Help file parameter list is actually a period marking the end of the phrase). - If you find any then: -- Either count and then display their names, or -- Look for a folder on the desktop named as that extension (or create one if one is not found) and copy the found files into that folder. How is that as a description of what you are trying to do? M23
    1 point
  2. faustf, Delighted that you like the rather more elegant way of dealing with grids of controls. Now to your questions: - There is no such thing as "first script" and "include" - by including the second script within the first, you have only a single script. And as I have given the $aTruckMSHIP array Global scope, you can access it from anywhere within the combined script - I only displayed it within the concludi function to show that it was created correctly. - As to the flow of the script - by using OnEvent mode you are forced to return to the idle loop after each function call or you run into all sorts of problems - so there is no way to "stop" the script. However, if all you want is to prevent the first GUI being actioned while the second is visible, I suggest using GUISetState to disable or hide it and then to re-enable it once the second GUI is deleted. M23
    1 point
  3. youtuber, I am afraid that you question makes no sense to me. Are you asking how to get the sub-folder names from within @ScriptDir? And why would you want to put folder names into a combo which currently holds a list of file extensions? Please explain a little more clearly what you are trying to do. M23
    1 point
  4. faustf, What an awful mess that was. Here is a tidied up version which I think does what you want - the array $aTruckMSHIP is filled when you press the "Concludi" button and as it is a Global variable it is ready to read when you require: ;#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <StaticConstants.au3> Opt("GuiOnEventMode", 1) Opt("GUICloseOnESC", 0) Opt("GUIResizeMode", 128) ; Start of include ############################################ Global $Form2, $Input1, $Button1 Global $aInputs[8][5], $aLabels[8][5], $aButtons[8], $aShipOptionsButtons[6] Global $SHIPOPTIONS_Gui_ship_many, $aTruckMSHIP Global $SHIPOPTIONS_Button1, $SHIPOPTIONS_Button2 Global $truckpooling_pack, $TrucControlConcludi = 0 Func _Truck_pooling_many_ship_gui($Qtt_Pacchi) $SHIPOPTIONS_Gui_ship_many = GUICreate("Form2", 213, 453, 403, 219, -1, $WS_EX_TOPMOST) GUISetOnEvent($GUI_EVENT_CLOSE, "_chiudi") GUICtrlCreateGroup("", 1, 82, 211, 369) _All_disable() GUICtrlCreateGroup("", -99, -99, 1, 1) $aShipOptionsButtons[3] = GUICtrlCreateButton("Concludi", 148, 426, 60, 21) GUICtrlSetState(-1, $GUI_DISABLE) $aShipOptionsButtons[4] = GUICtrlCreateButton("Time Acq.", 6, 426, 60, 21) GUICtrlSetState(-1, $GUI_DISABLE) $aShipOptionsButtons[5] = GUICtrlCreateButton("Conf.", 70, 426, 37, 21) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateGroup("", 1, -3, 211, 89) $aShipOptionsButtons[1] = GUICtrlCreateButton("NO", 164, 60, 43, 21) $aShipOptionsButtons[2] = GUICtrlCreateButton("SI", 5, 60, 43, 21) GUICtrlCreateLabel("I colli successivi hanno", 8, 11, 137, 17) GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") GUICtrlCreateLabel("Lo stesso Peso, H,L,P ??", 9, 30, 148, 17) GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) $truckpooling_pack = $Qtt_Pacchi ;GUICtrlSetOnEvent($SHIPOPTIONS_Button2, "_stampe_mailing") ; si restituisco gli stessi pesi altezza per ogni collo e lo restituisco GUICtrlSetOnEvent($aShipOptionsButtons[1], _Enable_gui) ; no carico altri pesi e altezze per ogni collo in un array e lo restituisco GUICtrlSetOnEvent($aShipOptionsButtons[3], _Concludi) ; no carico altri pesi e altezze per ogni collo in un array e lo restituisco EndFunc ;==>_Truck_pooling_many_ship_gui Func _Concludi() ConsoleWrite("Hit" & @CRLF) Global $aTruckMSHIP[4 * ($truckpooling_pack - 1)] For $i = 1 To $truckpooling_pack - 1 For $j = 1 To 4 $aTruckMSHIP[(($i - 1) * 4) + ($j - 1)] = GUICtrlRead($aInputs[$i][$j]) Next Next $TrucControlConcludi = 1 _ArrayDisplay($aTruckMSHIP, "Filled array", Default, 8) EndFunc ;==>_Concludi Func _Enable_gui() GUICtrlSetState($aShipOptionsButtons[3], $GUI_ENABLE) GUICtrlSetState($aShipOptionsButtons[4], $GUI_ENABLE) GUICtrlSetState($aShipOptionsButtons[5], $GUI_ENABLE) _Enable_Lines($truckpooling_pack - 1) EndFunc ;==>_Enable_gui Func _Enable_Lines($iCount) For $i = 1 To $iCount For $j = 1 To 4 GUICtrlSetState($aInputs[$i][$j], $GUI_ENABLE) GUICtrlSetState($aLabels[$i][$j], $GUI_ENABLE) Next GUICtrlSetState($aButtons[$i], $GUI_ENABLE) Next EndFunc ;==>_Enable_Lines Func _All_disable() Local $aLabelTitles[5] = ["", "Peso", "H", "L", "P"] Local $iY = 123 - 45 For $i = 1 To 7 Local $iX = -24 For $j = 1 To 4 $aInputs[$i][$j] = GUICtrlCreateInput("", $iX + (30 * $j), $iY + (45 * $i), 25, 21) GUICtrlSetState(-1, $GUI_DISABLE) $aLabels[$i][$j] = GUICtrlCreateLabel($aLabelTitles[$j], $iX + (30 * $j), $iY - 20 + (45 * $i), 28, 17) GUICtrlSetState(-1, $GUI_DISABLE) Next $aButtons[$i] = GUICtrlCreateButton("Acq.", 130, $iY + (45 * $i), 37, 21) GUICtrlSetState(-1, $GUI_DISABLE) Next $aShipOptionsButtons[3] = GUICtrlCreateButton("Concludi", 148, 426, 60, 21) GUICtrlSetState(-1, $GUI_DISABLE) $aShipOptionsButtons[4] = GUICtrlCreateButton("Time Acq.", 6, 426, 60, 21) GUICtrlSetState(-1, $GUI_DISABLE) $aShipOptionsButtons[5] = GUICtrlCreateButton("Conf.", 70, 426, 37, 21) GUICtrlSetState(-1, $GUI_DISABLE) EndFunc ;==>_All_disable Func _chiudi() GUIDelete($SHIPOPTIONS_Gui_ship_many) EndFunc ;==>_chiudi ; End of include ############################################ _gui() Func _gui() $Form2 = GUICreate("Form1", 413, 305, 302, 218) GUISetOnEvent($GUI_EVENT_CLOSE, "_close") $Input1 = GUICtrlCreateInput("2", 56, 56, 121, 21) $Button1 = GUICtrlCreateButton("Button1", 216, 56, 75, 25) GUICtrlSetOnEvent($Button1, "_1") GUISetState(@SW_SHOW) EndFunc ;==>_gui Func _1() Local $baba = GUICtrlRead($Input1) Switch $baba Case 1 To 8 _Truck_pooling_many_ship_gui($baba) Case Else MsgBox(0, 'Info', 'Puoi fare fino a 7 spedizioni alla volta') EndSwitch EndFunc ;==>_1 Func _close() Exit EndFunc ;==>_close While 1 Sleep(10) WEnd As you may notice I have used arrays to hold the various controls - it makes for much less typing and much easier-to-understand code. Please ask if you have any questions. M23
    1 point
  5. MattHiggs

    Win 10 Linking to Account

    I Think this is a good idea. There is a major flaw that occurs when embedding the OEM key into the BIOS, one that I came across in a recent project that I was in charge of. I was tasked with deploying a Windows 10 custom image I had created to numerous Lenovo tablet devices, which had UEFI firmware and the OEM key embedded in the BIOS. During the process, I found that Windows 10 was failing to activate on the devices to which I had deployed the custom image. The reason being that, in order for the OEM key to successfully activate Windows, you have to boot the device with its originally installed operating system, complete the Out-of-box experience, and activate Windows at least once in order for the key embedded in the BIOS to activate other custom installs. Since I already had a custom image which contained the OS, apps, and configurations I wanted, I performed a clean install without ever booting the original operating system, which resulted in Windows failing to activate. However, there is also a very easy solution, which I was able to automate thanks to AutoIT (isn't this scripting language great?!?!). First, I obtained the OEM product key retriever tool from Neosmart located here (which displays a simple GUI with an edit control containing the embedded oem key for the machine running the application), embedded it in an AutoIT compiled script, had the script launch tool, read the input generated by the tool, and then plug that value into the command line commands to set the product key then activate windows RunWait ( @ComSpec & " /c " & 'slmgr.vbs -ipk ' & $productkey ) RunWait ( @ComSpec & " /c " & 'slmgr.vbs /ato' ) It had a 100% success rate (regardless of what the message prompts actually said: even if it generated an error, checking activation status in settings always showed Windows activated). But I wouldn't expect the average user to know about something like that, so assigning a Windows license to a user account rather than embedding it in the BIOS seems like a good resolution, but I am left wondering HOW that will be implemented. It will be very interesting to see.
    1 point
×
×
  • Create New...