caramen Posted May 9, 2016 Share Posted May 9, 2016 Hello guys i am making a script to spam 5 messages like i want as i want and when i want. I got this syntax for help you to understand my work.... Case $Boutton1 ; Selection nombre message While (1) If _IsChecked($CheckMessage1) Then MsgBox($MB_SYSTEMMODAL, "Check", "The test Checkbox 1 is fine.", 10) EndIf If _IsChecked($CheckMessage2) Then MsgBox($MB_SYSTEMMODAL, "Check", "The test Checkbox 2 is fine.", 10) EndIf If _IsChecked($CheckMessage3) Then MsgBox($MB_SYSTEMMODAL, "Check", "The test Checkbox 3 is fine.", 10) EndIf If _IsChecked($CheckMessage4) Then MsgBox($MB_SYSTEMMODAL, "Check", "The test Checkbox 4 is fine.", 10) EndIf If _IsChecked($CheckMessage5) Then MsgBox($MB_SYSTEMMODAL, "Check", "The test Checkbox 5 is fine.", 10) EndIf The general idea is I got 5 messages set in a *.ini file i want to select spam them only if the checkbox is checked. but my probleme is here : How to spam only Message 1 and 5 if there is only these checkbox checked Here is the complete script (not finished) expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.12.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.12.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> HotKeySet("{PAUSE}", "Pause") HotKeySet("{F1}", "Exite") Global $Paused Global $Gamesnumber = 0 Global $sComboRead = "" ;$Picture = @ScriptDir & "\spyfurryMINI.jpg" Global $SettingsFile = @SCRIPTDIR & '\Settings.ini' $Setting1 = IniRead ($SettingsFile, 'Stats', 'Utilisation', "ERROR") $Setting2 = IniRead ($SettingsFile, 'Optionnel', 'Folder1', "ERROR") $Setting3 = IniRead ($SettingsFile, 'Message', 'Message1', "ERROR") $Setting4 = IniRead ($SettingsFile, 'Message', 'Message2', "ERROR") $Setting5 = IniRead ($SettingsFile, 'Message', 'Message3', "ERROR") $Setting6 = IniRead ($SettingsFile, 'Message', 'Message4', "ERROR") $Setting7 = IniRead ($SettingsFile, 'Message', 'Message5', "ERROR") $Setting8 = IniRead ($SettingsFile, 'Pause', 'Temps', "ERROR") $UID1= IniRead ($SettingsFile, 'User', 'User1', "ERROR") $UID2= IniRead ($SettingsFile, 'User', 'User2', "ERROR") $Password1 = IniRead ($SettingsFile, 'User', 'Password1', "ERROR") $Password2 = IniRead ($SettingsFile, 'User', 'Password2', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation',$Setting1+1) ;~ GUICreate================================================== Local $hGUI = GUICreate("Example", 500, 500) Local $Label1 = GUICtrlCreateLabel ("Entrez le texte a répéter",10,10) Local $Input1 = GUICtrlCreateInput ("",10,40,480,20) Local $Boutton2= GUICtrlCreateButton ("Set Message",400,70) Local $Label2 = GUICtrlCreateLabel ("Pause a respecté",10,70) Local $Input2 = GUICtrlCreateInput (""&$Setting8,10,100,100,20) Local $Boutton1 = GUICtrlCreateButton ("Set Nombres",400,250) Local $CheckMessage1 = GUICtrlCreateCheckbox ("Message 1" ,10, 230) Local $CheckMessage2 = GUICtrlCreateCheckbox ("Message 2" ,100, 230) Local $CheckMessage3 = GUICtrlCreateCheckbox ("Message 3" ,190, 230) Local $CheckMessage4 = GUICtrlCreateCheckbox ("Message 4" ,280, 230) Local $CheckMessage5 = GUICtrlCreateCheckbox ("Message 5" ,370, 230) Local $Liste = GUICtrlCreateCombo("Message 1", 10, 10, 185, 20) Local $Boutton3 = GUICtrlCreateButton ("Start",220,450) GUISetState(@SW_SHOW) GUICtrlSetData($Liste, "Message 2|Message 3|Message 4|Message 5") ;~ GUICreate/================================================= While (1) hGui () WEnd Func hGui () While 1 Sleep(10) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Liste ; Combot liste $sComboRead = GUICtrlRead($Liste) MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead, 0, $hGUI) If $sComboRead = "Message 1" Then $Read= IniRead ($SettingsFile, 'Message', 'Message1', "ERROR") ElseIf $sComboRead = "Message 2" Then $Read= IniRead ($SettingsFile, 'Message', 'Message2', "ERROR") ElseIf $sComboRead = "Message 3" Then $Read= IniRead ($SettingsFile, 'Message', 'Message3', "ERROR") ElseIf $sComboRead = "Message 4" Then $Read= IniRead ($SettingsFile, 'Message', 'Message4', "ERROR") ElseIf $sComboRead = "Message 5" Then $Read= IniRead ($SettingsFile, 'Message', 'Message5', "ERROR") EndIf GUICtrlSetData ( $Input1, $Read ) Case $Boutton1 ; Selection nombre message While (1) If _IsChecked($CheckMessage1) Then MsgBox($MB_SYSTEMMODAL, "Check", "The test Checkbox 1 is fine.", 10) EndIf If _IsChecked($CheckMessage2) Then MsgBox($MB_SYSTEMMODAL, "Check", "The test Checkbox 2 is fine.", 10) EndIf If _IsChecked($CheckMessage3) Then MsgBox($MB_SYSTEMMODAL, "Check", "The test Checkbox 3 is fine.", 10) EndIf If _IsChecked($CheckMessage4) Then MsgBox($MB_SYSTEMMODAL, "Check", "The test Checkbox 4 is fine.", 10) EndIf If _IsChecked($CheckMessage5) Then MsgBox($MB_SYSTEMMODAL, "Check", "The test Checkbox 5 is fine.", 10) EndIf ExitLoop WEnd Case $Boutton2 ; Start EndSwitch WEnd EndFunc Func Sleep1() Sleep(1000) EndFunc Func Sleep2() Sleep(1000) EndFunc Func Spam() Sleep(1000) EndFunc Func Exite () Exit EndFunc Func Pause() $Paused = NOT $Paused While $Paused Sleep (500) WEnd EndFunc; => Pause() Func _IsChecked($idControlID) ;==>Detection d'une box checker Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked 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 May 9, 2016 Moderators Share Posted May 9, 2016 caramen, And just why do you want to spam these messages? 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 May 9, 2016 Author Share Posted May 9, 2016 (edited) For multiple usage. To unswer to your question this script dont have any use yet. I want to improve my bank of script exemple for show them when i got work meeting. So that's why i am dev without any needs. It can be used in very very very loooooooot of cases.... EDIT: And ofc i use autoit forum since long, so i know why you ask that question. And no, it s not for that purpose..... but yes it can be used for that too... like almost all script i guess. Edited May 9, 2016 by caramen Again more information about my dev purpose 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 May 9, 2016 Moderators Share Posted May 9, 2016 caramen, Quote this script dont have any use yet but yes it can be used for that too So as there is no real need for this script and it could well be used for "that too", I am closing the thread. 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...
Recommended Posts