Jump to content

Tripredacus

Active Members
  • Posts

    910
  • Joined

  • Last visited

  • Days Won

    1

Tripredacus last won the day on November 26 2013

Tripredacus had the most liked content!

Profile Information

  • Member Title
    K-Mart-ian Legend
  • Location
    Buffalo
  • Interests
    Integration

Recent Profile Visitors

1,020 profile views

Tripredacus's Achievements

  1. Installed 3.3.16.1 on Windows 10 21H2 (19044.5965) and Scite does not open, only shows 0xC000007B error. Installed with x86 setting. Install using x64 native option and same issue opening SciTE. Full text of the error message: Nothing is written to Event Viewer. I don't see where any other logs would be kept in relation, not in AppData or Program Files(x86)\AutoIt at least.
  2. You could have thought of it as a logical experiment. I figured out the answer later. Basically the error that the LLM makes is that it tries to do the counting at the wrong time. I was already able to create the array and the LLM wanted to try to do the counting during the creation of the array. Rather, it is solved by doing the counting after the array had all of the data in it.
  3. I forget what build it is, but there is a letter assignment issue with WinPE based on Win11. Disks that are already formatted are detected as normal but do not have a drive letter assigned. It isn't the type of issue that would ever cause an issue in a production environment, however I run into it when I need to capture volumes. To get around it, I will use diskpart to select the volume and run assign command which will give it a letter. There is also a problem in Win 11 Setup (from disk) dealing with a refresh on deleting volumes, I wonder if it is related.
  4. I started working on a project recently to do something I couldn't do for free. Basically a way to create a schedule for a league with constraints. I got past that part pretty easily and I am nearly satisfied with the result with two exceptions: 1. I want to be able to show the times the "player" appears in the first part of the sequence so that I can see how balanced the appearances are. 2. I want to be able to force the program to adhere to appearance constraints, where a "player" would appear in the first or second spot of a value either 4 or 5 times. Since this is using a situation where there is an odd number of Rounds, it may well be impossible for it to actually generate a schedule with the constraints I have placed upon the program. That would be fine. My primary issue is that I lost a version where I did have the appearance counting working. So here is the working code that generates 9 rounds of 12 player matchups. If we are to consider the output as being (Home, Away) then because I am using the random include, there are instances where a player is Home or away more than 5 times. #include <Array.au3> #include <_ArrayRandom.au3> Local $players[12] $players[0] = "A1" $players[1] = "A2" $players[2] = "A3" $players[3] = "A4" $players[4] = "A5" $players[5] = "A6" $players[6] = "B1" $players[7] = "B2" $players[8] = "B3" $players[9] = "B4" $players[10] = "B5" $players[11] = "B6" Local $n = UBound($players) Local $rounds[9][Int($n / 2)][2] ; Array for 9 rounds ; Constraints: Pairs that cannot both be first in any round Local $constraints[6][2] = [ _ ["A1", "A3"], _ ["A2", "A4"], _ ["A5", "B1"], _ ["A6", "B2"], _ ["B3", "B5"], _ ["B4", "B6"] _ ] For $r = 0 To 8 ; Loop for 9 rounds Local $validRound = False Local $attempts = 0 While Not $validRound And $attempts < 10000 ; Increase attempts to 10000 $attempts += 1 ; Shuffle players array instead of just shifting _ArrayRandom($players) For $i = 0 To Int($n / 2) - 1 $rounds[$r][$i][0] = $players[$i] $rounds[$r][$i][1] = $players[$n - 1 - $i] Next ; Check if the current pairing violates any constraint $validRound = True For $i = 0 To UBound($constraints) - 1 Local $count = 0 For $j = 0 To UBound($rounds, 2) - 1 If $rounds[$r][$j][0] = $constraints[$i][0] Or $rounds[$r][$j][0] = $constraints[$i][1] Then $count += 1 EndIf Next If $count > 1 Then ; If both elements of constraint are first in a pair $validRound = False ExitLoop EndIf Next If $validRound Then ExitLoop ; Exit if we have found a valid round EndIf Wend If Not $validRound Then ConsoleWrite("Failed to generate a valid round " & $r + 1 & " after 10000 attempts." & @CRLF) EndIf Next ; Display the rounds if needed For $r = 0 To UBound($rounds) - 1 ConsoleWrite("Round " & $r + 1 & ": ") For $i = 0 To UBound($rounds, 2) - 1 ConsoleWrite("(" & $rounds[$r][$i][0] & ", " & $rounds[$r][$i][1] & ") ") Next ConsoleWrite(@CRLF) Next Now yesterday I had set upon Grok to see how well it could handle AutoIT, and it did actually create code that displayed the player placement count. However, I've lost that instance and to make matter worse, Grok is not able to reproduce that work from yesterday. Whatever it tries to make now will always output NULLs, or invald info. And unfortunately I do not have the expertise on how to fix that problem, which was the entire reason why I pasted code onto Grok and Gemini yesterday. From yesterday I have the work that the LLMs tried to do to add the following: 1. To restrict first place in the pairing appearances to 5 2. To show the round counting (which did work at some point) Console outputs Nulls to the Rounds, and 0 to the player count in this version. #include <Array.au3> #include <_ArrayRandom.au3> Local $players[12] $players[0] = "A1" $players[1] = "A2" $players[2] = "A3" $players[3] = "A4" $players[4] = "A5" $players[5] = "A6" $players[6] = "B1" $players[7] = "B2" $players[8] = "B3" $players[9] = "B4" $players[10] = "B5" $players[11] = "B6" Local $n = UBound($players) Local $rounds[9][Int($n / 2)][2] ; Array for 9 rounds ; Initialize the $rounds array For $r = 0 To 8 For $i = 0 To Int($n / 2) - 1 $rounds[$r][$i][0] = "" ; Initialize to empty string $rounds[$r][$i][1] = "" ; Initialize to empty string Next Next ; Constraints: Pairs that cannot both be first in any round Local $constraints[6][2] = [ _ ["A1", "A3"], _ ["A2", "A4"], _ ["A5", "B1"], _ ["A6", "B2"], _ ["B3", "B5"], _ ["B4", "B6"] _ ] ; Array to track how many times each player has been in the first position Local $firstCount[$n] = [0,0,0,0,0,0,0,0,0,0,0,0] ; Function to find a valid pair for a player considering constraints and balance Func FindValidPair($player, $tempPlayers, $constraints, $firstCount) Local $validPairs[1] = [""] ; Initialize with one empty element For $i = 0 To UBound($tempPlayers) - 1 If $tempPlayers[$i] <> $player Then Local $valid = True For $j = 0 To UBound($constraints) - 1 If ($player = $constraints[$j][0] And $tempPlayers[$i] = $constraints[$j][1]) Or ($player = $constraints[$j][1] And $tempPlayers[$i] = $constraints[$j][0]) Then $valid = False ExitLoop EndIf Next If $valid Then ; Check balance Local $playerIndex = _ArraySearch($players, $player) Local $pairIndex = _ArraySearch($players, $tempPlayers[$i]) If ($firstCount[$playerIndex] < 5 And $firstCount[$pairIndex] < 5) Or ($firstCount[$playerIndex] > 4 And $firstCount[$pairIndex] > 4) Then _ArrayAdd($validPairs, $tempPlayers[$i]) EndIf EndIf EndIf Next If UBound($validPairs) > 1 Then ; Check if more than initial empty element Return $validPairs[Random(1, UBound($validPairs) - 1, 1)] ; Return a random valid pair, excluding the first empty element Else Return "" EndIf EndFunc For $r = 0 To 8 ; Loop for 9 rounds Local $validRound = False Local $attempts = 0 While Not $validRound And $attempts < 10000 ; Increase attempts to 10000 $attempts += 1 ; Shuffle players array Local $tempPlayers = $players _ArrayRandom($tempPlayers) ; Attempt to build this round Local $usedPlayers[1] = [""] ; Initialize with one empty element Local $roundFirstPlayers[1] = [""] ; Array to track first players in *successful* pairs For $i = 0 To Int($n / 2) - 1 Local $firstPlayer = "" For $p = 0 To UBound($tempPlayers) - 1 If Not _ArraySearch($usedPlayers, $tempPlayers[$p]) Then $firstPlayer = $tempPlayers[$p] ExitLoop EndIf Next If $firstPlayer = "" Then ExitLoop ; No more players to use as first Local $secondPlayer = FindValidPair($firstPlayer, $tempPlayers, $constraints, $firstCount) If $secondPlayer = "" Then ExitLoop ; Cant find valid pair, restart round EndIf $rounds[$r][$i][0] = $firstPlayer $rounds[$r][$i][1] = $secondPlayer _ArrayAdd($usedPlayers, $firstPlayer) _ArrayAdd($usedPlayers, $secondPlayer) _ArrayAdd($roundFirstPlayers, $firstPlayer) ; Add to the successful first players ; Update counts Local $firstIndex = _ArraySearch($players, $firstPlayer) $firstCount[$firstIndex] += 1 Next If UBound($usedPlayers) = $n + 1 Then ; All players used, including the initial empty element $validRound = True Else ; Reset count for this round if invalid ; Only reset counts for *successful* first players For $i = 0 To UBound($roundFirstPlayers) - 1 Local $index = _ArraySearch($players, $roundFirstPlayers[$i]) If $index <> -1 Then $firstCount[$index] -= 1 EndIf Next EndIf Wend If Not $validRound Then ConsoleWrite("Failed to generate a valid round " & $r + 1 & " after 10000 attempts." & @CRLF) EndIf Next ; Display the rounds if needed (This will now show empty strings if a pair isnt found) For $r = 0 To UBound($rounds) - 1 ConsoleWrite("Round " & $r + 1 & ": ") For $i = 0 To UBound($rounds, 2) - 1 ConsoleWrite("(" & $rounds[$r][$i][0] & ", " & $rounds[$r][$i][1] & ") ") Next ConsoleWrite(@CRLF) Next ; Display how many times each player was first for debugging For $i = 0 To $n - 1 ConsoleWrite($players[$i] & ": " & $firstCount[$i] & @CRLF) Next And this other version from today that DOES output valid rounds but the player counts are either a 9 or a 0. #include <Array.au3> #include <_ArrayRandom.au3> Local $players[12] $players[0] = "A1" $players[1] = "A2" $players[2] = "A3" $players[3] = "A4" $players[4] = "A5" $players[5] = "A6" $players[6] = "B1" $players[7] = "B2" $players[8] = "B3" $players[9] = "B4" $players[10] = "B5" $players[11] = "B6" Local $n = UBound($players) Local $rounds[9][Int($n / 2)][2] ; Array for 9 rounds ; Constraints: Pairs that cannot both be first in any round Local $constraints[6][2] = [ _ ["A1", "A3"], _ ["A2", "A4"], _ ["A5", "B1"], _ ["A6", "B2"], _ ["B3", "B5"], _ ["B4", "B6"] _ ] ; Array to track how many times each player has been in the first position Local $firstCounts[$n] = [0,0,0,0,0,0,0,0,0,0,0,0] For $r = 0 To 8 ; Loop for 9 rounds Local $validRound = False Local $attempts = 0 While Not $validRound And $attempts < 10000 ; Increase attempts to 10000 $attempts += 1 ; Shuffle players array instead of just shifting _ArrayRandom($players) For $i = 0 To Int($n / 2) - 1 $rounds[$r][$i][0] = $players[$i] $rounds[$r][$i][1] = $players[$n - 1 - $i] Next ; Check if the current pairing violates any constraint $validRound = True For $i = 0 To UBound($constraints) - 1 Local $count = 0 For $j = 0 To UBound($rounds, 2) - 1 If $rounds[$r][$j][0] = $constraints[$i][0] Or $rounds[$r][$j][0] = $constraints[$i][1] Then $count += 1 EndIf Next If $count > 1 Then ; If both elements of constraint are first in a pair $validRound = False ExitLoop EndIf Next If $validRound Then ; Count occurrences of each player as first For $i = 0 To UBound($rounds, 2) - 1 Local $player = $rounds[$r][$i][0] Local $playerIndex = _ArraySearch($players, $player) If $playerIndex <> -1 Then $firstCounts[$playerIndex] += 1 ; Debug output to check count update ConsoleWrite("Round " & $r + 1 & ": Incrementing " & $player & " to " & $firstCounts[$playerIndex] & @CRLF) Else ConsoleWrite("ERROR: Player " & $player & " not found in players array." & @CRLF) EndIf Next ; Immediate display to check counts after each round ConsoleWrite("After Round " & $r + 1 & @CRLF) For $i = 0 To $n - 1 ConsoleWrite($players[$i] & ": " & $firstCounts[$i] & @CRLF) Next ExitLoop ; Exit if weve found a valid round EndIf Wend If Not $validRound Then ConsoleWrite("Failed to generate a valid round " & $r + 1 & " after 10000 attempts." & @CRLF) EndIf Next ; Display the rounds if needed For $r = 0 To UBound($rounds) - 1 ConsoleWrite("Round " & $r + 1 & ": ") For $i = 0 To UBound($rounds, 2) - 1 ConsoleWrite("(" & $rounds[$r][$i][0] & ", " & $rounds[$r][$i][1] & ") ") Next ConsoleWrite(@CRLF) Next ; Display how many times each player was first ConsoleWrite(@CRLF & "Player First Counts:" & @CRLF) For $i = 0 To $n - 1 ConsoleWrite($players[$i] & ": " & $firstCounts[$i] & @CRLF) Next So this post is for two purposes: 1. Can a real person instead of a chatbot help me resolve either the counting or balance issue? 2. Both Grok and Gemini have similar issues when dealing with arrays, are they making some common mistake? Do these (or other) LLMs make these kinds of mistakes with other programming or scripting languages?
  5. Sure but it doesn't matter if the IP range is routable or not. Don't discount that people use public support threads for osint.
  6. Every now and then I run into this situation where I am looking at a var and then setting another var, and then for whatever reason it sets the wrong var. I'm fairly sure I've posted at least one topic like this before and it is also likely that I'm making a dumb mistake. I've tried this three different ways, the wrong way, the right way and another right way but the behaviour is the same each time. The original wrong way: $dGateway1 = FileReadLine ( $oDgdat , 2 ) ; read dg from file $dGateway2 = StringRegExpReplace($dGateway1 , "[{"& Chr(34) &"}]" , "") If $dGateway2 = "10.x.1.1" OR "10.x.2.1" THEN $ImageServer = "Server1" ElseIf $dGateway2 = "10.x.3.1" OR "10.x.4.1" THEN $ImageServer = "Server2" ElseIf $dGateway2 = "10.x.5.1" OR "10.x.6.1" THEN $ImageServer = "Server3" EndIf Recreation should be simple enough. I have verified that the data in $dGateway2 is valid via MsgBox and this is working as expected. Could easily just hardcode $dGateway2 to something. I don't think the fact I am reading it from a text file makes a difference. Now in this "wrong" method, what happens is that when on the 1.1 or 2.1 network, $ImageServer var = Server1, as expected. This led me to skip past this and do the rest of the script. After thinking it was working properly, I didn't notice that it wasn't until I tried on the 4.1 network. In that case, $ImageServer also was Server1 when it shouldn't. Remembering that this is the inappropriate use of OR in the If statement, I made it (seemingly) foolproof: If $dGateway2 = "10.x.1.1" THEN $ImageServer = "Server1" ElseIf $dGateway2 = "10.x.2.1" THEN $ImageServer = "Server1" ElseIf $dGateway2 = "10.x.3.1" THEN $ImageServer = "Server2" ElseIf $dGateway2 = "10.x.4.1" THEN $ImageServer = "Server2" ElseIf $dGateway2 = "10.x.5.1" THEN $ImageServer = "Server3" ElseIf $dGateway2 = "10.x.6.1" THEN $ImageServer = "Server3" EndIf And still the same. The 4.1 network was putting Server1 as the var for $ImageServer. So then I tried something else: Select Case StringStripWS($dGateway2 = "10.x.1.1",8) $ImageServer = "Server1" Case StringStripWS($dGateway2 = "10.x.2.1",8) $ImageServer = "Server1" Case StringStripWS($dGateway2 = "10.x.3.1",8) $ImageServer = "Server2" Case StringStripWS($dGateway2 = "10.x.4.1",8) $ImageServer = "Server2" Case StringStripWS($dGateway2 = "10.x.5.1",8) $ImageServer = "Server3" Case StringStripWS($dGateway2 = "10.x.6.1",8) $ImageServer = "Server3" Case Else MsgBox (0,"Error","Gateway is: " & StringStripWS($dGateway2,8) & ". ImageServer is: " & $ImageServer & ".") EndSelect It does match to a case and doesn't fail over to the MsgBox. It seems no matter which value is in $dGateway2 it is setting $ImageServer var to Server1. All of the vars are declared as global prior to their use. Code is being run in 64bit compiled .exe. Hopefully someone can point out my error.
  7. Some recent update to Defender in Windows 10 (noticed today) that some AutoIT .exe are being detected as Trojan:Win32/Fuerboos.D!cl and being quarantined automatically. Unfortunately, due to the sensitivity of the programs I've made, I cannot submit them for review to anyone.
  8. I am working on a project where files are rebuilt but the process is dependent on manual intervention in a spreadsheet. I want to be able to complete this complex task without having a spreadsheet and without having to have a copy of Office or some other program installed. The primary reason is that the files that are being manipulated are for a DOS program, and already I am imposing a limitation by building a 32bit AutoIT exe to handle it. The part I am not sure about is what methods I should be looking at to replicate what the spreadsheet does, such as the fact that it uses the formula bar to calculate results based on relative cells on other sheets. What are some good alternatives that I can use instead? Such as using CSV, XML or something else, and more importantly I would also like to see a link to any specific implentation or breakdown of how to use it. For example, I am already familiar with using XML, but not as a way to make the data relational.
  9. It is showing me 144 for AppliedDPI, How can I use this information? Setting the process DPI aware, or using these GDI functions have no effect. https://www.autoitscript.com/forum/topic/166479-writing-dpi-awareness-app-workaround/ @BrewManNH This is in Windows PE, so a lot of normal things may not be viable. For example, there is no real way to make display changes because you can't reload explorer... also there is no explorer.
  10. I have run into a situation where a set of programs are not showing controls properly on a certain display. The particulars are that the "top" parameter of GUICtrlCreateCheckbox needs to be increased on this display, because otherwise the objects are too close together. On other GUI panels this happens, radio buttons, etc, they are not spaced evenly as would be expected, since I am specifying values, it should respect that. This particular GUI will read an INI file and generate checkboxes for the amount of items in the INI: For $i = 1 To $Sections[0] $SectionContents = IniReadSection($source, $Sections[$i]) $topPart = (60 + ($i * 15)) $Radio[$i] = GUICtrlCreateCheckbox($Sections[$i], 80, $topPart, 300, 17) It is expected that it should appear with a spacing similar to this (old image): Which it does (albeit in a Windows 10 UI get-up) on every other sytem I work with. BUT this one system is showing something different. A sideby side of the initial look, and the with a box checked and a mouse hovering (which makes the ctrl labels shift over/under each other). OH and the mouse cursor looks bigger than usual... I can increase the value I am multiplying by, say 25 instead of 15 and it will look properly on this one display, BUT then it spaces things out too much on everything else. Are the pixels wrong on this display? Is there some other way I should be making GUIs on Windows 10 based systems? I will note that I've seen this happen before, but it went uncorrected. The system I am seeing this on is a Clevo N850EJ. Specs are as follows: 15.6” IPS Full HD (1920x1080) Matte Display Switchable GPU by Microsoft Hybrid Graphics - NVIDIA GeForce GTX 1050 GPU / Intel UHD Graphics The OS I am running on is Windows PE 10 x64. Can't tell which video device is driving the display, both are detected and both are using the MS driver. Let me know if anyone has an idea of why this happens, or ways people have fixed it, etc. Thanks!
  11. It was a quick redaction of existing code. Actual code reads xml from a website, if a value is present, then it will create the file. And as my usual method, I believe I have solved this without having to need any of this at all. But at least this topic adds both a problem, and a solution and fills in the missing keyword search results for someone else to find someday. I was trying to save some time, but the solution (as if a lightbulb like this: ) put me into an entirely different direction and took the time to do it properly.
  12. Yes, this isn't about it being an XML file. I create other "text" files that aren't XML but this is the first time I am trying to read from or verify the existance of the file after creating it. Files created by processes executed by the .exe are seen fine. It is just files that the .exe creates, is not seen by the .exe until after it is closed and re-opened. To re-iterate, the issue is if I make a file with _FileWriteLog, FileExists() will return 1 (not found) when checking against it and shows me the MsgBox.
  13. Hey I searched for something and didn't see any related posts! One of my programs creates a log file. I have a need to read from that log file after it is written... this situation basically is me taking 2 .exe and making 1 .exe with some fluff taken out. This basic process seems to be an issue. I am able to write to the file, but FileExists will return 1. Something like this: If $match = "value" Then _FileWriteLog ("c:\folder\data.xml","<?xml version=" & Chr(34) & "1.0" & Chr(34) & "?>") _FileWriteToLine ("c:\folder\data.xml", 1, "<?xml version=" & Chr(34) & "1.0" & Chr(34) & "?>", 1) _FileWriteToLine ("c:\folder\data.xml", 2, "<Key>", 1) _FileWriteToLine ("c:\folder\data.xml", 3, "<Value1>" & $match[1] & "</Value1>", 1) _FileWriteToLine ("c:\folder\data.xml", 4, "</Key>", 1) EndIf If FileExists ( "c:\folder\data.xml" ) Then ; do the thing Else MsgBox ( 4096 , "Error" , "data.xml file not present." ) EndIf Is this because the .exe is looking for the file before it is created or before it is saved? Is it simply that I can put in a sleep of some time which will make it so FileExists will work or is there some other method I can use? Let's pretend I am not using an XML file here and get away from here with your "why are you making XML files like that" posts! Let's pretend it is just a regular old log file. The gist is, I read some data from someplace, make an XML file. Then I must do step 2 which is run an external program that uses that XML file. So then I must make sure the file exists! I can see it in the folder, but get the MsgBox saying it isn't there.
  14. Yes, first thought "run by Windows" may mean the exe is executed in another session, or the file is being created in a location other than where the OP expects, based on the context of the account running the program.
×
×
  • Create New...