caramen Posted October 24, 2014 Share Posted October 24, 2014 (edited) Hello all According to this answered question I got a new question How to iniwrite all item from a GUICtrlListView in an INI file ? expandcollapse popup#include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <File.au3> Opt("GUIOnEventMode", 1) Global $Var01 = 01 Global $Console = GUICreate("Console", 200, 200) Global $ConsoleArea = GUICtrlCreateListView("Console ", 10,10 , 180, 180,$LVS_REPORT) GUISetState(@SW_SHOW, $Console) WinMove("Console","", 800,0) While 1 Envelope () WEnd Func Envelope () Local $Message = 0 $Message = GUIGetMsg() Select Case $Message = $GUI_EVENT_CLOSE Exit EndSelect $Var01 = $Var01 + 1 Sleep (300) _GUICtrlListView_AddItem($ConsoleArea,"Numero de la variable = "& $Var01) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ; scroll to the end of ListView EndFunc Btw I am not asking a complet code but just a syntax if that is possible Edited October 24, 2014 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 24, 2014 Moderators Share Posted October 24, 2014 caramen,I would loop through the ListView using _GUICtrlListView_GetItemTextString on each row - you can then write that string to the ini file using the row number as the key. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
caramen Posted October 24, 2014 Author Share Posted October 24, 2014 (edited) So if i add 50 items in a script i have to do $ConsoleData = _GUICtrlListView_GetItemTextString ($ConsoleArea, 1)) IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe", $ConsoleData) $ConsoleData = _GUICtrlListView_GetItemTextString ($ConsoleArea, 2)) IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe2", $ConsoleData) Or is there a better/easyer way ? does this syntax is correct ? Edited October 24, 2014 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted October 24, 2014 Moderators Solution Share Posted October 24, 2014 caramen, is there a better/easyer way ?You have been a member here since 2006 - have you never come across loops? For $i = 0 To _GUICtrlListView_GetItemCount($ConsoleArea) - 1 ; Because the first row is row 0 $ConsoleData = _GUICtrlListView_GetItemTextString ($ConsoleArea, $i) ; Read the row IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $i, $ConsoleData) ; Add to the ini NextM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
BrewManNH Posted October 24, 2014 Share Posted October 24, 2014 (edited) Something like this would be better.For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next Edited October 24, 2014 by BrewManNH If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
caramen Posted October 24, 2014 Author Share Posted October 24, 2014 (edited) I have to explain then i am working on my harder script and i am familiar with loop but not realy with new function This is the real script... but you wont be able to lunch it becose there is a lot of condition in it. So even with a good syntaxt this is why i need explaination. Sorry i am a noob (I know i should make my scripts better but i got my own organisation ) expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <IE.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <ListViewConstants.au3> #include <ButtonConstants.au3> #include <GuiListView.au3> #include <File.au3> HotKeySet("{ESCAPE}", "Exite") HotKeySet("{PAUSE}", "Pause") $SettingsFile = @SCRIPTDIR & '\Data\Settings.ini' $Variable1 = 0 Global $Paused Example() $S1 = IniRead ($SettingsFile, 'Stats', 'Utilisation', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation',$S1+1) Func Example() ; Creation de l'interface Global $hGUI = GUICreate("Raccourcis outils", 400, 500) ; Creation de la liste combot Local $iComboBox = GUICtrlCreateCombo("Selectionnez un outil.", 90, 50, 190, 20) Local $iClose = GUICtrlCreateButton("Close", 280, 450, 85, 25) Local $iConnect = GUICtrlCreateButton("Go", 280, 48, 85, 25) Local $iConnect2 = GUICtrlCreateButton("Go", 280, 348, 85, 25) Local $iDoc = GUICtrlCreateButton("Documentation", 280, 380, 85, 25) ;~ Interrieure de la GUI GUICtrlCreateLabel ("Selectionner un Outil.", 80, 20, 180, 20) GUICtrlCreateLabel ("Outil :", 10, 52, 75, 20) GUICtrlCreateLabel ("Nombre d'utilisation logiciel :" , 10, 452, 175, 20) $S1 = IniRead ($SettingsFile, 'Stats', 'Utilisation', "ERROR") GUICtrlCreateLabel ($S1, 150, 452, 75, 20) ; Addition des items combot (un item pour chaque etab) GUICtrlSetData($iComboBox, "=======Client legé===========") GUICtrlSetData($iComboBox, "Alike") GUICtrlSetData($iComboBox, "AssetDB") GUICtrlSetData($iComboBox, "Chopin") GUICtrlSetData($iComboBox, "Conformité") GUICtrlSetData($iComboBox, "Delphes") GUICtrlSetData($iComboBox, "FIS") GUICtrlSetData($iComboBox, "Horus") GUICtrlSetData($iComboBox, "HP BladeSystem") GUICtrlSetData($iComboBox, "Infoblox") GUICtrlSetData($iComboBox, "Password Vault") GUICtrlSetData($iComboBox, "Saam") GUICtrlSetData($iComboBox, "=======Client lourd==========") GUICtrlSetData($iComboBox, "PCAC") GUICtrlSetData($iComboBox, "Putty") GUICtrlSetData($iComboBox, "Disquette anto") GUICtrlSetData($iComboBox, "=======Active directory=======") GUICtrlSetData($iComboBox, "AD Tech(APPS)") GUICtrlSetData($iComboBox, "AD Tech(Winrep)") GUICtrlSetData($iComboBox, "=======Vcenters===============") GUICtrlSetData($iComboBox, "Cloud prod") GUICtrlSetData($iComboBox, "Cloud H prod") GUICtrlSetData($iComboBox, "Vc-BP2S") GUICtrlSetData($iComboBox, "DNA") GUICtrlSetData($iComboBox, "VCenter mut") Local $iComboBox2 = GUICtrlCreateCombo("Selectionnez une macro.", 90, 350, 190, 20) GUICtrlCreateLabel ("Macro :", 10, 352, 75, 20) GUICtrlSetData($iComboBox2, "=======Macro========") GUICtrlSetData($iComboBox2, "Creation enveloppe windows") GUICtrlSetData($iComboBox2, "Macro 02") GUICtrlSetData($iComboBox2, "=====Connexion Firewall's=====") GUICtrlSetData($iComboBox2, "Connexion VCenter") GUICtrlSetData($iComboBox2, "Connexion Cloud H prod") GUICtrlSetData($iComboBox2, "Connexion Cloud prod") ;~ ================================Text defilant========================================== ;~ ======================================================================================== $label = GUICtrlCreateLabel("Fait par INTM pour BNP", 1000 ,1000 , 150, 15) Global $px = 0 , $speed = 10 ;~ ======================================================================================== ;~ ======================================================================================== ; Display de l'interface GUISetState(@SW_SHOW, $hGUI) Local $sComboRead = "" ; Boucle j'usqua utilisation de la GUI. While 1 ;~ ================================Text defilant=========================================== ;~ ======================================================================================== $px -= 1 GUICtrlSetPos($label, $px, 0) if $px < -100 then $px = 500 ;~ ======================================================================================== ;~ ======================================================================================== Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $iClose GUIDelete ($hGUI) GUIDelete ($hGUI2) GUIDelete ($Console) Exit Case $iDoc run (@SCRIPTDIR&"\Data\Procedures.hnd") Case $iComboBox $sComboRead = GUICtrlRead($iComboBox) If $sComboRead = "Horus" Then $Outil01 = IniRead ($SettingsFile, 'Informations', 'Outil01', "ERROR") $URL01 = IniRead ($SettingsFile, 'Informations', 'Chemin01', "ERROR") $definition01 = IniRead ($SettingsFile, 'Informations', 'definition01', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil01 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL01 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Horus ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition01 , 70, 225, 120, 100) ElseIf $sComboRead = "HP BladeSystem" Then $Outil02 = IniRead ($SettingsFile, 'Informations', 'Outil02', "ERROR") $URL02 = IniRead ($SettingsFile, 'Informations', 'Chemin02', "ERROR") $definition02 = IniRead ($SettingsFile, 'Informations', 'definition02', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil02 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL02 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert HP BladeSystem ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition02 , 70, 225, 120, 100) ElseIf $sComboRead = "Alike" Then $Outil03 = IniRead ($SettingsFile, 'Informations', 'Outil03', "ERROR") $URL03 = IniRead ($SettingsFile, 'Informations', 'Chemin03', "ERROR") $definition03 = IniRead ($SettingsFile, 'Informations', 'definition03', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil03 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL03 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Alike", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition03 , 70, 225, 120, 100) ElseIf $sComboRead = "AD Tech(APPS)" Then $Outil04 = IniRead ($SettingsFile, 'Informations', 'Outil04', "ERROR") $URL04 = IniRead ($SettingsFile, 'Informations', 'Chemin04', "ERROR") $definition04 = IniRead ($SettingsFile, 'Informations', 'definition04', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil04 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL04 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert AD Tech(APPS)", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition04 , 70, 225, 120, 100) ElseIf $sComboRead = "AD Tech(Winrep)" Then $Outil05 = IniRead ($SettingsFile, 'Informations', 'Outil05', "ERROR") $URL05 = IniRead ($SettingsFile, 'Informations', 'Chemin05', "ERROR") $definition05 = IniRead ($SettingsFile, 'Informations', 'definition05', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil05 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL05 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert AD Tech(Winrep)", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition05 , 70, 225, 120, 100) ElseIf $sComboRead = "AssetDB" Then $Outil06 = IniRead ($SettingsFile, 'Informations', 'Outil06', "ERROR") $URL06 = IniRead ($SettingsFile, 'Informations', 'Chemin06', "ERROR") $definition06 = IniRead ($SettingsFile, 'Informations', 'definition06', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil06 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL06 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert AssetDB", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition06 , 70, 225, 120, 100) ElseIf $sComboRead = "Chopin" Then $Outil07 = IniRead ($SettingsFile, 'Informations', 'Outil07', "ERROR") $URL07 = IniRead ($SettingsFile, 'Informations', 'Chemin07', "ERROR") $definition07 = IniRead ($SettingsFile, 'Informations', 'definition07', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil07 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL07 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Chopin", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition07 , 70, 225, 120, 100) ElseIf $sComboRead = "Conformité" Then $Outil08 = IniRead ($SettingsFile, 'Informations', 'Outil08', "ERROR") $URL08 = IniRead ($SettingsFile, 'Informations', 'Chemin08', "ERROR") $definition08 = IniRead ($SettingsFile, 'Informations', 'definition08', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil08 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL08 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert la Conformité ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition08 , 70, 225, 120, 100) ElseIf $sComboRead = "Delphes" Then $Outil09 = IniRead ($SettingsFile, 'Informations', 'Outil09', "ERROR") $URL09 = IniRead ($SettingsFile, 'Informations', 'Chemin09', "ERROR") $definition09 = IniRead ($SettingsFile, 'Informations', 'definition09', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil09 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL09 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert la Delphes ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition09 , 70, 225, 120, 100) ElseIf $sComboRead = "FIS" Then $Outil10 = IniRead ($SettingsFile, 'Informations', 'Outil10', "ERROR") $URL10 = IniRead ($SettingsFile, 'Informations', 'Chemin10', "ERROR") $definition10 = IniRead ($SettingsFile, 'Informations', 'definition10', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil10 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL10 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert la FIS ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition10 , 70, 225, 120, 100) ElseIf $sComboRead = "Infoblox" Then $Outil11 = IniRead ($SettingsFile, 'Informations', 'Outil11', "ERROR") $URL11 = IniRead ($SettingsFile, 'Informations', 'Chemin11', "ERROR") $definition11 = IniRead ($SettingsFile, 'Informations', 'definition11', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil11 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL11 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Infoblox ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition11 , 70, 225, 120, 100) ElseIf $sComboRead = "Password Vault" Then $Outil12 = IniRead ($SettingsFile, 'Informations', 'Outil12', "ERROR") $URL12 = IniRead ($SettingsFile, 'Informations', 'Chemin12', "ERROR") $definition12 = IniRead ($SettingsFile, 'Informations', 'definition12', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil12 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL12 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Infoblox ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition12 , 70, 225, 120, 100) ElseIf $sComboRead = "Saam" Then $Outil13 = IniRead ($SettingsFile, 'Informations', 'Outil13', "ERROR") $URL13 = IniRead ($SettingsFile, 'Informations', 'Chemin13', "ERROR") $definition13 = IniRead ($SettingsFile, 'Informations', 'definition13', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil13 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL13 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Saam ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition13 , 70, 225, 120, 100) ElseIf $sComboRead = "Cloud prod" Then $Outil14 = IniRead ($SettingsFile, 'Informations', 'Outil14', "ERROR") $URL14 = IniRead ($SettingsFile, 'Informations', 'Chemin14', "ERROR") $definition14 = IniRead ($SettingsFile, 'Informations', 'definition14', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil14 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL14 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert le VC Cloud prod ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition14 , 70, 225, 120, 100) ElseIf $sComboRead = "Cloud H prod" Then $Outil15 = IniRead ($SettingsFile, 'Informations', 'Outil15', "ERROR") $URL15 = IniRead ($SettingsFile, 'Informations', 'Chemin15', "ERROR") $definition15 = IniRead ($SettingsFile, 'Informations', 'definition15', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil15 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL15 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert le VC Cloud h prod ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition15 , 70, 225, 120, 100) ElseIf $sComboRead = "Vc-BP2S" Then $Outil16 = IniRead ($SettingsFile, 'Informations', 'Outil16', "ERROR") $URL16 = IniRead ($SettingsFile, 'Informations', 'Chemin16', "ERROR") $definition16 = IniRead ($SettingsFile, 'Informations', 'definition16', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil16 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL16 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert le VC BP2S ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition16 , 70, 225, 120, 100) ElseIf $sComboRead = "DNA" Then $Outil17 = IniRead ($SettingsFile, 'Informations', 'Outil17', "ERROR") $URL17 = IniRead ($SettingsFile, 'Informations', 'Chemin17', "ERROR") $definition17 = IniRead ($SettingsFile, 'Informations', 'definition17', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil17 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL17 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert le VC DNA ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition17 , 70, 225, 120, 100) ElseIf $sComboRead = "Putty" Then $Outil18 = IniRead ($SettingsFile, 'Informations', 'Outil18', "ERROR") $URL18 = IniRead ($SettingsFile, 'Informations', 'Chemin18', "ERROR") $definition18 = IniRead ($SettingsFile, 'Informations', 'definition18', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil18 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL18 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Putty ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition18 , 70, 225, 120, 100) ElseIf $sComboRead = "Disquette anto" Then $Outil19 = IniRead ($SettingsFile, 'Informations', 'Outil19', "ERROR") $URL19 = IniRead ($SettingsFile, 'Informations', 'Chemin19', "ERROR") $definition19 = IniRead ($SettingsFile, 'Informations', 'definition19', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil19 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL19 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Disquette anto ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition19 , 70, 225, 120, 100) ElseIf $sComboRead = "VCenter mut" Then $Outil20 = IniRead ($SettingsFile, 'Informations', 'Outil20', "ERROR") $URL20 = IniRead ($SettingsFile, 'Informations', 'Chemin20', "ERROR") $definition20 = IniRead ($SettingsFile, 'Informations', 'definition20', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil20 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL20 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert VCenter mut ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition20 , 70, 225, 120, 100) Else Sleep(200) ;~ MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead, 0, $hGUI) ;~ run( "C:\Windows\System32\mstsc.exe"&" /admin /v:MGNET"&$sComboRead&"-sv005") EndIf ;========================================================================================================================================= ;========================================================================================================================================= ;========================================================================================================================================= ;=====================================CONNEXION A L OUTIL DESIRER ;========================================================================================================================================= ;========================================================================================================================================= ;========================================================================================================================================= Case $iConnect If $sComboRead = "Horus" Then $S2 = IniRead ($SettingsFile, 'Stats', 'Utilisation Horus', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Horus',$S2+1) GUICtrlCreateLabel ("Nombre d'utilisation horus:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S2, 150, 432, 75, 20) Local $oIE = _IECreate($URL01, 1) ElseIf $sComboRead = "HP BladeSystem" Then $S3 = IniRead ($SettingsFile, 'Stats', 'Utilisation HP,BS', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation HP,BS',$S3+1) GUICtrlCreateLabel ("Nombre d'utilisation HP,BS:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S3, 150, 432, 75, 20) $A=InputBox("BarreCode", "Renseignez votre barrecode NE PAS OUBLIER LE POINT.") $B=InputBox("FQDN", "Renseignez le FQDN.") $URL02BIS = $A&$B Local $oIE = _IECreate($URL02BIS, 1) ElseIf $sComboRead = "Alike" Then $S4 = IniRead ($SettingsFile, 'Stats', 'Utilisation Alike', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Alike',$S4+1) GUICtrlCreateLabel ("Nombre d'utilisation Alike:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S4, 150, 432, 75, 20) Local $oIE = _IECreate($URL03, 1) ElseIf $sComboRead = "AD Tech(APPS)" Then $S5 = IniRead ($SettingsFile, 'Stats', 'Utilisation APPS', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation APPS',$S5+1) GUICtrlCreateLabel ("Nombre d'utilisation APPS:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S5, 150, 432, 75, 20) run( "C:\Windows\System32\mstsc.exe"&" /admin /v:s00v09927223") ElseIf $sComboRead = "AD Tech(Winrep)" Then $S6 = IniRead ($SettingsFile, 'Stats', 'Utilisation Winrep', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Winrep',$S6+1) GUICtrlCreateLabel ("Nombre d'utilisation Winrep:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S6, 150, 432, 75, 20) run( "C:\Windows\System32\mstsc.exe"&" /admin /v:Winrep") ElseIf $sComboRead = "AssetDB" Then $S7 = IniRead ($SettingsFile, 'Stats', 'Utilisation AssetDB', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation AssetDB',$S7+1) GUICtrlCreateLabel ("Nombre d'utilisation AssetDB:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S7, 150, 432, 75, 20) Local $oIE = _IECreate($URL06, 1) ElseIf $sComboRead = "Chopin" Then $S8 = IniRead ($SettingsFile, 'Stats', 'Utilisation Chopin', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Chopin',$S8+1) GUICtrlCreateLabel ("Nombre d'utilisation Chopin:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S8, 150, 432, 75, 20) Local $oIE = _IECreate($URL07, 1) ElseIf $sComboRead = "Conformité" Then $S9 = IniRead ($SettingsFile, 'Stats', 'Utilisation Conformité', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Conformité',$S9+1) GUICtrlCreateLabel ("Nombre d'utilisation Conformité:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S9, 160, 432, 75, 20) Local $oIE = _IECreate($URL08, 1) ElseIf $sComboRead = "Delphes" Then $S10 = IniRead ($SettingsFile, 'Stats', 'Utilisation Delphes', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Delphes',$S10+1) GUICtrlCreateLabel ("Nombre d'utilisation Delphes:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S10, 150, 432, 75, 20) Local $oIE = _IECreate($URL09, 1) ElseIf $sComboRead = "FIS" Then $S11 = IniRead ($SettingsFile, 'Stats', 'Utilisation FIS', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation FIS',$S11+1) GUICtrlCreateLabel ("Nombre d'utilisation FIS:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S11, 150, 432, 75, 20) Local $oIE = _IECreate($URL10, 1) ElseIf $sComboRead = "Infoblox" Then $S12 = IniRead ($SettingsFile, 'Stats', 'Utilisation Infoblox', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Infoblox',$S12+1) GUICtrlCreateLabel ("Nombre d'utilisation Infoblox:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S12, 150, 432, 75, 20) Local $oIE = _IECreate($URL11, 1) ElseIf $sComboRead = "Password Vault" Then $S13 = IniRead ($SettingsFile, 'Stats', 'Utilisation Vault', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Vault',$S13+1) GUICtrlCreateLabel ("Nombre d'utilisation Vault:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S13, 150, 432, 75, 20) Local $oIE = _IECreate($URL12, 1) ElseIf $sComboRead = "Saam" Then $S14 = IniRead ($SettingsFile, 'Stats', 'Utilisation Saam', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Saam',$S14+1) GUICtrlCreateLabel ("Nombre d'utilisation Saam:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S14, 150, 432, 75, 20) Local $oIE = _IECreate($URL13, 1) ElseIf $sComboRead = "Cloud prod" Then $S15 = IniRead ($SettingsFile, 'Stats', 'Utilisation CloudP', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation CloudP',$S15+1) GUICtrlCreateLabel ("Nombre d'utilisation CloudP:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S15, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\vmwarecloudprod.cmd" ) ElseIf $sComboRead = "Cloud H prod" Then $S16 = IniRead ($SettingsFile, 'Stats', 'Utilisation CloudNP', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation CloudNP',$S16+1) GUICtrlCreateLabel ("Nombre d'utilisation CloudNP:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S16, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\vmwarecloudhprod.cmd" ) ElseIf $sComboRead = "Vc-BP2S" Then $S17 = IniRead ($SettingsFile, 'Stats', 'Utilisation Vc-BP2S', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Vc-BP2S',$S17+1) GUICtrlCreateLabel ("Nombre d'utilisation Vc-BP2S:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S17, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\vmwarebp2s.cmd" ) ElseIf $sComboRead = "DNA" Then $S18 = IniRead ($SettingsFile, 'Stats', 'Utilisation DNA', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation DNA',$S18+1) GUICtrlCreateLabel ("Nombre d'utilisation DNA:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S18, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\vmwareDNA.cmd" ) ElseIf $sComboRead = "Putty" Then $S19 = IniRead ($SettingsFile, 'Stats', 'Utilisation Putty', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Putty',$S19+1) GUICtrlCreateLabel ("Nombre d'utilisation Putty:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S19, 150, 432, 75, 20) run ($URL18) ElseIf $sComboRead = "Disquette anto" Then $S20 = IniRead ($SettingsFile, 'Stats', 'Utilisation Disquette', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Disquette',$S20+1) GUICtrlCreateLabel ("Nombre d'utilisation Disquette:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S20, 160, 432, 75, 20) run ($URL19) ElseIf $sComboRead = "VCenter mut" Then $S21 = IniRead ($SettingsFile, 'Stats', 'Utilisation VCenter mut', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation VCenter mut',$S21+1) GUICtrlCreateLabel ("Nombre d'utilisation VCenter mut:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S21, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\vmwaremut.cmd" ) Else MsgBox($MB_SYSTEMMODAL, "", "Choisissez un élément" ) ;~ run( "C:\Windows\System32\mstsc.exe"&" /admin /v:MGNET"&$sComboRead&"-sv005") EndIf ;========================================================================================================================================= ;========================================================================================================================================= ;========================================================================================================================================= ;=====================================MACRO's ;========================================================================================================================================= ;========================================================================================================================================= ;========================================================================================================================================= Case $iComboBox2 $sComboRead2 = GUICtrlRead($iComboBox2) If $sComboRead2 = "Creation enveloppe windows" Then GUICtrlCreateLabel ("Aide:", 80, 380, 100, 100) GUICtrlCreateLabel ("'Creation enveloppe windows' sert a créer les enveloppe automatiquement.",110, 380, 150, 80) ElseIf $sComboRead2 = "Macro 02" Then GUICtrlCreateLabel ("Aide:", 80, 380, 190, 20) GUICtrlCreateLabel ("Macro 02 sert a rien pour le moment.",110, 380, 150, 100) Else Sleep(500) ;~ MsgBox($MB_SYSTEMMODAL, "", "Choisissez un élément" ) EndIf ;~ MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead2, 0, $hGUI) Case $iConnect2 $sComboRead2 = GUICtrlRead($iComboBox2) If $sComboRead2 = "Creation enveloppe windows" Then Macro1 () ElseIf $sComboRead2 = "Macro 02" Then Run ("C:\Program Files\Windows NT\Accessories\WordPad.Exe") Sleep (3000) Send ( "ceci est une macro test" ) ElseIf $sComboRead2 = "Connexion VCenter" Then $S22 = IniRead ($SettingsFile, 'Stats', 'Connexion VCenter', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Connexion VCenter',$S22+1) GUICtrlCreateLabel ("Nombre d'utilisation Connexion VCenter:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S22, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\Firewall manuel VCenter.bat" ) ElseIf $sComboRead2 = "Connexion Cloud H prod" Then $S23 = IniRead ($SettingsFile, 'Stats', 'Connexion Cloud H prod', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Connexion Cloud H prod',$S23+1) GUICtrlCreateLabel ("Nombre d'utilisation Connexion Cloud H prod:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S23, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\Firewall manuel CloudHProd.bat" ) ElseIf $sComboRead2 = "Connexion Cloud prod" Then $S24 = IniRead ($SettingsFile, 'Stats', 'Connexion Cloud prod', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Connexion Cloud prod',$S24+1) GUICtrlCreateLabel ("Nombre d'utilisation CloudProd:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S24, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\firewall manuel Cloud prod.bat" ) Else MsgBox($MB_SYSTEMMODAL, "", "Choisissez un élément" ) EndIf EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example Func Macro1 () Local $iHotRamB = 2 Local $iBiosB = 2 Local $iTserviceB = 2 Local $iTVersionB = 2 ;~ ================================================Console============================================== Global $Console = GUICreate("Console", 300, 300) Global $ConsoleArea = GUICtrlCreateListView("Console ", 10,10 , 280, 280,$LVS_REPORT) GUISetState(@SW_SHOW, $Console) ;==================================== Creation de l'interface enveloppe ================================ Global $hGUI2 = GUICreate("Création de l'enveloppe", 350, 350) ; Creation du formulaire Local $iGoo = GUICtrlCreateButton("Goo", 210, 260, 100, 20) Local $iNomserveurA = GUICtrlCreateInput ("s00v099", 20, 20, 100, 20) Local $iSocketA = GUICtrlCreateInput ("Socket", 20, 50, 100, 20) Local $iProcA = GUICtrlCreateInput ("Processeur", 20, 80, 100, 20) Local $iRamA = GUICtrlCreateInput ("Ram", 20, 110, 100, 20) Local $iHDD1A = GUICtrlCreateInput ("HDD1", 20, 140, 100, 20) Local $iHDD2A = GUICtrlCreateInput ("HDD2", 20, 170, 100, 20) Local $iHDD3A = GUICtrlCreateInput ("HDD3", 20, 200, 100, 20) Local $iHDD4A = GUICtrlCreateInput ("HDD4", 20, 230, 100, 20) Local $iHDD5A = GUICtrlCreateInput ("HDD5", 20, 260, 100, 20) Local $iHDD6A = GUICtrlCreateInput ("HDD6", 20, 290, 100, 20) Local $iHotRam = GUICtrlCreateCheckbox ("Branchement RAM a chaud", 180, 20, 150, 20) Local $iBios = GUICtrlCreateCheckbox ("Bios au demarrage ?", 180, 50, 150, 20) Local $iTService = GUICtrlCreateCheckbox ("ItService?", 180, 80, 150, 20) Local $iTVersionA = GUICtrlCreateInput ("IT Version?", 180, 110, 150, 20) Local $iTVersionLabel = GUICtrlCreateLabel ("4.0 ou 5.0 ou 5.1", 180, 140, 150, 20) Global $Console = GUICtrlCreateLabel ("Log :", 180, 180, 150, 50) ; Display de l'interface GUISetState(@SW_SHOW, $hGUI2) ;~ ======================================================================================================= MsgBox($MB_SYSTEMMODAL, "Merci", "Renseignez le formulaire suivant svp. Puis apuyer sur Goo") While (1) Switch GUIGetMsg () Case $GUI_EVENT_CLOSE GUIDelete ($hGUI) GUIDelete ($hGUI2) GUIDelete ($Console) ExitLoop Case $iGoo GUICtrlSetData ( $Console, "Log : Activation de la fenêtre ") _GUICtrlListView_AddItem($ConsoleArea,"Activation de la fenêtre") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ; scroll to the end of ListView WinMove ("Raccourcis outils","",950,0) WinMove ("Création de l'enveloppe","",950,320) WinMove ("Console","",950,0) WinActivate ("Créer une nouvelle machine virtuelle","") If WinActivate ("Créer une nouvelle machine virtuelle","") then Sleep (1000) GUICtrlSetData ( $Console, "Log : Déplacement de la fenêtre ") _GUICtrlListView_AddItem($ConsoleArea,"Déplacement de la fenêtre ") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) WinMove ("Créer une nouvelle machine virtuelle","",0,0) Sleep(500) ;~ Install personnalisé GUICtrlSetData ( $Console, "Log : Custome Enveloppe ") _GUICtrlListView_AddItem($ConsoleArea,"Custome Enveloppe") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) MouseClick("left",232,203,1) Sleep (500) ;~ Suivant MouseClick("left",573,650,1) Sleep (500) GUICtrlSetData ( $Console, "Log : Nom du serveur ") _GUICtrlListView_AddItem($ConsoleArea,"Nom du serveur") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ On renseigne le nom du serveur $iNomserveurB = GUICtrlRead($iNomserveurA) Send($iNomserveurB) Sleep(500) ;~ Suivant MouseClick("left",573,650,1) Sleep (500) ;~ On selectionne le LUN GUICtrlSetData ( $Console, "Log : Selectionné le LUN SVP ") _GUICtrlListView_AddItem($ConsoleArea,"Selection LUN") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) MsgBox($MB_SYSTEMMODAL, "Merci", "Selectionnez le LUN manuellement. Puis valider.") Sleep(500) ;~ Suivant MouseClick("left",573,650,1) Sleep (500) GUICtrlSetData ( $Console, "Log : Version 8 ") _GUICtrlListView_AddItem($ConsoleArea,"Version 8") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ VM version_8 MouseClick("left",257,339,1) ;~ Suivant MouseClick("left",573,650,1) Sleep(500) ;~ Suivant MouseClick("left",573,650,1) GUICtrlSetData ( $Console, "Log : Processeur & Socket") _GUICtrlListView_AddItem($ConsoleArea,"Processeur & Socket") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ Processeur et socket $iSocketB = GUICtrlRead($iSocketA) While (1) If $iSocketB = 1 Then _GUICtrlListView_AddItem($ConsoleArea,"Socket=1") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) Sleep(200) ExitLoop ElseIf $iSocketB = 2 Then _GUICtrlListView_AddItem($ConsoleArea,"Socket=2") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ On clique le combot list MouseClick("left",489,130,1) ;~ On selectionne 2 socket MouseClick("left",463,168,1) Sleep(200) ExitLoop ElseIf $iSocketB= 3 Then _GUICtrlListView_AddItem($ConsoleArea,"Socket=3") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ On clique le combot list MouseClick("left",489,130,1) ;~ On selectionne 3 socket MouseClick("left",457,181,1) Sleep(200) ExitLoop ElseIf $iSocketB= 4 Then _GUICtrlListView_AddItem($ConsoleArea,"Socket=4") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ On clique le combot list MouseClick("left",489,130,1) ;~ On selectionne 4 socket MouseClick("left",460,189,1) Sleep(200) ExitLoop Else ExitLoop EndIf WEnd $iProcB = GUICtrlRead($iProcA) While(1) If $iProcB = 1 Then _GUICtrlListView_AddItem($ConsoleArea,"Proce=1") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) Sleep(200) ExitLoop ElseIf $iProcB = 2 Then _GUICtrlListView_AddItem($ConsoleArea,"Proce=2") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ On clique le combot list MouseClick("left",459,168,1) ;~ On selectionne 2 socket MouseClick("left",454,195,1) Sleep(200) ExitLoop ElseIf $iProcB= 3 Then _GUICtrlListView_AddItem($ConsoleArea,"Proce=3") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ On clique le combot list MouseClick("left",459,168,1) ;~ On selectionne 3 socket MouseClick("left",454,207,1) Sleep(200) ExitLoop ElseIf $iProcB= 4 Then _GUICtrlListView_AddItem($ConsoleArea,"Proce=4") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ On clique le combot list MouseClick("left",459,168,1) ;~ On selectionne 4 socket MouseClick("left",460,221,1) Sleep(200) ExitLoop Else ExitLoop EndIf WEnd ;~ Suivant MouseClick("left",573,650,1) GUICtrlSetData ( $Console, "Log : RAM ") _GUICtrlListView_AddItem($ConsoleArea,"Config RAM") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ On controle la ram $iRamB = GUICtrlRead($iRamA) MouseClick("left",385,146,1) Send("{DEL}") Sleep(500) _GUICtrlListView_AddItem($ConsoleArea,"Ram="&$iRamB) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) Send($iRamB) ;~ Suivant MouseClick("left",573,650,1) GUICtrlSetData ( $Console, "Log :Selectionner le VLan Manuellement ") _GUICtrlListView_AddItem($ConsoleArea,"Selection VLan") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) MsgBox($MB_SYSTEMMODAL, "Merci", "Selectionnez le VLAN manuellement. Puis valider.") ;~ Suivant MouseClick("left",573,650,1) Sleep(1500) ;~ Suivant MouseClick("left",573,650,1) Sleep(1500) ;~ Suivant MouseClick("left",573,650,1) Sleep(1500) ;~ On selectionne le combot MouseClick("left",302,144,1) Send("{DEL}") Sleep(1500) Send("{DEL}") GUICtrlSetData ( $Console, "Log : HDD ") _GUICtrlListView_AddItem($ConsoleArea,"HDD") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ On selectionne la volumetrie du HDD $iHDD1B = GUICtrlRead ($iHDD1A) _GUICtrlListView_AddItem($ConsoleArea,"HDD1="&$iHDD1B) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) Send($iHDD1B) Sleep(1500) ;~ Suivant MouseClick("left",573,650,1) Sleep(3000) ;~ Suivant MouseClick("left",573,650,1) ;~ On selectionne le mode edition _GUICtrlListView_AddItem($ConsoleArea,"Pause 7 sec") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) GUICtrlSetData ( $Console, "Log : Attente 7 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 6 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 5 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 4 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 3 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 2 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 1 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 0 ") Sleep(500) GUICtrlSetData ( $Console, "Log : Go ") _GUICtrlListView_AddItem($ConsoleArea,"Pause OK") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) MouseClick("left",198,571,1) Sleep(1500) ;~ Continuer MouseClick("left",581,653,1) Sleep(1500) GUICtrlSetData ( $Console, "Log : HDD2 ") _GUICtrlListView_AddItem($ConsoleArea,"HDD2") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) $iHDD2B = GUICtrlRead ($iHDD2A) While (1) ;~=================================HDD2 setup=================================================== If $iHDD2B = ("HDD2") Then ExitLoop Else Sleep(1000) WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") If WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") then WinMove ($iNomServeurB&" - Propriétés de machine virtuelle","",0,0) Sleep(500) MouseClick("left",247,75,1) Sleep(1500) WinWaitActive ("Ajouter du matériel","") WinActivate ("Ajouter du matériel","") If WinActivate ("Ajouter du matériel","") then WinMove ("Ajouter du matériel","",0,0) MouseClick("left",229,290,1) Sleep(500) MouseClick("left",527,481,1) Sleep(500) MouseClick("left",529,479,1) Sleep(500) Send("{DEL}") Sleep(500) Send("{DEL}") Sleep(500) Send($iHDD2B) _GUICtrlListView_AddItem($ConsoleArea,"HDD2="&$iHDD2B) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) MouseClick("left",516,486,1) Sleep(500) MouseClick("left",516,486,1) Sleep(500) MouseClick("left",516,486,1) ExitLoop Else ExitLoop EndIf Else ExitLoop EndIf EndIf WEnd $iHDD3B = GUICtrlRead ($iHDD3A) _GUICtrlListView_AddItem($ConsoleArea,"HDD3") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) GUICtrlSetData ( $Console, "Log : HDD3 ") While (1) ;~ ======================================HDD3 setup=========================================================== If $iHDD3B = ("HDD3") Then ExitLoop Else Sleep(2000) WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") If WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") then WinMove ($iNomServeurB&" - Propriétés de machine virtuelle","",0,0) ;~ Onclique ajouté. MouseClick("left",247,75,1) Sleep(500) WinWaitActive ("Ajouter du matériel","") WinActivate ("Ajouter du matériel","") If WinActivate ("Ajouter du matériel","") then WinMove ("Ajouter du matériel","",0,0) MouseClick("left",229,290,1) Sleep(500) MouseClick("left",527,481,1) Sleep(500) MouseClick("left",529,479,1) Sleep(500) Send("{DEL}") Sleep(500) Send("{DEL}") Sleep(500) Send($iHDD3B) _GUICtrlListView_AddItem($ConsoleArea,"HDD3="&$iHDD3B) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) MouseClick("left",516,486,1) Sleep(500) MouseClick("left",516,486,1) Sleep(500) MouseClick("left",516,486,1) Sleep(1500) ExitLoop Else ExitLoop EndIf Else ExitLoop EndIf EndIf WEnd WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") ;~ If WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") then WinMove ($iNomServeurB&" - Propriétés de machine virtuelle","",0,0) _GUICtrlListView_AddItem($ConsoleArea,"RAM/CPU a Chaud") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) GUICtrlSetData ( $Console, "Log : RAM/CPU a Chaud ") ;~ Branchement memoire a chaud While (1) If $iHotRamB = 1 Then Sleep(1500) ;~ Option MouseClick("left",82,40,1) Sleep(1500) ;~ Selection ligne MouseClick("left",179,206,1) Sleep(1500) ;~ Activation du CPU a chaud MouseClick("left",412,335,1) Sleep(500) ;~ Activation de la RAM a chaud MouseClick("left",394,185,1) Sleep(500) ExitLoop Else ExitLoop EndIf WEnd ;~ Demarrage sur le bios _GUICtrlListView_AddItem($ConsoleArea,"Bios au demarrage") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) GUICtrlSetData ( $Console, "Log : Bios au demarrage ") While (1) If $iBiosB = 1 Then ;~ Option MouseClick("left",82,40,1) Sleep(500) ;~ Option demarrage MouseClick("left",101,225,1) Sleep(500) ;~ On active le bios au demarrage MouseClick("left",411,306,1) Sleep(500) ExitLoop Else ExitLoop EndIf WEnd GUICtrlSetData ( $Console, "Log : ITService Version ") _GUICtrlListView_AddItem($ConsoleArea,"ITService Version") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ ITServiceDesk While (1) If $iTServiceB = 1 Then ;~ Option MouseClick("left",82,40,1) Sleep(1500) ;~ General MouseClick("left",95,174,1) Sleep(1500) ;~ Parametre de configuration MouseClick("left",549,352,1) Sleep(500) WinMove ("Paramètres de configuration","",0,0) Sleep(500) MouseClick("left",549,352,1) Sleep(500) MouseClick("left",548,416,1) Sleep(500) $iTVersionB = GUICtrlRead($iTVersionA) While (1) If $iTVersionB = "IT Version4.0" Then $iTVersionB = 4.0 If $iTVersionB = "IT Version5.0" Then $iTVersionB = 5.0 If $iTVersionB = "IT Version5.1" Then $iTVersionB = 5.1 If $iTVersionB = 4.0 Then Send("machine.id") Sleep(500) Send("{TAB}") Sleep(500) Send("ITServiceV1.0") ExitLoop ElseIf $iTVersionB = 5.0 Then Send("machine.id") Sleep(500) Send("{TAB}") Sleep(500) Send("ITServiceV2.0") ExitLoop Elseif $iTVersionB = 5.1 Then Send("machine.id") Sleep(500) Send("{TAB}") Sleep(500) Send("ITServiceV3.0") ExitLoop Else ExitLoop EndIf WEnd MouseClick("left",399,452,1) ExitLoop Else ExitLoop EndIf WEnd _GUICtrlListView_AddItem($ConsoleArea,"ITServiceV="&$iTVersionB) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ExitLoop EndIf Case $iHotRam If _IsChecked($iHotRam) Then $IHotRamB = 1 Else $IHotRamB = 0 EndIf Case $iBios If _IsChecked($iBios) Then $IBiosB = 1 Else $IBiosB = 0 EndIf Case $iTService If _IsChecked($iTService) Then $iTServiceB = 1 Else $iTServiceB = 0 EndIf EndSwitch WEnd ;~ IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe", $Console) ;~ IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe", $ConsoleArea) GUIDelete ($hGUI) GUIDelete ($hGUI2) GUIDelete ($Console) Example () EndFunc Func Exite () Exit EndFunc Func Pause() GUICtrlSetData ( $Console, "Log : Pause ") _GUICtrlListView_AddItem($ConsoleArea,"Pause") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) $Paused = NOT $Paused While $Paused Sleep (500) WEnd GUICtrlSetData ( $Console, "Log : Marche ") _GUICtrlListView_AddItem($ConsoleArea,"Marche") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) EndFunc; => Pause() Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked I will try with your tips guys then i come for answering the post after this week end . Thx for helping. With you help i whould do that Func RecLog () For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next EndFunc ;After enter a log i log it into the ini $i = 1 and RecLog () ;After enter an other log i log it into the ini $i = 2 and RecLog () I got it ? (i do never used the "For" thing i dont even know if the it change the value after this ) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 Does the value of $I is changed to 0 ? anyway i ll try that and come back Edited October 24, 2014 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Zedna Posted October 24, 2014 Share Posted October 24, 2014 (edited) Look into AutoIt's helpfile in section "Language reference", there are nice descriptions of AutoIt's basics, also Loops. Also have in mind that INI files have size limits (32KB probably diferent on each OS). I'm not sure if latest versions of AutoIt overcome these limits or not because I don't use latest versions. So big text data store rather in TXT files by using FileWrite() instead of INI files with IniWrite(). Edited October 24, 2014 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
BrewManNH Posted October 24, 2014 Share Posted October 24, 2014 Just an FYI, INI files don't have a 32K limit, there's a 32K limit in a section when reading from that section using IniReadSection. It's a Window's limit if I remember correctly and it applies to all versions of Windows. The section itself can have more than 32Kb of data in it, which can be read by IniRead one record at a time, you just can't read it in bulk from my memory. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now