Jump to content

VeryGary

Active Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by VeryGary

  1. Much luck with your rammed-down-the-throat, riddled with spyware -- or "Telemetry" as its called by MS -- and its mandatory udates which can just rip out functionality -- see webcams -- Win10 though. You are now merely a user of the OS -- going along for the ride -- , while I'm still the owner of mine. :-) I lol'd. Bro, Win 3.1.1 + Trumpet Winsock + Mozilla 1.0 ftw.
  2. Which do you prefer? They look functionally the same. Well, I mean perhaps. You see,, the first example has a function, so perhaps it is the more functional of the two?
  3. By 4th column, do you mean $aArray[$iRow][4] or [3] (0-indexed)? In other words, is your [0] column your first column or your zeroth column? Personally I never did like thinking of arrays in columns and rows, rather just dimensions. Those dimensions could represent anything. The file cabinet, trash can, VW Bug trunk, pickle jar, or watever other enumerated thing that can hold things and things.
  4. I'm not really familiar with json or that .au3, but could you do something hacky like: Local $sJSON = '{"foo":"foo","bar":["bar"],"test":["",{"foo":{"bar":["","",{"foo":{"bar":"Test"}}]}}]}' ConsoleWrite ( $sJSON & @CRLF ) $sJSON = StringRegExpReplace ( $sJSON, '"foo"[,:]', '' ) $sJSON = StringRegExpReplace ( $sJSON, '"foo"', '' ) ConsoleWrite ( "Deleted: " & $sJSON & @CRLF )
  5. I think you want... _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 3", 2, 2) If you want "Row 1: Col 3" to appear in Row 2, Col 2 you have to create an item for row 2 and add it as a subitem for that item. _GUICtrlListView_AddItem() creates the row and first item in the row. _GUICtrlListView_AddSubItem() creates additional subitems in the row. Items and subitems are oriented left to right, not top to bottom.
  6. Edit: If I run the code with the line uncommented or not, it doesn't generate an error for me.
  7. When I run your script with the line uncommented, it doesn't generate an error for me.
  8. ... And now it's working. Fought with this for an hour and posted then it decides to work properly. IE, I hate you. Edit: I spoke too soon. This must be some kind of race condition that poisons the text property with the previously loaded page if it's called while the 1st page is loaded and the 2nd is loading or something. (That is, IE thinks the URL is the second page, but it reads the body from the first page, then it sets the property thinking all is good and doesn't rewrite the property once the page is actually back to readystate.) Is there a way to reset the full DOM after I'm done with the first page or something? Maybe force IE to rewrite properties? Edit again: Putting a "_IENavigate ( $oIE, "about:blank", 0 )" before loading the google page seems to fix it... ?
  9. #include <IE.au3> Local $oIE = _CreateIE () Local $iCounter ConsoleWrite ( "Loading Google" ) _IENavigate ( $oIE, "https://www.google.com/", 0 ) $iCounter = 0 While Not StringInStr ( _IEBodyReadText ( $oIE ), "Feeling Lucky", 2 ) Sleep ( 1000 ) $iCounter = $iCounter + 1 ConsoleWrite ( "." ) If $iCounter > 30 Then ConsoleWrite ( @CRLF & _IEBodyReadText ( $oIE ) & @CRLF ) ExitLoop EndIf WEnd Func _CreateIE() Local $iRegKeyFlag, $sRegKey $sRegKey = RegRead ('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main','SessionMerging') If @error <> 0 Then $iRegKeyFlag = 1 ; make internet explorer not share session data between tabs/windows. hopefully this isolates windows. RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main','SessionMerging','REG_DWORD','00000000') Local $hWnd = 0 While $hWnd = 0 ; hack to be able to locate correct IE window. load page that displays server environment variables and seed a variable with a random key value. Local $sRand = Random ( 2^16+1, 2^31-1, 1) Run('"C:\Program Files (x86)\Internet Explorer\iexplore.exe" -nosessionmerging -private http://www.all-nettools.com/toolbox/environmental-variables-test.php?' & $sRand ) $hWnd = WinWait ( "", "http://www.all-nettools.com/toolbox/environmental-variables-test.php?" & $sRand, 10) If $hWnd <> 0 Then $oIE = _IEAttach ( $hWnd, "hwnd" ) WEnd ; set it back to what it was before. If $iRegKeyFlag <> 1 Then RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main','SessionMerging','REG_DWORD', $sRegKey) Else RegDelete ('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main','SessionMerging') EndIf Return $oIE EndFunc When I run the above code, _IEBodyReadText () returns the body for the prior (all-nettools) page, even when the new page is fully loaded and in good readyState. Not Google as expected. I am using IE 11 on 64bit Win 7. How to get actual body text?
  10. This could be a bug in the win api. I'd like to find a way to work around it. When I use the GUICtrlCreateInput() to create an input field, enter some text, highlight it all and change it to some other text, then GUICtrlSetStyle() the control $ES_READONLY, the right-click context menu for the control still shows an enabled "Undo" option that can be selected and "undo" back to the original value, even though the field is readonly. Ctrl-Z on the control doesn't trigger an Undo operation though, so I don't think it's an intended "feature". Is there a way to disable the Undo option on the context menu manually, or unset a flag that the field has been modified, so the user can't change the value when it's readonly? Edit: This is a kludge, but I can GUICtrlSetData($iBox, GUICtrlRead ($iBox) ) when setting it $ES_READONLY and it will clear the undo data, but this has the side effect of losing the undo data when I unset $ES_READONLY. I'd really like something cleaner, if anyone has any ideas. Edit 2: Looking at https://msdn.microsoft.com/en-us/library/windows/desktop/bb775458(v=vs.85).aspx it appears there are messages where I can perform an undo, read the data from the control, then clear the undo data. Then I could set it read only. When I wanted to unset the readonly, I could ControlSend the undo data & Ctrl-A & current data. Although, I'm afraid the ControlSend delay would make it take too long for a form with many Input boxes. I'd still like something cleaner, if anyone has any ideas.
  11. Actually it was _SendMessage($form, $WM_SETREDRAW, False/True, 0) followed by _WinAPI_RedrawWindow ($form, $tRect, 0, BitOR( $RDW_FRAME, $RDW_INVALIDATE, $RDW_ALLCHILDREN)) for the updated $tagRect. I got it sorted this morning. Thanks. No more flickering controls, and they paint more or less all at once.
  12. So, I seem to remember reading years ago there was a way to suspend the painting of GUI updates and resume it, so you had time to do all your changes and make them appear all at once... Searching is giving me a headache. Any ideas?
  13. The coord struct was just a "int; int". I ended up doing the following: $a = "int; " Const $JUMPS = 1; number of jumps in this move $a &= "int; " Const $NEWPIECE = 2; moving piece after jump $a &= "int; " Const $OLDPIECE = 3; moving piece before jump $a &= "int; int; int; int; " Dim Const $FROM[2] = [4,5] ; from,to squares of moving piece Dim Const $TO[2] = [6,7] For $t = 1 to 24 $a &= "int; " Next Dim Const $PATH[12][2] = [ [8,9],[10,11],[12,13],[14,15],[16,17],[18,19], _ [20,21],[22,23],[24,25],[26,27],[28,29],[30,31] ] ; intermediate squares to jump to For $t = 1 to 24 $a &= "int; " Next Dim Const $DEL[12][2] = [ [32,33],[34,35],[36,37],[38,39],[40,41],[42,43], _ [44,45],[46,47],[48,49],[50,51],[52,53],[54,55] ] ; squares where men are removed For $t = 1 to 12 $a &= "int" If $t < 12 Then $a &= "; " EndIf Next Dim Const $DELPIECE[12] = [56,57,58,59,60,61,62,63,64,65,66,67] Using the Const's for index values within the struct instead of the parameter name.
  14. The problem is with your image editor, not your code. If you look very closely at the generated image: you will see there are many shades of pink, none of which match the color used to flag transparency.
  15. It looks like what you want is a two dimensional array, with an x and y coordinate, such as: Dim $textarray[3][3] ... For $o = 1 to 2 If $o = $n Then Call ("TIGER") Return Else Send ($textarray[$o][2]) Send ("{TAB}") Send ("{TAB}") Send ($textarray[$o][1]) Send ("{TAB}") EndIf Next
  16. I'm playing around with creating a UI for engines built using the Checkerboard API, but I'm having difficulty creating the struct required for calls to the .dll. The API documentation defines the C++ struct: struct CBmove { int jumps; // number of jumps in this move int newpiece; // moving piece after jump int oldpiece; // moving piece before jump struct coor from,to; // from,to squares of moving piece struct coor path[12]; // intermediate squares to jump to struct coor del[12]; // squares where men are removed int delpiece[12]; // piece type which is removed } How do i go about creating a substruct within my DllStructCreate( "Struct" )? Do I somehow use Arrays in their place?
  17. JohnOne, He's not looking for any PID, he's looking for the return code from the Run()'d executable, as indicated by the following: RunWait returns the exit code of the process, not the PID. All this talk of PIDs is irrelevant and confusing the situation. When a program is called from cmd.exe and exits it returns an exit code to the shell which is assigned to the environment variable %errorlevel%. therks solution is much cleaner than mine.
  18. So, let me understand you. You want the exit code of the $var process to return to your calling function... unless there is a timeout. The documentation on Run() and RunWait() indicate two different values being returned. Runwait() Return Value: Success: Returns the exit code of the program that was run. Failure: Returns 0 and sets @error to non-zero. Run() Return Value: Success: The PID of the process that was launched. Failure: Returns 0 and sets @error to non-zero. You can't get the exit code of the process with Run(). The best you can do using only AutoIt is to launch a second script from within the first script. Your first script would launch the second script with Run(), passing $var as a command line parameter, then monitor the other script, looking for it's execution to stop and to get the exit code data from that script; or for a timeout exception. The second script would launch the $var process with RunWait() then send $var's exit code back to the first script through a communication mechanism outside of Return(), as your first script has no way to get the second script's exit code via that mechanism. A simple filewrite with the exit code is an quick cludge, but there are other inter-script communication methods that could be used as well. Hope this helps.
  19. I'm wondering before I get started on this, if anyone has done any work on a MNMAPI (Microsoft Network Monitor API) udf to call this library. I've seen stuff built around WinPCap, but this doesn't seem to offer support for NDIS 6.0, which means you can't use it to sniff a wifi card's packets. Anyone know if this wheel is already invented? Gary
×
×
  • Create New...