Jump to content

Hyflex

Active Members
  • Posts

    535
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Hyflex's Achievements

Universalist

Universalist (7/7)

2

Reputation

  1. Hi, I use ThunderBird Portable and I have a copy on my computer but I also regularly update the copies on my laptop and personal computer but every time I do this i have to update the paths of where configuration files exist otherwise it breaks. I'm looking for a better way to cycle through every single file and automatically update the paths because whenever a new Thunderbird update comes out there is always some files that I need to update that aren't in my list.... The default installation folder is listed in multiple ways throughout the files from: C:\Users\Hyflex\Downloads\New E-Mail\ C:\\Users\\Hyflex\\Downloads\\New E-Mail\\ C:\\\Users\\\Hyflex\\\Downloads\\\New E-Mail\\\ C:\\\\\\\\Users\\\\\\\\Hyflex\\\\\\\\Downloads\\\\\\\\New E-Mail\\\\\\\\ C:/Users/Hyflex/Downloads/New E-Mail/ C://Users//Hyflex//Downloads//New E-Mail// C:///Users///Hyflex///Downloads///New E-Mail/// C:////////Users////////Hyflex////////Downloads////////New E-Mail//////// I need to keep their same structure throughout the files... Currently I have a little autoit script that replaces my desktop path with the new path: $SZFILE = @ScriptDir & "\ThunderbirdPortable\Data\settings\ThunderbirdPortableSettings.ini" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT = StringReplace($SZTEXT, "C:\Users\Hyflex\Downloads\New E-Mail\", @ScriptDir & "\", 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\Data\profile\compatibility.ini" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT = StringReplace($SZTEXT, "C:\Users\Hyflex\Downloads\New E-Mail\", @ScriptDir & "\", 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\Data\profile\extensions.ini" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT = StringReplace($SZTEXT, "C:\Users\Hyflex\Downloads\New E-Mail\", @ScriptDir & "\", 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\Data\profile\extensions.json" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT1 = StringRegExpReplace(@ScriptDir & "\", "\\", "\\\\") $SZTEXT = StringReplace($SZTEXT, "C:\\Users\\Hyflex\\Downloads\\New E-Mail\\", $SZTEXT1, 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\Data\profile\prefs.js" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT1 = StringRegExpReplace(@ScriptDir & "\", "\\", "\\\\") $SZTEXT = StringReplace($SZTEXT, "C:\\Users\\Hyflex\\Downloads\\New E-Mail\\", $SZTEXT1, 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\Data\profile\prefs.js" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT1 = StringRegExpReplace(@ScriptDir & "\", "\\", "\\\\\\\\") $SZTEXT = StringReplace($SZTEXT, "C:\\\\Users\\\\Hyflex\\\\Downloads\\\\New E-Mail\\\\", $SZTEXT1, 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\Data\profile\panacea.dat" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT1 = StringRegExpReplace(@ScriptDir & "\", "\\", "\\\\") $SZTEXT = StringReplace($SZTEXT, "C:\\Users\\Hyflex\\Downloads\\New E-Mail\\", $SZTEXT1, 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\Data\profile\search.json" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT1 = StringRegExpReplace(@ScriptDir & "\", "\\", "\\\\") $SZTEXT = StringReplace($SZTEXT, "C:\\Users\\Hyflex\\Downloads\\New E-Mail\\", $SZTEXT1, 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\Data\profile\pluginreg.dat" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT = StringReplace($SZTEXT, "C:\Users\Hyflex\AppData\Roaming\", @AppDataDir & "\", 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\App\thunderbird\uninstall\uninstall.update" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT = StringReplace($SZTEXT, "C:\Users\Hyflex\AppData\Local\", @LocalAppDataDir & "\", 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\App\thunderbird\uninstall\uninstall.update" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT = StringReplace($SZTEXT, "C:\Users\Hyflex\Downloads\New E-Mail\", @ScriptDir & "\", 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) $SZFILE = @ScriptDir & "\ThunderbirdPortable\Data\profile\startupCache\startupCache.4.little" $SZTEXT = FileRead($SZFILE, FileGetSize($SZFILE)) $SZTEXT1 = StringRegExpReplace(@ScriptDir & "\", "\\", "/") $SZTEXT1 = StringRegExpReplace($SZTEXT1, " ", "%20") $SZTEXT = StringReplace($SZTEXT, "C:/Users/Hyflex/Downloads/New%20EMail/", $SZTEXT1, 0, 1) FileDelete($SZFILE) FileWrite($SZFILE, $SZTEXT) Anyone have any ideas how I can improve this? I'd much appreciate some help!
  2. I've tried to get the MsgBox's working for quite a while and searched the forums, stackoverflow and google but can't find how to resolve this. I've tried to create a messagebox in Scite but that too has the same issue where none of the results work except for the else... which is pretty useless. See some example code below: #include <MsgBoxConstants.au3> ;#include <GuiConstantsEx.au3> $Status = "Test" $Message = "Beep Beep" If Not IsDeclared("UpdateResult") Then Local $UpdateResult $UpdateResult = MsgBox($MB_OKCANCEL & $MB_ICONWARNING, $Status & " Available", "There is a " & $Status & "." & @CRLF & @CRLF & "Press OK to " & $Status & @CRLF & @CRLF & $Message) Select Case $UpdateResult = 1 ;OK ConsoleWrite("Switch 1" & @CRLF) Case $UpdateResult = 2 ConsoleWrite("Switch 2" & @CRLF) EndSelect If $UpdateResult = 1 Then ConsoleWrite("If 1" & @CRLF) ElseIf $UpdateResult = 2 Then ConsoleWrite("ElseIf" & @CRLF) Else ConsoleWrite("Else" & @CRLF) ; Only one that fires.... EndIf How do I get OK button & cancel button to do things...? Thanks
  3. I told you there error it throws... From this you can see that it has failed an if/else argument and that also tells you that JRE is installed otherwise it would have thrown an exception which also tells you that JRE is installed otherwise it would have thrown an exception. I also told you that I double checked the images were correct by replacing the image with a new copy just incase it was unable to find due to having slighty different desktop resolution/brightness... etc. I also told you that I am capable of using both findBMP & ImageSearch therefore I probably checked most of the basic reasons that it might be failing...
  4. How can I possibly give more information... I've told you everything... what else would you require? I gave you my OS, I told you that I tried the example script, I told you that I tried the example script with a fresh image. I told you what didn't work / what the result was.
  5. Hi, I certainly can't get this working at all. I'm on Windows 10 and it throws up saying it failed to find the image. I've tried it with the website open on every screen and I've also replaced the image with a fresh copy of the logo yet it still fails to find it... findBMP & ImageSearch both work just I want to try this one to see how much faster/slower it is and how resource intensive it is.
  6. Hi, I'm wondering how best I can performance test the 3 different image searching methods to find out: - What one uses least memory. - What one is the fastest (I know Timer/TimerDiff would kind of work for this but I want to test them more in depth, like line by line) - What one is the accurate. Currently the way I am wanting to use an image search feature is by saving an image and then looking for that exact image on the screen / portion of the screen / window. Lasker Image Search = https://www.autoitscript.com/forum/topic/182543-a-new-image-search-solution/ Image Search (AHK Port): https://www.autoitscript.com/forum/topic/65748-image-search-library/ FindBMP Search: https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ Thanks
  7. Hi, I'm trying to run the following command through command prompt but for some reason I can't get it to work with AutoIt. start /realtime /b "" "C:\Program Files (x86)\VMware\VMware Workstation\VMWare.exe" -x "T:\VMs\RVM.vmx" I've tried the following: Run(@ComSpec & ' start /realtime /b "" "C:\Program Files (x86)\VMware\VMware Workstation\VMWare.exe" -x "T:\VMs\RVM.vmx"') I've also tried a fair few other variations but all of them just do nothing, a few variations like the following just load a command prompt but nothing is entered or done... Run(@ComSpec & ' start /b "" "C:\Program Files (x86)\VMware\VMware Workstation\VMWare.exe" -x "T:\VMs\RVM.vmx"') Anyone have any suggestions to fix it so it runs?
  8. @Melba23 I think my maths in my head was a bit wrong because even still that output is incorrect, the division is what it should be sorted by for example, if you run that script you'll see that 6 down is: 1/21 which comes out at 0.0476. Yet if you look at 7 down it shows 5/102 which comes out as 0.049 which is bigger than the previous one, therefore it should be put slightly higher. I might be going about doing the UI completely wrong, I'll try and explain with a made up scenario of what I am trying to achieve but in a way everyone can understand. If we were to buy 20 silver for 1 gold it would be a ratio of 1:20 - I'd want the left options to show 1:20 in its list but also 10 (just an easy to work with number) other options, 5 where the ratio is slightly higher and 5 where the ratio is slightly lower If we want to make some profit we would have to sell at a ratio lower than 1:20 - So on the right hand side it should show the "same" ratio of 20:1 but it should again also show another 10 options, 5 where the ratio is slightly higher and 5 where it is slightly lower. It would be ideal if I could somehow click on one on the left options and for it to update the right side and for it to highlight options on the right hand side, blue for the same ratio and then red for a "worse" ratio where we would be making a loss and then green for a good ratio where we would be making profit. I might be doing it completely wrong but I don't know
  9. Hi Melba, Here it is so far: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <ListviewConstants.au3> Local $InputListItems[3] = ["item1", "item2", "item3"] Local $LeftOptions[] = [""] Local $RightOptions[] = [""] $Form1 = GUICreate("Form1", 751, 300, 192, 124) $InputMain = GUICtrlCreateGroup("Input Main", 8, 0, 137, 137) $InputListMain = GUICtrlCreateList("", 16, 16, 121, 118) GUICtrlSetData($InputListMain, _ArrayToString($InputListItems)) $InputAlt = GUICtrlCreateGroup("Input Alt", 151, 0, 137, 137) $InputListAlt = GUICtrlCreateList("", 159, 16, 121, 118) GUICtrlSetData($InputListAlt, _ArrayToString($InputListItems)) $Rates = GUICtrlCreateGroup("Rates", 6, 139, 281, 49) $MainRateInput = GUICtrlCreateInput("1", 14, 155, 121, 21) $AltRateInput = GUICtrlCreateInput("20", 158, 155, 121, 21) $LeftOutputs = GUICtrlCreateGroup("Left Option", 296, 0, 209, 235) $LeftOutputList = GUICtrlCreateList("", 304, 16, 193, 222) GUICtrlSetData($LeftOutputList, _ArrayToString($LeftOptions)) $RightOutputs = GUICtrlCreateGroup("Right Option", 532, 0, 209, 235) $RightOutputList = GUICtrlCreateList("", 540, 16, 193, 222) GUICtrlSetData($RightOutputList, _ArrayToString($RightOptions)) $Output = GUICtrlCreateGroup("Main Output", 8, 242, 281, 49) $OututInput = GUICtrlCreateInput("", 16, 258, 265, 21) $Picker = GUICtrlCreateGroup("Option", 294, 242, 345, 49) $Radio1 = GUICtrlCreateRadio("Left", 312, 266, 113, 17) $Radio2 = GUICtrlCreateRadio("Right", 488, 266, 113, 17) GUISetState(@SW_SHOW) GUICtrlSetState($Radio1, $GUI_CHECKED) ControlClick("", "", "[CLASS:ListBox; INSTANCE:1]", "left", 1, 20, 20) ControlClick("", "", "[CLASS:ListBox; INSTANCE:2]", "left", 1, 20, 10) ; Generate on startup GenerateRates(GUICtrlRead($MainRateInput), GUICtrlRead($AltRateInput), "left", GUICtrlRead($InputListMain), GUICtrlRead($InputListAlt)) GenerateRates(GUICtrlRead($AltRateInput), GUICtrlRead($MainRateInput), "right", GUICtrlRead($InputListMain), GUICtrlRead($InputListAlt)) Func GenerateRates($MainRate, $AltRate, $Position, $item1, $item2) ; Set Defaults Local $Start = $MainRate Local $End = $AltRate Local $Pos = $Position ; Setup blank array Local $PossibleValues[1][] = [["", ""]] _ArrayDelete($PossibleValues, 0) Local $FloatTrigger = False Local $IgnoreTrigger = False ; Output item If $Pos = "left" Then $item = $item1 Else $item = $item2 EndIf ; Clear the output to allow for a fresh list. If $Pos = "left" Then GUICtrlSetData($LeftOutputList, "") Else GUICtrlSetData($RightOutputList, "") EndIf ; Setup initial value $PossibleValue = $Start & "/" & $End & " " & $item &" (" & Round($Start / $End, 4) & ")" $sFill = $PossibleValue & "|" & Round($Start / $End, 4) _ArrayAdd($PossibleValues, $sFill) ; Add 15 more values For $i = 1 To 15 $IgnoreTrigger = False ; Initial values + a minor increase $Start = $Start $End = Round($End + 0.1, 1) ; Check to see if the end number is an interger or not If IsInt(Number($End)) Then ;ConsoleWrite("End: " & $End & @CRLF) $FloatTrigger = False Else $FloatTrigger = True $StartEx = $Start $EndEx = $End ;ConsoleWrite("EndEx: " & $EndEx & @CRLF) EndIf ; While the end number is an interger keep increasing While $FloatTrigger = True $StartEx = $StartEx + $MainRate $EndEx = $EndEx + $AltRate + 0.1 If IsInt(Number($EndEx)) Then $FloatTrigger = False ;ConsoleWrite("Int Detected: " & $EndEx & @CRLF) Else $FloatTrigger = True EndIf ; If either number gets to 1000+ ignore it and get another loop to make sure we get 15 items but none with rates that are too high. If Number($EndEx) >= 1000 or Number($StartEx) >= 1000 Then $FloatTrigger = False $IgnoreTrigger = True $i = $i - 1 EndIf WEnd ; Do not add the 1000+ numbers If $IgnoreTrigger = False Then If IsInt(Number($End)) Then $FloatTrigger = False Else $FloatTrigger = True EndIf ; Setup other value strings If $FloatTrigger = True Then $PossibleValue = $StartEx & "/" & $EndEx & " " & $item &" (" & Round($StartEx / $EndEx, 4) & ")" Else $PossibleValue = $Start & "/" & $End & " " & $item &" (" & Round($Start / $End, 4) & ")" EndIf ; Add the values to the array $sFill = $PossibleValue & "|" & Round($Start / $End, 4) _ArrayAdd($PossibleValues, $sFill) EndIf Next ; Display the array for debugging _ArrayDisplay($PossibleValues, "") ; Update the lists If $Pos = "left" Then GUICtrlSetData($LeftOutputList, _ArrayToString($PossibleValues)) Else GUICtrlSetData($RightOutputList, _ArrayToString($PossibleValues)) EndIf ;Return $PossibleValues EndFunc ;==>GenerateRates While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Radio1 If GUICtrlRead($OututInput) <> GUICtrlRead($LeftOutputList) Then GUICtrlSetData($OututInput, GUICtrlRead($LeftOutputList)) EndIf Case $Radio2 If GUICtrlRead($OututInput) <> GUICtrlRead($RightOutputList) Then GUICtrlSetData($OututInput, GUICtrlRead($RightOutputList)) EndIf ; Working Start Case $InputListMain GUICtrlSetData($Radio1, "Left: " & GUICtrlRead($InputListMain)) Case $InputListAlt GUICtrlSetData($Radio2, "Right: " & GUICtrlRead($InputListAlt)) ; Working End Case $MainRateInput If GUICtrlRead($Radio1) = 1 Then GenerateRates(GUICtrlRead($MainRateInput), GUICtrlRead($AltRateInput), "left", GUICtrlRead($InputListMain), GUICtrlRead($InputListAlt)) Else GenerateRates(GUICtrlRead($AltRateInput), GUICtrlRead($MainRateInput), "right", GUICtrlRead($InputListMain), GUICtrlRead($InputListAlt)) EndIf Case $AltRateInput If GUICtrlRead($Radio1) = 1 Then GenerateRates(GUICtrlRead($MainRateInput), GUICtrlRead($AltRateInput), "left", GUICtrlRead($InputListMain), GUICtrlRead($InputListAlt)) Else GenerateRates(GUICtrlRead($AltRateInput), GUICtrlRead($MainRateInput), "right", GUICtrlRead($InputListMain), GUICtrlRead($InputListAlt)) EndIf EndSwitch WEnd You can see I even added a second column to the array to try and get it to sort automatically. The only problem with the second column is I can't seem to get _ArrayToString to only put in column 0 into the list. As for the lists, if I change: $LeftOutputList = GUICtrlCreateList("", 304, 16, 193, 222) to: $LeftOutputList = GUICtrlCreateList("", 304, 16, 193, 222, $LVS_SORTASCENDING) Yesterday the lists were coming out with chinese letters in them, today it's not coming out with anything in them. Not sure what is different. Any advice on what I'm doing wrong?
  10. Hi Melba, I've tried using the styles but for some reason it changes the words in my arrays/lists to some odd chinese (I assume) characters :/
  11. Hi, I'm currently using: GUICtrlSetData($LeftOutputList, _ArrayToString($PossibleValues)) However, it's inputting them in a random order rather than going in row order or using column 2 as an index (lowest number to highest or vice versa) How can I make it so it adds them all to the list in the correct order (the order of the array)
  12. Ahh that helps a lot! Am I right in thinking there isn't an option like: GUICtrlSetState($Radio1, $GUI_CHECKED) for lists? I want to select item 1 (whatever is top of the list) in both input main and input alt. Do I have to use the following? ControlClick("", "", "[CLASS:ListBox; INSTANCE:2]", "left", 1, 20, 10)
  13. My code already has that, It's more of the problem that it's not detecting ints correctly. :/
  14. I edited the code above, it's now correct in terms of the radio buttons. The problem with that was I was using code for Select rather than Switch. As for the integer testing, I am unable to get anywhere on it. The numbers are coming out as floats even though some aren't... I've been trying loads of things to try and figure it out but nothing is working here is some attempts: ;ConsoleWrite($End & " = Mod: " & Mod($End, 1) & @CRLF) ;ConsoleWrite($End & " = Int: " & Int($End) & @CRLF) ;ConsoleWrite($End & " = Number: " & Number($End) & @CRLF) ;ConsoleWrite($End & " = Round: " & Round($End) & @CRLF) ;ConsoleWrite($End & " = Floor: " & Floor($End) & @CRLF) ;ConsoleWrite($End & " = Ceiling: " & Ceiling($End) & @CRLF) ;ConsoleWrite($End & " = IsInt: " & IsInt($End) & @CRLF) ;ConsoleWrite($End & " = IsFloat: " & IsFloat($End) & @CRLF) ;ConsoleWrite($End & " = IsNumber: " & IsNumber($End) & @CRLF) ;ConsoleWrite($End & " = IsInt(Number()): " & IsInt(Number($End)) & @CRLF) ;ConsoleWrite($End & " = Floor(Mod()): " & Floor(Mod($End, 1)) & @CRLF) ;ConsoleWrite($End & " = StringInStr: " & StringInStr(".", String($End)) & @CRLF) ConsoleWrite(_WinAPI_FloatToInt($End) & @CRLF) If IsFloat($End) = 1 Then ConsoleWrite($End & " = Float" & @CRLF) ElseIf IsFloat($End) = 0 Then ConsoleWrite($End & " = Not Float" & @CRLF) EndIf ;If Mod($End, 1) = 1 Then ;ConsoleWrite($End & " = Mod = 1:: " & Mod($End, 1) & @CRLF) ;ElseIf Mod($End, 1) = 0 Then ;ConsoleWrite($End & " = Mod = 0: " & Mod($End, 1) & @CRLF) ;EndIf
  15. Hi, Even with the code looking like you can see below, it still doesn't work. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> Local $InputListItems[3] = ["item 1", "item 2", "item 3"] Local $test[1] = ["dog"] Local $test1[1] = ["cat"] ; #### MAIN FORM #### $Form1 = GUICreate("Form1", 651, 250, 192, 124) ; ##### INPUT MAIN START ##### $InputMain = GUICtrlCreateGroup("Input Main", 8, 0, 137, 137) ; List $InputListMain = GUICtrlCreateList("", 16, 16, 121, 118) GuiCtrlSetData($InputListMain, _ArrayToString($InputListItems)) ; ##### INPUT MAIN END ##### ; ##### INPUT ALT START ##### $InputAlt = GUICtrlCreateGroup("Input Alt", 151, 0, 137, 137) ; List $InputListAlt = GUICtrlCreateList("", 159, 16, 121, 118) GuiCtrlSetData($InputListAlt, _ArrayToString($InputListItems)) ; ##### INPUT ALT END ##### ; ##### RATES START ##### $Rates = GUICtrlCreateGroup("Rates", 6, 139, 281, 49) $MainRateInput = GUICtrlCreateInput("1", 14, 155, 121, 21) $AltRateInput = GUICtrlCreateInput("3", 158, 155, 121, 21) ; ##### RATES END ##### ; ##### LEFT OUTPUTS START ##### $LeftOutputs = GUICtrlCreateGroup("Left Option", 296, 0, 169, 185) $LeftOutputList = GUICtrlCreateList("", 304, 16, 153, 162) GuiCtrlSetData($LeftOutputList, _ArrayToString($test)) ; ##### LEFT OUTPUTS End ##### ; ##### RIGHT OUTPUTS START ##### $RightOutputs = GUICtrlCreateGroup("Right Option", 472, 0, 169, 185) $RightOutputList = GUICtrlCreateList("", 480, 16, 153, 162) GuiCtrlSetData($RightOutputList, _ArrayToString($test1)) ; ##### RIGHT OUTPUTS End ##### ; ##### OUTPUT START ##### $Output = GUICtrlCreateGroup("Main Output", 8, 192, 281, 49) $OututInput = GUICtrlCreateInput("", 16, 208, 265, 21) ; ##### OUTPUT END ##### $Picker = GUICtrlCreateGroup("Option", 294, 192, 345, 49) $Radio1 = GUICtrlCreateRadio("Left", 312, 216, 113, 17) $Radio2 = GUICtrlCreateRadio("Right", 488, 216, 113, 17) GUISetState(@SW_SHOW) ;GUICtrlSetState($Radio1, $GUI_CHECKED) Func GenerateRates($MainRate, $AltRate) Local $Start = $MainRate Local $End = $AltRate Local $PossibleValues[0] = [] Local $FloatTrigger = False Local $PossibleValue = $Start & "/" & $End _ArrayAdd($PossibleValues, $PossibleValue) For $i = 1 to 29 $Start = $Start $End = $End + 0.1 ;If StringInStr(".", String($End)) Then ; ConsoleWrite($Start & @CRLF) ; $End = $End * 10 ; $Start = $Start * 10 ;EndIf If IsInt(Number($End)) Then ; IsInt($End) <> $End ; Mod($End, 1) = 0 $FloatTrigger = True $StartEx = $Start $EndEx = $End Else $FloatTrigger = False EndIf While $FloatTrigger = True $StartEx = $StartEx + $MainRate $EndEx = $EndEx + $AltRate + 0.1 ConsoleWrite($StartEx & @CRLF) ConsoleWrite($EndEx & @CRLF) Sleep(500) If IsInt(Number($EndEx)) Then ; IsInt($EndEx) <> $End ; Mod($EndEx, 1) = 0 $FloatTrigger = True Else $FloatTrigger = False EndIf Wend If $FloatTrigger = True Then $PossibleValue = $StartEx & "/" & $EndEx Else $PossibleValue = $Start & "/" & $End EndIf _ArrayAdd($PossibleValues, $PossibleValue) Next _ArrayDisplay($PossibleValues, "") EndFunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Radio1 If GUICtrlRead($OututInput) <> GUICtrlRead($LeftOutputList) Then GUICtrlSetData($OututInput, GUICtrlRead($LeftOutputList)) EndIf Case $Radio2 If GUICtrlRead($OututInput) <> GUICtrlRead($RightOutputList) Then GUICtrlSetData($OututInput, GUICtrlRead($RightOutputList)) EndIf ; Working Start Case $InputListMain GUICtrlSetData($Radio1, "Left: " & GUICtrlRead($InputListMain)) Case $InputListAlt GUICtrlSetData($Radio2, "Right: " & GUICtrlRead($InputListAlt)) ; Working End Case $MainRateInput If GUICtrlRead($Radio1) = 1 Then GenerateRates(GUICtrlRead($MainRateInput), GUICtrlRead($AltRateInput)) Else GenerateRates(GUICtrlRead($AltRateInput), GUICtrlRead($MainRateInput)) EndIf Case $AltRateInput If GUICtrlRead($Radio1) = 1 Then GenerateRates(GUICtrlRead($MainRateInput), GUICtrlRead($AltRateInput)) Else GenerateRates(GUICtrlRead($AltRateInput), GUICtrlRead($MainRateInput)) EndIf EndSwitch WEnd I took the original code for the radios from the AutoIt Help file when searching for GUICtrlCreateRadio as you can see: https://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateRadio.htm
×
×
  • Create New...