Silas Posted August 19, 2018 Posted August 19, 2018 (edited) Hello everyone, First, watch the screenshot I attached: The background beneath the radios is that a value is subtracted from Player 1, and added to player 2, in the case of the screenshot I made. You can see that I created 2 radio groups. On the upper part, radio 1 and 2, and on the lower part radio 5 and 6. Now I automated the buttons in such a way ,that when in group 1 player 1 is selected, player 2 in group 2 automatically gets checked for you. Same thing when checking player 2 in the upper part: player 1 gets checked on the lower part. I did this because there is no reason selecting player 1 or 2 twice, because nothing will change. Now that runs smoothly using this script: If GUICtrlRead($Radio1)=1 And Not BitAND(GUICtrlGetState($Radio6),1) And Not BitAND(GUICtrlGetState($Radio5),1) Then GUICtrlSetState($Radio6,1) If GUICtrlRead($Radio2)=1 And Not BitAND(GUICtrlGetState($Radio5),1) And Not BitAND(GUICtrlGetState($Radio6),1) Then GUICtrlSetState($Radio5,1) If GUICtrlRead($Radio5)=1 And Not BitAND(GUICtrlGetState($Radio2),1) And Not BitAND(GUICtrlGetState($Radio1),1) Then GUICtrlSetState($Radio2,1) If GUICtrlRead($Radio6)=1 And Not BitAND(GUICtrlGetState($Radio1),1) And Not BitAND(GUICtrlGetState($Radio2),1) Then GUICtrlSetState($Radio1,1) But there is a problem when clicking on a radio in group 2, the lower one. It is very hard to check one, because for some reason the radio get's deselected instantly most of the time. I already tried to prevent it by using the second BitAND() in the codes I shared (It doesn't check the radio automatically if the other radio in the other group is selected, meaning that the user want's to switch the radios). But it didn't work. Does somebody know why you sometimes can't check radio 5 or 6 (the lower part)? Edited August 19, 2018 by Silas
careca Posted August 19, 2018 Posted August 19, 2018 Is there a reproducible script for us to test? This has a lot of conditions and probably when you click the lower group one of the conditions acts on it, you have to be smart about the way you place the conditions, for one, instead of checking if X box is NOT checked and Y is NOT checked, maybe check only one of them and mark the other one regardless of it being marked or not. I don't know if the idea was well passed but in my head it makes sense. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
mikell Posted August 19, 2018 Posted August 19, 2018 1 hour ago, Silas said: for some reason the radio get's deselected instantly most of the time Radios 5 and 6 are slaves, and this looks like a continuous checking (maybe in a While loop ?) Such an automated checking should be done only when a button is clicked. Could you post a little reproducer as careca suggested to make things easier ?
FrancescoDiMuro Posted August 20, 2018 Posted August 20, 2018 (edited) @Silas, @careca, @mikell What about WM_COMMAND? Spoiler expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= Global $frmMainForm = GUICreate("A Form", 236, 162, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitApplication") Global $grpGroup1 = GUICtrlCreateGroup("Group 1", 17, 20, 201, 57) GUICtrlSetFont(-1, 10, 800, 0, "Arial") Global $radPlayer1_1 = GUICtrlCreateRadio("Player 1", 23, 46, 73, 17) Global $radPlayer2_1 = GUICtrlCreateRadio("Player 2", 135, 46, 73, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) Global $grpGroup2 = GUICtrlCreateGroup("Group 2", 17, 84, 201, 57) GUICtrlSetFont(-1, 10, 800, 0, "Arial") Global $radPlayer1_2 = GUICtrlCreateRadio("Player 1", 23, 110, 73, 17) Global $radPlayer2_2 = GUICtrlCreateRadio("Player 2", 135, 110, 73, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW, $frmMainForm) #EndRegion ### END Koda GUI section ### GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 Sleep(100) WEnd Func ExitApplication() Exit EndFunc Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $hdlWindow, _ $intControlID_From, _ $intMessageCode $intControlID_From = BitAND($wParam, 0xFFFF) $intMessageCode = BitShift($wParam, 16) Switch $intMessageCode Case $BN_CLICKED Switch $intControlID_From ; Clicking on Player 1 - Group 1 : Set Player 2 - Group 2 to 1 Case $radPlayer1_1 GUICtrlSetState($radPlayer2_2, 1) ; Clicking on Player 2 - Group 1 : Set Player 1 - Group 2 to 1 Case $radPlayer2_1 GUICtrlSetState($radPlayer1_2, 1) ; Clicking on Player 1 - Group 2 : Set Player 2 - Group 1 to 1 Case $radPlayer1_2 GUICtrlSetState($radPlayer2_1, 1) ; Clicking on Player 2 - Group 2 : Set Player 1 - Group 1 to 1 Case $radPlayer2_2 GUICtrlSetState($radPlayer1_1, 1) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Edited August 20, 2018 by FrancescoDiMuro careca 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
careca Posted August 20, 2018 Posted August 20, 2018 Thats good Francesco! FrancescoDiMuro 1 Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
mikell Posted August 20, 2018 Posted August 20, 2018 2 hours ago, FrancescoDiMuro said: What about WM_COMMAND? Could be a good idea, but let's try the simple (usual) way first FrancescoDiMuro 1
Silas Posted August 20, 2018 Author Posted August 20, 2018 (edited) Alright, I tried to copy paste some things, but the script looks really weird without the context. expandcollapse popup#include <ButtonConstants.au3> ;===========Includers #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <EditConstants.au3> #include <Misc.au3> $WBreedte = 306 ;width $WHoogte = 165 ;height Global $Window = GUICreate("MonoBank - Start", $WBreedte, $WHoogte, @DesktopWidth / 2 - ($WBreedte / 2), @DesktopHeight / 2 - ($WHoogte / 2), $GUI_SS_DEFAULT_GUI) GUISetFont(12, 400, 0, "Arial") GUISetState(@SW_SHOW) ;==== I only added this old window so that the following codes still work $Spelers=2 $Speler1=1 $Speler2=1 $Geld1=1500 $Geld2=1500 ;== Variables used later in this script Global $WhileH = 1 ;(Part of bigger thing in the whole script) Global $SpelersOver = 2 #Region ;Al het toevoegen (all the creating of the GUI) Global $Startbedrag = 1500 Global $Einde = False $WBreedte =508 $WHoogte = 360 $X_Undo = 218 $X_Input = 271 $X_Transfer = 418 Global $Spelend1 = 1 Global $Spelend2 = 1 WinMove($Window, "", @DesktopWidth / 2 - ($WBreedte / 2), @DesktopHeight / 2 - ($WHoogte / 2), $WBreedte, $WHoogte) Global $Zender1 = GUICtrlCreateLabel($Speler1, 222, 52, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0x4286f4) Global $Zender2 = GUICtrlCreateLabel($Speler2, 360, 52, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0xea3838) Global $GeldStatus1 = GUICtrlCreateLabel("?" & $Geld1, 222, 18, 105, 31, $SS_CENTER) GUICtrlSetFont(-1, 18, 400, 0, "Arial") Global $GeldStatus2 = GUICtrlCreateLabel("?" & $Geld2, 360, 18, 105, 31, $SS_CENTER) GUICtrlSetFont(-1, 18, 400, 0, "Arial") Global $Ontvanger1 = GUICtrlCreateLabel($Speler1, 222, 241, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0x4286f4) Global $Ontvanger2 = GUICtrlCreateLabel($Speler2, 360, 241, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0xea3838) GUIStartGroup() Global $Radio1 = GUICtrlCreateRadio("", 266, 99, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) Global $Radio2 = GUICtrlCreateRadio("", 404, 99, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) GUIStartGroup() Global $Radio5 = GUICtrlCreateRadio("", 266, 288, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) Global $Radio6 = GUICtrlCreateRadio("", 404, 288, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) Global $Input = GUICtrlCreateInput("", $X_Input, 153, 144, 50, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER,$WS_GROUP)) GUICtrlSetFont(-1, 28, 400, 0, "Arial") GUICtrlSetCursor (-1, 5) GUICtrlSetLimit(-1, 6) Global $Button_Transfer = GUICtrlCreateButton("OK", $X_Transfer, 153, 50, 50, BitOR($WS_GROUP, $BS_DEFPUSHBUTTON)) GUICtrlSetCursor(-1, 0) Global $Button_Undo = GUICtrlCreateButton("<", $X_Undo, 153, 50, 50, $WS_GROUP) GUICtrlSetCursor(-1, 0) #EndRegion (creating GUI) While $WhileH $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_Transfer If GUICtrlRead($Input)= Not "" And $Einde = False Then ;Transfer() EndIf ; Case $Button_Undo ; Sumsing ;Case $Button_Return ; MsgBox(4, "Waarschuwing", "Als je teruggaat, verlies je alle voortgang en krijgt iedereen weer het standaard bedrag." & @CRLF & "Wil je doorgaan?") ;Warning box. About losing progress ; Start() EndSwitch If $SpelersOver=2 Then If $Spelers=2 Then If GUICtrlRead($Radio1)=1 And Not BitAND(GUICtrlGetState($Radio6),1) And Not BitAND(GUICtrlGetState($Radio5),1) Then GUICtrlSetState($Radio6,1) If GUICtrlRead($Radio2)=1 And Not BitAND(GUICtrlGetState($Radio5),1) And Not BitAND(GUICtrlGetState($Radio6),1) Then GUICtrlSetState($Radio5,1) If GUICtrlRead($Radio5)=1 And Not BitAND(GUICtrlGetState($Radio2),1) And Not BitAND(GUICtrlGetState($Radio1),1) Then GUICtrlSetState($Radio2,1) If GUICtrlRead($Radio6)=1 And Not BitAND(GUICtrlGetState($Radio1),1) And Not BitAND(GUICtrlGetState($Radio2),1) Then GUICtrlSetState($Radio1,1) EndIf EndIf WEnd If some things aren't clear: here's the whole script. expandcollapse popup;Ideeën: ; - Bij instellen namen, kies ook pion/naam van pion, en kleur? ; - Startbedrag ; - Beginscherm en namen ook groter font maken, zodat iedereen het goed kan lezen ; - Terugknop omzetten in pijl terug: ;$Pic_Return = GUICtrlCreateIcon("C:\Users\Silas\Desktop\Terugknop.bmp", 0, 0,40,20) ;If @error Then ;MsgBox(0, "", @error) ; EndIf ; - Versimpel script (duidelijker maken, uitleggen, maak van Namen2-4 1 func etc ; - De naam en radio samenvoegen in 1, doorzichtige knop ; - Leg script uit met dit soort tekst #include <ButtonConstants.au3> ;===========Includers #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <EditConstants.au3> #include <Misc.au3> Start() Func Start() ;===========Startscherm (hoeveel spelers er zijn) $WBreedte = 306 $WHoogte = 165 Global $Window = GUICreate("MonoBank - Start", $WBreedte, $WHoogte, @DesktopWidth / 2 - ($WBreedte / 2), @DesktopHeight / 2 - ($WHoogte / 2), $GUI_SS_DEFAULT_GUI) GUISetFont(12, 400, 0, "Arial") Global $Label_Spelers = GUICtrlCreateLabel("Welkom, met hoeveel spelers zijn jullie?", 16, 16, 277, 22) Global $Radio2 = GUICtrlCreateRadio("2 Spelers", 32, 56, 113, 17) GUICtrlSetCursor(-1, 0) Global $Radio3 = GUICtrlCreateRadio("3 Spelers", 32, 88, 113, 17) GUICtrlSetCursor(-1, 0) Global $Radio4 = GUICtrlCreateRadio("4 Spelers", 32, 120, 113, 17) GUICtrlSetCursor(-1, 0) Global $Button_Next = GUICtrlCreateButton("Volgende", 184, 125, 97, 25, $BS_DEFPUSHBUTTON) GUICtrlSetFont(-1, 11, 400, 0, "Arial") GUICtrlSetCursor(-1, 0) GUISetState(@SW_SHOW) Global $While1=1 While $While1 ;===========Wat te doen bij startscherm $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_Next If GUICtrlRead($Radio2) = 1 or GUICtrlRead($Radio3) = 1 or GUICtrlRead($Radio4) = 1 Then Ctr_Radio() ;Verwijst naar controle van de opties Else MsgBox($MB_OK, "Niet zo snel", "Voer eerst in met hoeveel spelers jullie zijn") ;Foutmelding EndIf EndSwitch Wend EndFunc ;==>Start Func Ctr_Radio() ;===========Controlleert welke optie gekozen is, en verwijst door naar toepassende venster If GUICtrlRead($Radio2) = 1 Then Global $Spelers = 2 Namen2() ElseIf GUICtrlRead($Radio3) = 1 Then Global $Spelers = 3 Namen3() ElseIf GUICtrlRead($Radio4) = 1 Then Global $Spelers = 4 Namen4() Else MsgBox($MB_OK, "Hosuton, we got a problem", "Er kon niet gelezen worden welke optie je gekozen hebt." & @CRLF & "Foutcode: " & @error) ;Foutmelding, lijkt me duidelijk EndIf EndFunc ;==>Ctr_Radio Func Namen2() ;===========Venster waarbij je namen kiest voor 2 spelers WinSetTitle($Window, "", "MonoBank - Namen") GUICtrlDelete($Label_Spelers) GUICtrlDelete($Radio2) GUICtrlDelete($Radio3) GUICtrlDelete($Radio4) GUICtrlDelete($Button_Next) Global $Label_Namen = GUICtrlCreateLabel("Hoe zal ik jullie noemen?", 71, 15) Global $Label1 = GUICtrlCreateLabel("Speler 1", 62, 64, 63, 22, $WS_GROUP) GUICtrlSetColor(-1, 0x4286f4) Global $Input1 = GUICtrlCreateInput("", 38, 90, 105, 24, BitOR($ES_AUTOHSCROLL, $WS_GROUP)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetCursor(-1, 5) Global $Label2 = GUICtrlCreateLabel("Speler 2", 198, 64, 63, 22, $WS_GROUP) GUICtrlSetColor(-1, 0xea3838) Global $Input2 = GUICtrlCreateInput("", 174, 90, 105, 24, BitOR($ES_AUTOHSCROLL, $WS_GROUP)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetCursor(-1, 5) Global $Button_Next = GUICtrlCreateButton("Start", 306 / 2 - 42, 125, 97, 25, $BS_DEFPUSHBUTTON) GUICtrlSetFont(-1, 11, 400, 0, "Arial") GUICtrlSetCursor(-1, 0) Global $Button_Return = GUICtrlCreateButton("<", 0, 0, 25, 25, $WS_GROUP) GUICtrlSetFont(-1, 11, 400, 0, "Arial") GUICtrlSetCursor(-1, 0) Global $While1 = 0 Global $While2 = 1 While $While2 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit ;Case $Button_Return ; Start() Case $Button_Next If GUICtrlRead($Input1) = "" and GUICtrlRead($Input2) = "" Then MsgBox(0, "Niet zo snel", "Ik ken niemand die geen naam heeft") ElseIf GUICtrlRead($Input1) = "" Or GUICtrlRead($Input2) = "" Then MsgBox(0, "Niet zo snel", "Je moet wel voor beide personen een naam invoeren") Else Global $Speler1 = GUICtrlRead($Input1) Global $Speler2 = GUICtrlRead($Input2) Hoofdscherm() EndIf EndSwitch WEnd EndFunc ;==>Namen2 Func Namen3() ;===========Venster waarbij je namen kiest voor 3 spelers $WBreedte = 423 $WHoogte = 220 WinMove($Window, "", @DesktopWidth / 2 - ($WBreedte / 2), @DesktopHeight / 2 - ($WHoogte / 2), $WBreedte, $WHoogte) WinSetTitle($Window, "", "MonoBank - Namen") GUICtrlDelete($Label_Spelers) GUICtrlDelete($Radio2) GUICtrlDelete($Radio3) GUICtrlDelete($Radio4) GUICtrlDelete($Button_Next) Global $Label_Namen = GUICtrlCreateLabel("Hoe zal ik jullie noemen?", 127, 24, 175, 22, $WS_GROUP) Global $Label1 = GUICtrlCreateLabel("Speler 1", 64, 64, 63, 22, $WS_GROUP) GUICtrlSetColor(-1, 0x4286f4) Global $Input1 = GUICtrlCreateInput("", 40, 96, 105, 24, BitOR($ES_AUTOHSCROLL, $WS_GROUP)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetCursor(-1, 5) Global $Label2 = GUICtrlCreateLabel("Speler 2", 184, 64, 63, 22, $WS_GROUP) GUICtrlSetColor(-1, 0xea3838) Global $Input2 = GUICtrlCreateInput("", 160, 96, 105, 24, BitOR($ES_AUTOHSCROLL, $WS_GROUP)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetCursor(-1, 5) Global $Label3 = GUICtrlCreateLabel("Speler 3", 304, 64, 63, 22, $WS_GROUP) GUICtrlSetColor(-1, 0x10cc38) Global $Input3 = GUICtrlCreateInput("", 281, 96, 105, 24, BitOR($ES_AUTOHSCROLL, $WS_GROUP)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetCursor(-1, 5) Global $Button_Next = GUICtrlCreateButton("Start", 166, 144, 97, 25, BitOR($WS_GROUP, $BS_DEFPUSHBUTTON)) GUICtrlSetFont(-1, 11, 400, 0, "Arial") GUICtrlSetCursor(-1, 0) Global $Button_Return = GUICtrlCreateButton("<", 0, 0, 25, 25, $WS_GROUP) GUICtrlSetFont(-1, 11, 400, 0, "Arial") GUICtrlSetCursor(-1, 0) Global $While1 = 0 Global $While2 = 1 While $While2 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_Next If GUICtrlRead($Input1) = "" and GUICtrlRead($Input2) = "" And GUICtrlRead($Input3) = "" Then MsgBox(0, "Niet zo snel", "Ik ken niemand die geen naam heeft") ElseIf GUICtrlRead($Input1) = "" Or GUICtrlRead($Input2) = "" Or GUICtrlRead($Input3) = "" Then MsgBox(0, "Niet zo snel", "Je moet wel alle namen invoeren") Else Global $Speler1 = GUICtrlRead($Input1) Global $Speler2 = GUICtrlRead($Input2) Global $Speler3 = GUICtrlRead($Input3) Hoofdscherm() EndIf EndSwitch WEnd EndFunc ;==>Namen3 Func Namen4() ;===========Venster waarbij je namen kiest voor 4 spelers $WBreedte = 546 $WHoogte = 220 WinMove($Window, "", @DesktopWidth / 2 - ($WBreedte / 2), @DesktopHeight / 2 - ($WHoogte / 2), $WBreedte, $WHoogte) WinSetTitle($Window, "", "MonoBank - Namen") GUICtrlDelete($Label_Spelers) GUICtrlDelete($Radio2) GUICtrlDelete($Radio3) GUICtrlDelete($Radio4) GUICtrlDelete($Button_Next) Global $Label_Namen = GUICtrlCreateLabel("Hoe zal ik jullie noemen?", 185, 24, 175, 22, $WS_GROUP) Global $Label1 = GUICtrlCreateLabel("Speler 1", 64, 64, 63, 22, $WS_GROUP) GUICtrlSetColor(-1, 0x4286f4) Global $Input1 = GUICtrlCreateInput("", 40, 96, 105, 24, BitOR($ES_AUTOHSCROLL, $WS_GROUP)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetCursor(-1, 5) Global $Label2 = GUICtrlCreateLabel("Speler 2", 184, 64, 63, 22, $WS_GROUP) GUICtrlSetColor(-1, 0xea3838) Global $Input2 = GUICtrlCreateInput("", 160, 96, 105, 24, BitOR($ES_AUTOHSCROLL, $WS_GROUP)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetCursor(-1, 5) Global $Label3 = GUICtrlCreateLabel("Speler 3", 304, 64, 63, 22, $WS_GROUP) GUICtrlSetColor(-1, 0x10cc38) Global $Input3 = GUICtrlCreateInput("", 281, 96, 105, 24, BitOR($ES_AUTOHSCROLL, $WS_GROUP)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetCursor(-1, 5) Global $Label4 = GUICtrlCreateLabel("Speler 4", 424, 64, 63, 22, $WS_GROUP) GUICtrlSetColor(-1, 0xdbd82b) Global $Input4 = GUICtrlCreateInput("", 402, 96, 105, 24, BitOR($ES_AUTOHSCROLL, $WS_GROUP)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetCursor(-1, 5) Global $Button_Next = GUICtrlCreateButton("Start", 224, 144, 97, 25, BitOR($WS_GROUP, $BS_DEFPUSHBUTTON)) GUICtrlSetFont(-1, 11, 400, 0, "Arial") GUICtrlSetCursor(-1, 0) Global $Button_Return = GUICtrlCreateButton("<", 0, 0, 25, 25, $WS_GROUP) GUICtrlSetFont(-1, 11, 400, 0, "Arial") GUICtrlSetCursor(-1, 0) Global $While1 = 0 Global $While2 = 1 While $While2 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_Next If GUICtrlRead($Input1) = "" And GUICtrlRead($Input2) = "" And GUICtrlRead($Input3) = "" And GUICtrlRead($Input4) = "" Then MsgBox(0, "Niet zo snel", "Ik ken niemand die geen naam heeft") ElseIf GUICtrlRead($Input1) = "" Or GUICtrlRead($Input2) = "" Or GUICtrlRead($Input3) = "" Or GUICtrlRead($Input4) = "" Then MsgBox(0, "Niet zo snel", "Je moet wel alle namen invoeren") Else Global $Speler1 = GUICtrlRead($Input1) Global $Speler2 = GUICtrlRead($Input2) Global $Speler3 = GUICtrlRead($Input3) Global $Speler4 = GUICtrlRead($Input4) Hoofdscherm() EndIf EndSwitch WEnd EndFunc ;==>Namen4 Func Hoofdscherm() ;===========Het venster waar het allemaal gebeurt #Region ;Al het verwijderen WinSetTitle($Window, "", "MonoBank") GUICtrlDelete($Button_Next) ;GUICtrlDelete($Button_Return) GUICtrlDelete($Label1) GUICtrlDelete($Label2) If IsDeclared("Label3") = Not 0 Then GUICtrlDelete($Label3) EndIf If IsDeclared("Label4") = Not 0 Then GUICtrlDelete($Label4) EndIf GUICtrlDelete($Input1) GUICtrlDelete($Input2) If IsDeclared("Input3") = Not 0 Then GUICtrlDelete($Input3) EndIf If IsDeclared("Input4") = Not 0 Then GUICtrlDelete($Input4) EndIf GUICtrlDelete($Label_Namen) ;============= Nu is alles prachtig mooi opgruimt #EndRegion #Region ;Al het toevoegen Global $Startbedrag = 1500 Global $Einde = False If $Spelers = 2 Then $WBreedte =508 $X_Undo = 218 $X_Input = 271 $X_Transfer = 418 Global $Geld1 = $Startbedrag Global $Geld2 = $Startbedrag Global $Spelend1 = 1 Global $Spelend2 = 1 ElseIf $Spelers = 3 Then $WBreedte = 623 $X_Undo = 288 $X_Input = 341 $X_Transfer = 488 Global $Geld1 = $Startbedrag Global $Geld2 = $Startbedrag Global $Geld3 = $Startbedrag Global $Spelend1 = 1 Global $Spelend2 = 1 Global $Spelend3 = 1 ElseIf $Spelers = 4 Then $WBreedte = 758 $X_Undo = 358 $X_Input = 411 $X_Transfer = 558 Global $Geld1 = $Startbedrag Global $Geld2 = $Startbedrag Global $Geld3 = $Startbedrag Global $Geld4 = $Startbedrag Global $Spelend1 = 1 Global $Spelend2 = 1 Global $Spelend3 = 1 Global $Spelend4 = 1 Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden geladen hoeveel spelers er zijn" & @CRLF & "Foutcode: " & @error) EndIf ;===================== Dit allemaal bepaalt de posities en andere dingen van bepaalde dingen, afhankelijk van het aantal spelers $WHoogte = 360 WinMove($Window, "", @DesktopWidth / 2 - ($WBreedte / 2), @DesktopHeight / 2 - ($WHoogte / 2), $WBreedte, $WHoogte) Global $Zender1 = GUICtrlCreateLabel($Speler1, 222, 52, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0x4286f4) Global $Zender2 = GUICtrlCreateLabel($Speler2, 360, 52, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0xea3838) If IsDeclared("Speler3") = Not 0 Then Global $Zender3 = GUICtrlCreateLabel($Speler3, 499, 52, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0x10cc38) EndIf Global $GeldStatus1 = GUICtrlCreateLabel("₩" & $Geld1, 222, 18, 105, 31, $SS_CENTER) GUICtrlSetFont(-1, 18, 400, 0, "Arial") Global $GeldStatus2 = GUICtrlCreateLabel("₩" & $Geld2, 360, 18, 105, 31, $SS_CENTER) GUICtrlSetFont(-1, 18, 400, 0, "Arial") If IsDeclared("Speler3") = Not 0 Then Global $GeldStatus3 = GUICtrlCreateLabel("₩" & $Geld3, 499, 18, 105, 31, $SS_CENTER) GUICtrlSetFont(-1, 18, 400, 0, "Arial") EndIf If IsDeclared("Speler4") = Not 0 Then Global $GeldStatus4 = GUICtrlCreateLabel("₩" & $Geld4, 637, 18, 105, 31, $SS_CENTER) GUICtrlSetFont(-1, 18, 400, 0, "Arial") EndIf If IsDeclared("Speler4") = Not 0 Then Global $Zender4 = GUICtrlCreateLabel($Speler4, 637, 52, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0xdbd82b) EndIf Global $Ontvanger1 = GUICtrlCreateLabel($Speler1, 222, 241, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0x4286f4) Global $Ontvanger2 = GUICtrlCreateLabel($Speler2, 360, 241, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0xea3838) If IsDeclared("Speler3") = Not 0 Then Global $Ontvanger3 = GUICtrlCreateLabel($Speler3, 499, 241, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0x10cc38) EndIf If IsDeclared("Speler4") = Not 0 Then Global $Ontvanger4 = GUICtrlCreateLabel($Speler4, 637, 241, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0xdbd82b) EndIf GUIStartGroup() Global $Radio1 = GUICtrlCreateRadio("", 266, 99, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) Global $Radio2 = GUICtrlCreateRadio("", 404, 99, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) If IsDeclared("Speler3") = Not 0 Then Global $Radio3 = GUICtrlCreateRadio("", 543, 99, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) EndIf If IsDeclared("Speler4") = Not 0 Then Global $Radio4 = GUICtrlCreateRadio("", 681, 99, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) EndIf GUIStartGroup() Global $Radio5 = GUICtrlCreateRadio("", 266, 288, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) Global $Radio6 = GUICtrlCreateRadio("", 404, 288, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) If IsDeclared("Speler3") = Not 0 Then Global $Radio7 = GUICtrlCreateRadio("", 543, 288, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) EndIf If IsDeclared("Speler4") = Not 0 Then Global $Radio8 = GUICtrlCreateRadio("", 681, 288, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) EndIf Global $Input = GUICtrlCreateInput("", $X_Input, 153, 144, 50, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER,$WS_GROUP)) GUICtrlSetFont(-1, 28, 400, 0, "Arial") GUICtrlSetCursor (-1, 5) GUICtrlSetLimit(-1, 6) Global $Button_Transfer = GUICtrlCreateButton("OK", $X_Transfer, 153, 50, 50, BitOR($WS_GROUP, $BS_DEFPUSHBUTTON)) GUICtrlSetCursor(-1, 0) Global $Button_Undo = GUICtrlCreateButton("<", $X_Undo, 153, 50, 50, $WS_GROUP) GUICtrlSetCursor(-1, 0) #EndRegion ;==================================================Doe een "veel plezier!" popup of zo, en ook zon soort popup in plaats van eens stom msgbox met WE HEBBEN EEN WINNAAR Global $While2 = 0 Global $WhileH = 1 If $Spelers = 2 Then Global $SpelersOver = 2 ElseIf $Spelers = 3 Then Global $SpelersOver = 3 ElseIf $Spelers = 4 Then Global $SpelersOver = 4 EndIf ;==> Dit stelt het de variable $Spelers in op het aantal spelers, zodat in de volgende while loop gechekt kan worden of er 2 spelers over zijn, waardoor de radio's zich slimmer gedragen While $WhileH $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_Transfer If GUICtrlRead($Input)= Not "" And $Einde = False Then Transfer() EndIf ; Case $Button_Undo ; Sumsing Case $Button_Return MsgBox(4, "Waarschuwing", "Als je teruggaat, verlies je alle voortgang en krijgt iedereen weer het standaard bedrag." & @CRLF & "Wil je doorgaan?") Start() EndSwitch If GuiCtrlRead($GeldStatus1) <> "₩" & $Geld1 Then GUICtrlSetData($GeldStatus1, "₩" & $Geld1) If GuiCtrlRead($GeldStatus2) <> "₩" & $Geld2 Then GUICtrlSetData($GeldStatus2, "₩" & $Geld2) If IsDeclared("Speler3") = Not 0 And GuiCtrlRead($GeldStatus3) <> "₩" & $Geld3 Then GUICtrlSetData($GeldStatus3, "₩" & $Geld3) If IsDeclared("Speler4") = Not 0 And GuiCtrlRead($GeldStatus4) <> "₩" & $Geld4 Then GUICtrlSetData($GeldStatus4, "₩" & $Geld4) ;============= Updatet de geldstatussen meteen als een bedrag verandert If $SpelersOver=2 Then If $Spelers=2 Then If GUICtrlRead($Radio1)=1 And Not BitAND(GUICtrlGetState($Radio6),1) And Not BitAND(GUICtrlGetState($Radio5),1) Then GUICtrlSetState($Radio6,1) If GUICtrlRead($Radio2)=1 And Not BitAND(GUICtrlGetState($Radio5),1) And Not BitAND(GUICtrlGetState($Radio6),1) Then GUICtrlSetState($Radio5,1) If GUICtrlRead($Radio5)=1 And Not BitAND(GUICtrlGetState($Radio2),1) And Not BitAND(GUICtrlGetState($Radio1),1) Then GUICtrlSetState($Radio2,1) If GUICtrlRead($Radio6)=1 And Not BitAND(GUICtrlGetState($Radio1),1) And Not BitAND(GUICtrlGetState($Radio2),1) Then GUICtrlSetState($Radio1,1) ElseIf $Spelers=3 Then Exit ElseIf $Spelers=4 Then Exit EndIf EndIf ;Laat de radios slim wisselen tussen de 2 spelers die over zijn ; If GUICtrlRead($Radio1)=1 And Not BitAND(GUICtrlGetState($Radio5), $GUI_DISABLE) Then GUICtrlSetState($Radio5, 128) ; If GUICtrlRead($Radio1)<>1 And Not BitAND(GUICtrlGetState($Radio5), $GUI_ENABLE) And $Spelend1 = 1 Then GUICtrlSetState($Radio5, 64) ; If GUICtrlRead($Radio5)=1 And Not BitAND(GUICtrlGetState($Radio1), $GUI_DISABLE) Then GUICtrlSetState($Radio1, 128) ; If GUICtrlRead($Radio5)<>1 And Not BitAND(GUICtrlGetState($Radio1), $GUI_ENABLE) And $Spelend1 = 1 Then GUICtrlSetState($Radio1, 64) ; ; If GUICtrlRead($Radio2)=1 And Not BitAND(GUICtrlGetState($Radio6), $GUI_DISABLE) Then GUICtrlSetState($Radio6, 128) ; If GUICtrlRead($Radio2)<>1 And Not BitAND(GUICtrlGetState($Radio6), $GUI_ENABLE) And $Spelend2 = 1 Then GUICtrlSetState($Radio6, 64) ; If GUICtrlRead($Radio6)=1 And Not BitAND(GUICtrlGetState($Radio2), $GUI_DISABLE) Then GUICtrlSetState($Radio2, 128) ; If GUICtrlRead($Radio6)<>1 And Not BitAND(GUICtrlGetState($Radio2), $GUI_ENABLE) And $Spelend2 = 1 Then GUICtrlSetState($Radio2, 64) ; ; If IsDeclared("Speler3") Then ; If GUICtrlRead($Radio3)=1 And Not BitAND(GUICtrlGetState($Radio7), $GUI_DISABLE) Then GUICtrlSetState($Radio7, 128) ; If GUICtrlRead($Radio3)<>1 And Not BitAND(GUICtrlGetState($Radio7), $GUI_ENABLE) And $Spelend3 = 1 Then GUICtrlSetState($Radio7, 64) ; If GUICtrlRead($Radio7)=1 And Not BitAND(GUICtrlGetState($Radio3), $GUI_DISABLE) Then GUICtrlSetState($Radio3, 128) ; If GUICtrlRead($Radio7)<>1 And Not BitAND(GUICtrlGetState($Radio3), $GUI_ENABLE) And $Spelend3 = 1 Then GUICtrlSetState($Radio3, 64) ; EndIf ; ; If IsDeclared("Speler4") Then ; If GUICtrlRead($Radio4)=1 And Not BitAND(GUICtrlGetState($Radio8), $GUI_DISABLE) Then GUICtrlSetState($Radio8, 128) ; If GUICtrlRead($Radio4)<>1 And Not BitAND(GUICtrlGetState($Radio8), $GUI_ENABLE) And $Spelend4 = 1 Then GUICtrlSetState($Radio8, 64) ; If GUICtrlRead($Radio8)=1 And Not BitAND(GUICtrlGetState($Radio4), $GUI_DISABLE) Then GUICtrlSetState($Radio4, 128) ; If GUICtrlRead($Radio8)<>1 And Not BitAND(GUICtrlGetState($Radio4), $GUI_ENABLE) And $Spelend4 = 1 Then GUICtrlSetState($Radio4, 64) ; EndIf ; ;============= Schakelt botsende radio's uit WEnd EndFunc Func Transfer() ;====== Kijkt welke zender is geselecteerd > berekent kosten > bekijkt welke ontvanger is geselecteerd > berekent inkomen en ondertussen checkt hij wanneer iemand gewonnen heeft $GeldErbij = GUICtrlRead($Input) $Schulden1 = False If GUICtrlRead($Radio1) = 1 Then $Result = $Geld1 - $GeldErbij $PreTransfer = $Geld1 Global $Geld1 = $Result ;===> Berekent de transactie $Failliet = 0 ;Nodig bij het bepalen of iemand failliet is (Begint bij de volgende regel) If $Geld1 < 0 Then $Schulden1 = True $GeldErbij = $PreTransfer ;Zorgt ervoor dat bij het overmaken aan de ander (zie beneden deze if's), dat de debtor alleen het geld krijgt die de schuldige ook echt heeft $Failliet = MsgBox(4, "Failliet", $Speler1 & " staat op dit moment in het rood." & @CRLF & "Wil je deze speler failliet verklaren?" & @CRLF & "(Als je op nee drukt, wordt het balans van " & $Speler1 & " teruggezet naar 0.") If $Spelers = 2 Then If $Failliet = 6 Then ;Als de speler op ja drukte bij vorige MsgBox GUICtrlSetState($Radio2, 1) GUICtrlSetState($Radio1, 128) GUICtrlSetState($Zender1, 128) GUICtrlSetState($Ontvanger1, 128) GUICtrlSetState($GeldStatus1, 128) GUICtrlSetState($Radio5, 128) $Spelend1 = 0 $Einde = True MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler2 & "!") ElseIf $Failliet = 7 Then ;Als de speler op nee drukte $Geld1 = 0 Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden gelezen welke optie u gekozen heeft" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox1.1") ;Ik label elke msgbox die een foutcode geeft op deze manier, dan kun je makkelijker vinden waar de fout zich voordeet EndIf ElseIf $Spelers = 3 Then If $Failliet = 6 Then ;Als de speler op ja drukte bij vorige MsgBox GUICtrlSetState($Zender1, 128) GUICtrlSetState($Ontvanger1, 128) GUICtrlSetState($GeldStatus1, 128) GUICtrlSetState($Radio5, 128) $Spelend1 = 0 If $Spelend2 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio2, 1) GUICtrlSetState($Radio1, 128) ElseIf $Spelend3 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio3, 1) GUICtrlSetState($Radio1, 128) EndIf If $Spelend3 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler2 & "!") $Einde = True ElseIf $Spelend2 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler3 & "!") $Einde = True EndIf ElseIf $Failliet = 7 Then ;Als de speler op nee drukte $Geld1 = 0 Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden gelezen welke optie u gekozen heeft" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox1.2") EndIf ElseIf $Spelers = 4 Then If $Failliet = 6 Then ;Als de speler op ja drukte bij vorige MsgBox GUICtrlSetState($Zender1, 128) GUICtrlSetState($Ontvanger1, 128) GUICtrlSetState($GeldStatus1, 128) GUICtrlSetState($Radio5, 128) $Spelend1 = 0 If $Spelend2 = 1 Then ;Hier checkedt(vinkt) hij de Radio die nog overblijft GUICtrlSetState($Radio2, 1) GUICtrlSetState($Radio1, 128) ElseIf $Spelend3 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio3, 1) GUICtrlSetState($Radio1, 128) ElseIf $Spelend4 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio4, 1) GUICtrlSetState($Radio1, 128) EndIf If $Spelend3 = 0 And $Spelend4 = 0 Then ;Hier checkt hij of iemand gewonnen heeft MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler2 & "!") $Einde = True ElseIf $Spelend2 = 0 And $Spelend4 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler3 & "!") $Einde = True ElseIf $Spelend2 = 0 And $Spelend3 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler4 & "!") $Einde = True EndIf ElseIf $Failliet = 7 Then ;Als de speler op nee drukte $Geld1 = 0 Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden gelezen welke optie u gekozen heeft" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox1.3") EndIf Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden geladen hoeveel mensen er zijn" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox1.4") EndIf EndIf If GUICtrlRead($Radio5) = 1 Then $Result = $Geld1 + $GeldErbij Global $Geld1 = $Result ElseIf GUICtrlRead($Radio6) = 1 Then $Result = $Geld2 + $GeldErbij Global $Geld2 = $Result ElseIf IsDeclared("Speler3") = Not 0 And GUICtrlRead($Radio7) = 1 Then $Result = $Geld3 + $GeldErbij Global $Geld3 = $Result ElseIf IsDeclared("Speler4") = Not 0 And GUICtrlRead($Radio8) = 1 Then $Result = $Geld4 + $GeldErbij Global $Geld4 = $Result Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden geladen welke radioknop is geselecteerd" & @CRLF & "bij een van de secties bij het toevoegen van het bedrag." & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox1.5") EndIf ElseIf GUICtrlRead($Radio2) = 1 Then $Result = $Geld2 - $GeldErbij $PreTransfer = $Geld2 Global $Geld2 = $Result ;===> Berekent de transactie $Failliet = 0 ;Nodig bij het bepalen of iemand failliet is (Begint bij de volgende regel) If $Geld2 < 0 Then $Schulden2 = True $GeldErbij = $PreTransfer ;Zorgt ervoor dat bij het overmaken aan de ander (zie beneden deze if's), dat de debtor alleen het geld krijgt die de schuldige ook echt heeft $Failliet = MsgBox(4, "Failliet", $Speler2 & " staat op dit moment in het rood." & @CRLF & "Wil je deze speler failliet verklaren?" & @CRLF & "(Als je op nee drukt, wordt het balans van " & $Speler2 & " teruggezet naar 0.") If $Spelers = 2 Then If $Failliet = 6 Then ;Als de speler op ja drukte bij vorige MsgBox GUICtrlSetState($Radio1, 1) GUICtrlSetState($Radio2, 128) GUICtrlSetState($Radio6, 128) GUICtrlSetState($Zender2, 128) GUICtrlSetState($Ontvanger2, 128) GUICtrlSetState($GeldStatus2, 128) $Spelend2 = 0 $Einde = True MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler1 & "!") ElseIf $Failliet = 7 Then ;Als de speler op nee drukte $Geld2 = 0 Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden gelezen welke optie u gekozen heeft" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox2.1") EndIf ElseIf $Spelers = 3 Then If $Failliet = 6 Then ;Als de speler op ja drukte bij vorige MsgBox GUICtrlSetState($Zender2, 128) GUICtrlSetState($Ontvanger2, 128) GUICtrlSetState($GeldStatus2, 128) GUICtrlSetState($Radio6, 128) $Spelend2 = 0 If $Spelend1 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio1, 1) GUICtrlSetState($Radio2, 128) ElseIf $Spelend3 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio3, 1) GUICtrlSetState($Radio2, 128) EndIf If $Spelend3 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler1 & "!") $Einde = True ElseIf $Spelend1 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler3 & "!") $Einde = True EndIf ElseIf $Failliet = 7 Then ;Als de speler op nee drukte $Geld2 = 0 Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden gelezen welke optie u gekozen heeft" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox2.2") EndIf ElseIf $Spelers = 4 Then If $Failliet = 6 Then ;Als de speler op ja drukte bij vorige MsgBox GUICtrlSetState($Zender2, 128) GUICtrlSetState($Ontvanger2, 128) GUICtrlSetState($GeldStatus2, 128) GUICtrlSetState($Radio6, 128) $Spelend2 = 0 If $Spelend1 = 1 Then ;Hier checkedt(vinkt) hij de Radio die nog overblijft GUICtrlSetState($Radio1, 1) GUICtrlSetState($Radio2, 128) ElseIf $Spelend3 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio3, 1) GUICtrlSetState($Radio2, 128) ElseIf $Spelend4 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio4, 1) GUICtrlSetState($Radio2, 128) EndIf If $Spelend3 = 0 And $Spelend4 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler1 & "!") $Einde = True ElseIf $Spelend1 = 0 And $Spelend4 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler3 & "!") $Einde = True ElseIf $Spelend1 = 0 And $Spelend3 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler4 & "!") $Einde = True EndIf ElseIf $Failliet = 7 Then ;Als de speler op nee drukte $Geld2 = 0 Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden gelezen welke optie u gekozen heeft" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox2.3") EndIf Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden geladen hoeveel mensen er zijn" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox2.4") EndIf EndIf If GUICtrlRead($Radio5) = 1 Then $Result = $Geld1 + $GeldErbij Global $Geld1 = $Result ElseIf GUICtrlRead($Radio6) = 1 Then $Result = $Geld2 + $GeldErbij Global $Geld2 = $Result ElseIf IsDeclared("Speler3") = Not 0 And GUICtrlRead($Radio7) = 1 Then $Result = $Geld3 + $GeldErbij Global $Geld3 = $Result ElseIf IsDeclared("Speler4") = Not 0 And GUICtrlRead($Radio8) = 1 Then $Result = $Geld4 + $GeldErbij Global $Geld4 = $Result Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden geladen welke radioknop is geselecteerd" & @CRLF & "bij een van de secties bij het toevoegen van het bedrag." & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox2.5") EndIf ElseIf GUICtrlRead($Radio3) = 1 Then $Result = $Geld3 - $GeldErbij $PreTransfer = $Geld3 Global $Geld3 = $Result ;===> Berekent de transactie $Failliet = 0 ;Nodig bij het bepalen of iemand failliet is (Begint bij de volgende regel) If $Geld3 < 0 Then $Schulden3 = True $GeldErbij = $PreTransfer ;Zorgt ervoor dat bij het overmaken aan de ander (zie beneden deze if's), dat de debtor alleen het geld krijgt die de schuldige ook echt heeft $Failliet = MsgBox(4, "Failliet", $Speler3 & " staat op dit moment in het rood." & @CRLF & "Wil je deze speler failliet verklaren?" & @CRLF & "(Als je op nee drukt, wordt het balans van " & $Speler3 & " teruggezet naar 0.") If $Spelers = 3 Then If $Failliet = 6 Then ;Als de speler op ja drukte bij vorige MsgBox GUICtrlSetState($Zender3, 128) GUICtrlSetState($Ontvanger3, 128) GUICtrlSetState($GeldStatus3, 128) GUICtrlSetState($Radio7, 128) $Spelend3 = 0 If $Spelend1 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio1, 1) GUICtrlSetState($Radio3, 128) ElseIf $Spelend2 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio2, 1) GUICtrlSetState($Radio3, 128) EndIf If $Spelend2 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler1 & "!") $Einde = True ElseIf $Spelend1 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler2 & "!") $Einde = True EndIf ElseIf $Failliet = 7 Then ;Als de speler op nee drukte $Geld3 = 0 Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden gelezen welke optie u gekozen heeft" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox3.1") EndIf ElseIf $Spelers = 4 Then If $Failliet = 6 Then ;Als de speler op ja drukte bij vorige MsgBox GUICtrlSetState($Zender3, 128) GUICtrlSetState($Ontvanger3, 128) GUICtrlSetState($GeldStatus3, 128) GUICtrlSetState($Radio7, 128) $Spelend3 = 0 If $Spelend4 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio4, 1) GUICtrlSetState($Radio3, 128) ElseIf $Spelend2 = 1 Then ;Hier checkedt hij de Radio die nog overblijft GUICtrlSetState($Radio2, 1) GUICtrlSetState($Radio3, 128) ElseIf $Spelend1 = 1 Then ;Hier checkedt(vinkt) hij de Radio die nog overblijft GUICtrlSetState($Radio1, 1) GUICtrlSetState($Radio3, 128) EndIf If $Spelend2 = 0 And $Spelend4 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler1 & "!") $Einde = True ElseIf $Spelend1 = 0 And $Spelend4 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler2 & "!") $Einde = True ElseIf $Spelend1 = 0 And $Spelend2 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler4 & "!") $Einde = True EndIf ElseIf $Failliet = 7 Then ;Als de speler op nee drukte $Geld3 = 0 Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden gelezen welke optie u gekozen heeft" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox3.2") EndIf Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden geladen hoeveel mensen er zijn" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox3.3") EndIf EndIf If GUICtrlRead($Radio5) = 1 Then $Result = $Geld1 + $GeldErbij Global $Geld1 = $Result ElseIf GUICtrlRead($Radio6) = 1 Then $Result = $Geld2 + $GeldErbij Global $Geld2 = $Result ElseIf IsDeclared("Speler3") = Not 0 And GUICtrlRead($Radio7) = 1 Then $Result = $Geld3 + $GeldErbij Global $Geld3 = $Result ElseIf IsDeclared("Speler4") = Not 0 And GUICtrlRead($Radio8) = 1 Then $Result = $Geld4 + $GeldErbij Global $Geld4 = $Result Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden geladen welke radioknop is geselecteerd" & @CRLF & "bij een van de secties bij het toevoegen van het bedrag." & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox3.4") EndIf ElseIf GUICtrlRead($Radio4) = 1 Then $Result = $Geld4 - $GeldErbij $PreTransfer = $Geld4 Global $Geld4 = $Result ;===> Berekent de transactie $Failliet = 0 ;Nodig bij het bepalen of iemand failliet is (Begint bij de volgende regel) If $Geld4 < 0 Then $Schulden4 = True $GeldErbij = $PreTransfer ;Zorgt ervoor dat bij het overmaken aan de ander (zie beneden deze if's), dat de debtor alleen het geld krijgt die de schuldige ook echt heeft $Failliet = MsgBox(4, "Failliet", $Speler4 & " staat op dit moment in het rood." & @CRLF & "Wil je deze speler failliet verklaren?" & @CRLF & "(Als je op nee drukt, wordt het balans van " & $Speler4 & " teruggezet naar 0.") If $Spelers = 4 Then If $Failliet = 6 Then ;Als de speler op ja drukte bij vorige MsgBox GUICtrlSetState($Zender4, 128) GUICtrlSetState($Ontvanger4, 128) GUICtrlSetState($GeldStatus4, 128) GUICtrlSetState($Radio8, 128) $Spelend4 = 0 If $Spelend3 = 1 Then ;Hier checked hij de Radio die nog overblijft GUICtrlSetState($Radio3, 1) GUICtrlSetState($Radio4, 128) ElseIf $Spelend2 = 1 Then ;Hier checked hij de Radio die nog overblijft GUICtrlSetState($Radio2, 1) GUICtrlSetState($Radio4, 128) ElseIf $Spelend1 = 1 Then ;Hier checked(vinkt) hij de Radio die nog overblijft GUICtrlSetState($Radio1, 1) GUICtrlSetState($Radio4, 128) EndIf If $Spelend2 = 0 And $Spelend3 = 0 Then ;Bepaalt de winnaar MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler1 & "!") $Einde = True ElseIf $Spelend1 = 0 And $Spelend3 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler2 & "!") $Einde = True ElseIf $Spelend1 = 0 And $Spelend2 = 0 Then MsgBox(0, "Gefeliciteerd!", "We hebben een winnaar: " & $Speler3 & "!") $Einde = True EndIf ElseIf $Failliet = 7 Then ;Als de speler op nee drukte $Geld4 = 0 Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden gelezen welke optie u gekozen heeft" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox4.1") EndIf Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden geladen hoeveel mensen er zijn" & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox4.2") EndIf EndIf If GUICtrlRead($Radio5) = 1 Then $Result = $Geld1 + $GeldErbij Global $Geld1 = $Result ElseIf GUICtrlRead($Radio6) = 1 Then $Result = $Geld2 + $GeldErbij Global $Geld2 = $Result ElseIf IsDeclared("Speler3") = Not 0 And GUICtrlRead($Radio7) = 1 Then $Result = $Geld3 + $GeldErbij Global $Geld3 = $Result ElseIf IsDeclared("Speler4") = Not 0 And GUICtrlRead($Radio8) = 1 Then $Result = $Geld4 + $GeldErbij Global $Geld4 = $Result Else MsgBox(0, "Bug-detector 2000", "Er kon helaas niet worden geladen welke radioknop is geselecteerd" & @CRLF & "bij een van de secties bij het toevoegen van het bedrag." & @CRLF & "Foutcode: " & @error & @CRLF & @CRLF & "Transfer/ErrorMsgBox4.3") EndIf EndIf EndFunc ;===> Berekent hoe de dikke stacks flowen boii You guys can collapse everything except for Hoofdmenu(). Yes, I'm Dutch but I have bilingual school, so you guys don't have to worry about it. The codes I shared earlier are at line 178, and line 421 in my whole script. ($SpelersOver is short for Players which are still playing, and Spelers means Players.) And note that this isn't game automatation. This is just replacing the digital bank for Monopoly, which you have to buy. Also, you don't have to use the banknotes anymore. I understand where Francesco is going, but I don't understand the part where you have to use WM_COMMAND. Is it still relevant after I send my whole script? Edited August 20, 2018 by Silas Edit 1: Error in code. Edit 2: removed a lot of obsolete things in the first script
FrancescoDiMuro Posted August 20, 2018 Posted August 20, 2018 @Silas Little modification to your script: Spoiler expandcollapse popup#include <ButtonConstants.au3> ;===========Includers #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <EditConstants.au3> #include <Misc.au3> $WBreedte = 306 ;width $WHoogte = 165 ;height Global $Window = GUICreate("MonoBank - Start", $WBreedte, $WHoogte, @DesktopWidth / 2 - ($WBreedte / 2), @DesktopHeight / 2 - ($WHoogte / 2), $GUI_SS_DEFAULT_GUI) GUISetFont(12, 400, 0, "Arial") GUISetState(@SW_SHOW) ;==== I only added this old window so that the following codes still work $Spelers=2 $Speler1=1 $Speler2=1 $Geld1=1500 $Geld2=1500 ;== Variables used later in this script Global $WhileH = 1 ;(Part of bigger thing in the whole script) Global $SpelersOver = 2 #Region ;Al het toevoegen (all the creating of the GUI) Global $Startbedrag = 1500 Global $Einde = False $WBreedte =508 $WHoogte = 360 $X_Undo = 218 $X_Input = 271 $X_Transfer = 418 Global $Spelend1 = 1 Global $Spelend2 = 1 WinMove($Window, "", @DesktopWidth / 2 - ($WBreedte / 2), @DesktopHeight / 2 - ($WHoogte / 2), $WBreedte, $WHoogte) Global $Zender1 = GUICtrlCreateLabel($Speler1, 222, 52, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0x4286f4) Global $Zender2 = GUICtrlCreateLabel($Speler2, 360, 52, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0xea3838) Global $GeldStatus1 = GUICtrlCreateLabel("?" & $Geld1, 222, 18, 105, 31, $SS_CENTER) GUICtrlSetFont(-1, 18, 400, 0, "Arial") Global $GeldStatus2 = GUICtrlCreateLabel("?" & $Geld2, 360, 18, 105, 31, $SS_CENTER) GUICtrlSetFont(-1, 18, 400, 0, "Arial") Global $Ontvanger1 = GUICtrlCreateLabel($Speler1, 222, 241, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0x4286f4) Global $Ontvanger2 = GUICtrlCreateLabel($Speler2, 360, 241, 105, 36, BitOR($WS_GROUP, $SS_CENTER)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetColor(-1, 0xea3838) GUIStartGroup() Global $Radio1 = GUICtrlCreateRadio("", 266, 99, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) Global $Radio2 = GUICtrlCreateRadio("", 404, 99, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) GUIStartGroup() Global $Radio5 = GUICtrlCreateRadio("", 266, 288, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) Global $Radio6 = GUICtrlCreateRadio("", 404, 288, 21, 21, BitOR($BS_AUTORADIOBUTTON,$BS_TOP)) GUICtrlSetCursor (-1, 0) Global $Input = GUICtrlCreateInput("", $X_Input, 153, 144, 50, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER,$WS_GROUP)) GUICtrlSetFont(-1, 28, 400, 0, "Arial") GUICtrlSetCursor (-1, 5) GUICtrlSetLimit(-1, 6) Global $Button_Transfer = GUICtrlCreateButton("OK", $X_Transfer, 153, 50, 50, BitOR($WS_GROUP, $BS_DEFPUSHBUTTON)) GUICtrlSetCursor(-1, 0) Global $Button_Undo = GUICtrlCreateButton("<", $X_Undo, 153, 50, 50, $WS_GROUP) GUICtrlSetCursor(-1, 0) #EndRegion (creating GUI) While $WhileH $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_Transfer If GUICtrlRead($Input)= Not "" And $Einde = False Then ;Transfer() EndIf Case $Radio1 GUICtrlSetState($Radio6, 1) Case $Radio2 GUICtrlSetState($Radio5, 1) Case $Radio5 GUICtrlSetState($Radio2, 1) Case $Radio6 GUICtrlSetState($Radio1, 1) ; Case $Button_Undo ; Sumsing ;Case $Button_Return ; MsgBox(4, "Waarschuwing", "Als je teruggaat, verlies je alle voortgang en krijgt iedereen weer het standaard bedrag." & @CRLF & "Wil je doorgaan?") ;Warning box. About losing progress ; Start() EndSwitch ;~ If $SpelersOver=2 Then ;~ If $Spelers=2 Then ;~ If GUICtrlRead($Radio1)=1 And Not BitAND(GUICtrlGetState($Radio6),1) And Not BitAND(GUICtrlGetState($Radio5),1) And Not BitAND(GUICtrlGetState($Radio2),1) Then GUICtrlSetState($Radio6,1) ;~ If GUICtrlRead($Radio2)=1 And Not BitAND(GUICtrlGetState($Radio5),1) And Not BitAND(GUICtrlGetState($Radio6),1) And Not BitAND(GUICtrlGetState($Radio1),1) Then GUICtrlSetState($Radio5,1) ;~ If GUICtrlRead($Radio5)=1 And Not BitAND(GUICtrlGetState($Radio2),1) And Not BitAND(GUICtrlGetState($Radio1),1) And Not BitAND(GUICtrlGetState($Radio6),1) Then GUICtrlSetState($Radio2,1) ;~ If GUICtrlRead($Radio6)=1 And Not BitAND(GUICtrlGetState($Radio1),1) And Not BitAND(GUICtrlGetState($Radio2),1) And Not BitAND(GUICtrlGetState($Radio5),1) Then GUICtrlSetState($Radio1,1) ;~ EndIf ;~ EndIf WEnd 1 hour ago, Silas said: I understand where Francesco is going, but I don't understand the part where you have to use WM_COMMAND. Is it still relevant after I send my whole script? Through a WM_COMMAND handler, you can do it only when a specific event occurs, like $BN_CLICKED, which is fired when you click on a radio button ( in this example ). So, I think that would be easier to do it via WM_COMMAND instead of doing in an infinite While...WEnd loop But there you are with your little script modification Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
mikell Posted August 20, 2018 Posted August 20, 2018 @FrancescoDiMuro Isn't your solution good enough ? clear, simple, handy, nice-looking and so on ? 1 hour ago, FrancescoDiMuro said: I think that would be easier to do it via WM_COMMAND I don't really agree (in this case)... 2 reasons : - WM_COMMAND can cause trouble if wrongly used, and can hide inappropriate instructions existing in the main While loop because of its higher priority - much better to learn and understand the basics first For instance, how to fire events using commands only, and how to avoid as much as possible continuous checkings in the main While loop, which are resources consuming and can cause bugs
Simpel Posted August 20, 2018 Posted August 20, 2018 Hi, I would do it this way: While $WhileH $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_Transfer If GUICtrlRead($Input)= Not "" And $Einde = False Then ;Transfer() EndIf ; Case $Button_Undo ; Sumsing ;Case $Button_Return ; MsgBox(4, "Waarschuwing", "Als je teruggaat, verlies je alle voortgang en krijgt iedereen weer het standaard bedrag." & @CRLF & "Wil je doorgaan?") ;Warning box. About losing progress ; Start() Case $Radio1 GUICtrlSetState($Radio6,1) Case $Radio2 GUICtrlSetState($Radio5,1) Case $Radio5 GUICtrlSetState($Radio2,1) Case $Radio6 GUICtrlSetState($Radio1,1) EndSwitch ;~ If $SpelersOver=2 Then ;~ If $Spelers=2 Then ;~ If GUICtrlRead($Radio1)=1 And Not BitAND(GUICtrlGetState($Radio6),1) And Not BitAND(GUICtrlGetState($Radio5),1) Then GUICtrlSetState($Radio6,1) ;~ If GUICtrlRead($Radio2)=1 And Not BitAND(GUICtrlGetState($Radio5),1) And Not BitAND(GUICtrlGetState($Radio6),1) Then GUICtrlSetState($Radio5,1) ;~ If GUICtrlRead($Radio5)=1 And Not BitAND(GUICtrlGetState($Radio2),1) And Not BitAND(GUICtrlGetState($Radio1),1) Then GUICtrlSetState($Radio2,1) ;~ If GUICtrlRead($Radio6)=1 And Not BitAND(GUICtrlGetState($Radio1),1) And Not BitAND(GUICtrlGetState($Radio2),1) Then GUICtrlSetState($Radio1,1) ;~ EndIf ;~ EndIf WEnd Because they are grouped you have to set only one of the opposite site and the other is disabled automatically. Regards, Simpel FrancescoDiMuro 1 SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
FrancescoDiMuro Posted August 20, 2018 Posted August 20, 2018 31 minutes ago, mikell said: Isn't your solution good enough ? clear, simple, handy, nice-looking and so on ? At which solution are you referring? By the way, I agree with your opinion, but I thought that a mention to such a powerful tool ( WM_* handlers ) was a must. It's like StringRegExp(): it's a powerful tool, but an incorrect pattern will give you strange results 35 minutes ago, mikell said: For instance, how to fire events using commands only, and how to avoid as much as possible continuous checkings in the main While loop, which are resources consuming and can cause bugs I don't think I completely understood you, sorry Cheers Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Silas Posted August 22, 2018 Author Posted August 22, 2018 Thanks evryone for your help. I can continue now. I will try the way in which the commands are checked, that one seems the most solid to me. However, Simpel's post may also work. I will try both.
FrancescoDiMuro Posted August 22, 2018 Posted August 22, 2018 2 minutes ago, Silas said: Simpel's post may also work. Is what I have posted here Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Simpel Posted August 22, 2018 Posted August 22, 2018 Hi @FrancescoDiMuro, I didn't saw that, maybe because of "reveal hidden contents" or because the discussion about "WM_COMMAND ". ;-) But if two persons found the exact same solution independently there must be some good at it. FrancescoDiMuro 1 SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
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