All Activity

This stream auto-updates   

  1. Past hour
  2. As @BrewManNH stated earlier in this thread, MozRepl no longer works with the latest versions of FF. I believe it stopped working correctly with FF 54.
  3. Today
  4. Hey Guys.. So I am trying to split up my data that I have loaded into two arrays by my test code (in this case I'm just showing 300.0 and 300.1).. I want it so that if for $ColumnC=300.1 then write to a file called "IC3.txt" the SampleID and 300.1. I will have a lot more functions and test codes eventually but I don't understand why this test case is failing.. Instead of writing "Sample 3 300.1""Sample5 300.1" it just writes "300.1" once.. Global $ColumnC[10] Global $ColumnB[10] $ColumnC[1]="300.0" $ColumnC[2]="300.0" $ColumnC[3]="300.1" $ColumnC[4]="300.0" $ColumnC[5]="300.1" $ColumnB[1]="Sample1" $ColumnB[2]="Sample2" $ColumnB[3]="Sample3" $ColumnB[4]="Sample4" $ColumnB[5]="Sample5" For $i= 0 to UBound($ColumnC) -1 ;~ ConsoleWrite($ColumnC[$i] & @LF) If $ColumnC[$i]="300.1" Then _FileWriteFromArray(@ScriptDir & "\IC3.txt", $ColumnB, $i, $i) _FileWriteFromArray(@ScriptDir & "\IC3.txt", $ColumnC, $i, $i) EndIf Next ConsoleWrite(UBound($ColumnC))
  5. Thanks. I was quite sure I repaired this. I first used DlgWnd but then I found out that Microsoft is talking about Dialog Boxes. Here another example with other dialog boxes #include <Misc.au3> #include "HookDlgBox.au3" ; force german custum button texts for FileOpenDialog _DlgBox_SetButtonNames("Datei öffnen", "Auswahl abbrechen") FileOpenDialog("Test", @ScriptDir, "AutoIt scriptses (*.au3)") _DlgBox_SetButtonNames(Default) _DlgBox_SetPosition(500, 100) _ChooseColor() _DlgBox_SetButtonNames("Lets go", "No no") _ChooseFont()
  6. ControlSend should work same as Send, what is issue with control id?
  7. You have to set proper encoding for the ini before writing to it. Maybe like this: Example() Func Example() ; Set proper encoding for the ini file FileClose(FileOpen("emoji.ini", 32 + 1 + 8)) ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 200, 200) Local $hinput = GUICtrlCreateInput("", 25, 25, 150, 25) Local $idOK = GUICtrlCreateButton("OK", 75, 100, 50, 25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case -3 ExitLoop Case $idOK $emoji = GUICtrlRead($hinput, 1) IniWrite("emoji.ini", "1", "emoji", $emoji) MsgBox(0, "", IniRead("emoji.ini", "1", "emoji", "")) EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc
  8. kaufpark, A small example of using timers for the time of day and a 10 second countdown... #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <timers.au3> #AutoIt3Wrapper_Add_Constants=n Local $gui010 = GUICreate('WM_Timer Example',310,70) GUICtrlCreateLabel('Time of Day', 10, 10, 100, 20) Local $TOD = GUICtrlCreateLabel('', 10, 30, 100, 20, BitOR($ss_center, $ss_sunken, $ss_centerimage)) GUICtrlCreateLabel('10 second Count', 200, 10, 100, 20) Local $10sec = GUICtrlCreateLabel('10', 200, 30, 100, 20, BitOR($ss_sunken, $ss_center, $ss_centerimage)) Local $dummy_TOD = GUICtrlCreateDummy() Local $dummy_10sec = GUICtrlCreateDummy() GUISetState() GUIRegisterMsg($wm_timer, 'WM_TIMER') Local $tod_timer = _Timer_SetTimer($gui010, 500, '', -1) Local $10sec_timer = _Timer_SetTimer($gui010, 1000, '', -1) While 1 Switch GUIGetMsg() Case $gui_event_close Exit Case $dummy_TOD GUICtrlSetData($TOD, StringFormat('%02i:%02i:%02i', @HOUR, @MIN, @SEC)) Case $dummy_10sec If GUICtrlRead($10sec) = 0 Then GUICtrlSetBkColor($10sec, 0xffffffff) GUICtrlSetData($10sec, 10) ContinueLoop EndIf GUICtrlSetData($10sec, GUICtrlRead($10sec) - 1) If GUICtrlRead($10sec) = 0 Then GUICtrlSetBkColor($10sec, 0xff0000) EndSwitch WEnd Func WM_TIMER($hWnd, $iMsg, $iwParam, $ilParam) Switch $iwParam Case $tod_timer GUICtrlSendToDummy($dummy_TOD) Case $10sec_timer GUICtrlSendToDummy($dummy_10sec) EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_TIMER kylomas
  9. And thanks you for junkew, I find the new version of FF.au3 and FFEx.au3. But it's not work too.
  10. Hi, i'm new to AutoIt. And I have the same problem too. I'm using FF 56 with MozRepl. However, I can sent command to MozRepl and it seems work fine. But I find that I can't get any return from it. For example, I can open a new tab/change url. But I can't get the page HTML code or get the current URL etc. I had try several ways to get the HTML, all return empty. Here is my code. #RequireAdmin #include <FF.au3> #include <FFEx.au3> If _FFStart("https://www.google.com", Default, 0) Then Sleep(15000) $sHTML = _FFReadHTML() ConsoleWrite($sHTML) $sHTML = _FFReadHTML("html",7) ConsoleWrite($sHTML) ;;https://stackoverflow.com/questions/45149596/autoit-ff-au3-cant-check-if-element-is-focused _FFCmd("FFau3.GetInnerHTML=function GetInnerHTML(a) {return '123456'};", 15000) Sleep(20000) $sHTML = _FFCmd("FFau3.GetInnerHTML(1)") ;; Return empty too. ConsoleWrite($sHTML) $sHTML = _FFCmd("gBrowser.contentDocument", 25000) ; _FFReadHTML("html",8) Sleep(400) ConsoleWrite($sHTML) $sHTML = _FFCmd("content.document", 25000) ; _FFReadHTML("html",8) Sleep(400) ConsoleWrite($sHTML) $sHTML = _FFCmd("window.opener.content.document", 25000) ; _FFReadHTML("html",8) Sleep(400) ConsoleWrite($sHTML) $sHTML = _FFCmd("window.content.document.documentElement", 25000) ; _FFReadHTML("html",8) Sleep(400) ConsoleWrite($sHTML) EndIf One more thing, I can not use the _FFIsConnected(). It seem "_FFCmd("FFau3 != null?1:0") = 1" return empty, so it throw to error. P.S.: I turn off my firewall too.
  11. I can set windows tasks up for this why do I need this tool?
  12. Hi all, I have a script running Ok, but I want to pause this script in 10s by hold mouse left, and when mouseup the script continue run. But I dont know how to do it? Anyone can help me some ideas to do that? Tks for read
  13. Func _PrintLabel() ;window already registered as EXISTS MouseMove(@DesktopWidth / 2, @DesktopHeight / 2, 1) ;move mouse to center of the screen WinActivate($LabelWindow) ;Activate label window Send("^p") ;Send print shortcut WinWaitActive($PrintWindow) ;wait till print dialog shows If WinGetText($PrintWindow, "General") = "" Then ;No general tab meaning normal print dialog WinActivate($PrintWindow) Send('{DOWN ' & $DownCount & '}') ;go down to a specfic printer for label Sleep(1000) ;need small delay Send("{ENTER}") ;hits print WinWait("Progress", "", 3) ;This window pops out while files being transfered to the printer. WinWaitClose("Progress", "", 3) WinClose($LabelWindow) Assign("NothingPrinted", 0) SoundPlay($BeepSound, 1) Else SoundPlay($BeepError, 1) ;Not normal print dialog MsgBox(16, "Error", "Page did not load correctly. Refresh the page and Print it manually.") EndIf EndFunc ;==>_PrintLabel Corporate computers are loaded with crap causing all sorts of lag everywhere. Here for example you can see i need sleep just to wait for window to update once printer is selected. And what is wrong with the code wrapper ? It used to be good years ago and now its just random colors allover but only RIGHT AFTER posting it. Once page is refreshed, its normal. (Firefox latest release)
  14. So when the temp changes you want it to display inside the GUI? Maybe BrewManNH has your solution in this thread? He uses a label as a display for the counter. I assume you would want the label to display the temperature every 10 seconds? GUICtrlSetData($lbl01, $seconds) #include <GUIConstantsEx.au3> $seconds = 0 $gui = GUICreate("Test", 360, 333) $btn01=GUICtrlCreateButton("START",15,15) GUISetFont(222 ) $lbl01 = GUICtrlCreateLabel("", 25, 53, 330, 300) GUISetState() Global $cnt=0, $swh=0 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $btn01 $cnt +=1 $swh=mod($cnt,2) $tBegin01 = TimerInit() EndSwitch If $swh=1 and TimerDiff($tBegin01) > 999 Then $seconds +=1 GUICtrlSetData($lbl01, $seconds) $tBegin01 = TimerInit() EndIf WEnd
  15. Yesterday
  16. Hey Guys, Currently I work on a own VPN Launcher over the OpenVPN Client to create a own App like Tunngle / Hamachi All works great but the TAP-Windows Adapter v9 need to get a low Metric but Autoit couldn't force any admin commands for me. I tried to hack the Registry Entries first but this Method need to disable / enable the Interface as Admin to apply all settings & this method don't work with Win7 in my Tests. If someone know how to identify the correct Interface by Description "TAP-Windows Adapter v9" so I could set the correct Metric. Currently I rename the exist Adapter in the most Ethernet 2 but this is not trust if named the correct Adapter every time on other PCs with more Ethernet Adapters. Why is this necessary? My VPN needed this low Metric to find the most Local playable Games. Priority musst the highest to make all work fine with Games. Someone could help me to realize it... THX
  17. RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", @ScriptFullPath, "REG_SZ", "RUNASADMIN")
  18. Hi @UEZ, thanks a lot for the way to do it right with _GDIPlus_PathIsVisiblePoint(). I edit my post #1 with the final code solution by a other suggestion from Mars (german forum) because it's more easy and shorter. I will not produce any memory leaks in the future . Thanks for your help - I'm grateful! Sven
  19. I try to save in text file but the same problem !!! although when I send it in MsgBox it's sent properly !
  20. I'M AN IDIOT! Line 33 starts an external program. Said external program is also written in Autoit. Said external Autoit program may not have possessed a complete While statement at the latest compiling. Oops. Sorry for wasting your time.
  21. Thank you so much! Quick question though, why would line 40 cause it to have a problem with while? My error says that my While is missing a Wend.
  22. You have to add two additional check points otherwise the corner of the player sprite will stay outside the red path object. ; includes --------------------------------------------------------------------- #include-once #include <GDIPlus.au3> #include <Misc.au3> ; declaration ------------------------------------------------------------------ Local Const $iGuiWidth = 1000 Local Const $iGuiHeight = 690 Local Const $iGuiLeft = 10 Local Const $iGuiTop = 10 Local Const $GUI_EVENT_CLOSE = -3 Local Const $iPlayerHeight = 48 Local Const $iPlayerWidth = 32 Local Const $iPlayerStep = 4 Local $iXPosPlayer = 16 Local $iYPosPlayer = 16 Local Const $iXPosBlueRectangle = 100 Local Const $iYPosBlueRectangle = 100 Local Const $iBlueRectangleWidth = 128 Local Const $iBlueRectangleHeight = 160 Local Const $iXPosTree = 100 Local Const $iYPosTree = 100 Local Const $iTreeWidth = 128 Local Const $iTreeHeight = 160 Local Const $sPlayerImg = 'player01_01.png' Local Const $sTreeImg = 'tree01_01.png' ; gui -------------------------------------------------------------------------- Local $hMainGui = GUICreate( '', $iGuiWidth, $iGuiHeight, $iGuiLeft, $iGuiTop ) GUISetState( @SW_SHOW, $hMainGui ) ; init ------------------------------------------------------------------------- Opt( 'GUIOnEventMode', 1 ) GUISetOnEvent( $GUI_EVENT_CLOSE, '_exit' ) _GDIPlus_Startup() Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND( $hMainGui ) Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics( $iGuiWidth, $iGuiHeight, $hGraphics ) Local $hBuffer = _GDIPlus_ImageGetGraphicsContext( $hBitmap ) Local $vWhite = _GDIPlus_BrushCreateSolid( 0xFFFFFFFF ) Local $vBlue = _GDIPlus_BrushCreateSolid( 0xFFABCDEF ) Local $vRed = _GDIPlus_BrushCreateSolid( 0xFFFF0000 ) Local $hGraphicPath = _GDIPlus_PathCreate() _GDIPlus_PathAddRectangle( $hGraphicPath, 130, 215, 70, 35 ) ; set red collision area Local $hImagePlayer = _GDIPlus_ImageLoadFromFile( $sPlayerImg ) Local $hImageThree = _GDIPlus_ImageLoadFromFile( $sTreeImg ) ; functions -------------------------------------------------------------------- Func _exit() _GDIPlus_PathDispose( $hGraphicPath ) _GDIPlus_BrushDispose( $vRed ) _GDIPlus_BrushDispose( $vBlue ) _GDIPlus_BrushDispose( $vWhite ) _GDIPlus_GraphicsDispose( $hBuffer ) _GDIPlus_BitmapDispose( $hBitmap ) _GDIPlus_BitmapDispose( $hImagePlayer ) _GDIPlus_BitmapDispose( $hImageThree ) _GDIPlus_GraphicsDispose( $hGraphics ) _GDIPlus_Shutdown() GUIDelete( $hMainGui ) Exit EndFunc ; processing ------------------------------------------------------------------- While 1 _GDIPlus_GraphicsClear( $hBuffer ) _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight, $vWhite ) ; draw player background _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosBlueRectangle, $iYPosBlueRectangle, $iBlueRectangleWidth, $iBlueRectangleHeight, $vBlue ) ; draw tree background _GDIPlus_GraphicsDrawImageRect( $hBuffer, $hImagePlayer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight ) ; draw player _GDIPlus_GraphicsDrawImageRect( $hBuffer, $hImageThree, $iXPosTree, $iYPosTree, $iTreeWidth, $iTreeHeight ) ; draw tree _GDIPlus_GraphicsFillPath( $hBuffer, $hGraphicPath, $vRed ) ; draw red collision area If _IsPressed( '25' ) Then ; left If Not Check_for_Collision($iXPosPlayer - $iPlayerStep, $iYPosPlayer, $iXPosPlayer - $iPlayerStep + $iPlayerWidth, $iYPosPlayer, _ $iXPosPlayer - $iPlayerStep, $iYPosPlayer + $iPlayerHeight, $iXPosPlayer - $iPlayerStep + $iPlayerWidth, $iYPosPlayer + $iPlayerHeight, $hGraphicPath) Then $iXPosPlayer -= $iPlayerStep _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight, $vWhite ) EndIf EndIf If _IsPressed( '27' ) Then ; right If Not Check_for_Collision($iXPosPlayer + $iPlayerStep, $iYPosPlayer, $iXPosPlayer + $iPlayerStep + $iPlayerWidth, $iYPosPlayer, _ $iXPosPlayer + $iPlayerStep, $iYPosPlayer + $iPlayerHeight, $iXPosPlayer + $iPlayerStep + $iPlayerWidth, $iYPosPlayer + $iPlayerHeight, $hGraphicPath) Then $iXPosPlayer += $iPlayerStep _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight, $vWhite ) EndIf EndIf If _IsPressed( '26' ) Then ; up If Not Check_for_Collision($iXPosPlayer, $iYPosPlayer - $iPlayerStep, $iXPosPlayer + $iPlayerWidth, $iYPosPlayer - $iPlayerStep, _ $iXPosPlayer, $iYPosPlayer - $iPlayerStep + $iPlayerHeight, $iXPosPlayer + $iPlayerWidth, $iYPosPlayer - $iPlayerStep + $iPlayerHeight, $hGraphicPath) Then $iYPosPlayer -= $iPlayerStep _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight, $vWhite ) EndIf EndIf If _IsPressed( '28' ) Then ; down If Not Check_for_Collision($iXPosPlayer, $iYPosPlayer + $iPlayerStep, $iXPosPlayer + $iPlayerWidth, $iYPosPlayer + $iPlayerStep, _ $iXPosPlayer, $iYPosPlayer + $iPlayerStep + $iPlayerHeight, $iXPosPlayer + $iPlayerWidth, $iYPosPlayer + $iPlayerStep + $iPlayerHeight, $hGraphicPath) Then $iYPosPlayer += $iPlayerStep _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight, $vWhite ) EndIf EndIf _GDIPlus_GraphicsDrawImageRect( $hGraphics, $hBitmap, 0, 0, $iGuiWidth, $iGuiHeight ) Sleep( 10 ) WEnd Func Check_for_Collision($x1, $y1, $x2, $y2, $x3, $y3, $x4, $y4, $hPath) Return BitOR(_GDIPlus_PathIsVisiblePoint($hPath, $x1, $y1), _GDIPlus_PathIsVisiblePoint($hPath, $x2, $y2), _ _GDIPlus_PathIsVisiblePoint($hPath, $x3, $y3), _GDIPlus_PathIsVisiblePoint($hPath, $x4, $y4), _ _GDIPlus_PathIsVisiblePoint($hPath, $x1, ($y1 + $y3) / 2), _GDIPlus_PathIsVisiblePoint($hPath, $x2, ($y2 + $y4) / 2)) EndFunc Further _GDIPlus_ImageLoadFromFile in an endless loop causes a memory leak!
  23. Funtime60, The include lines you have at the top of your script actually insert the entire include file at that point - so your script does not start until many, many lines later than you think. Look in the SciTE Help file for Au3Stripper with the /MergeOnly option - that gives you a file similar to the one used to compile and allows you to determine which line is giving you the problem. My guess: the StringSplit on line #40, because you will crash if you try to access a non-existent array. So add some errorchecking to confirm you have a valid array after the function call. M23 Edit: Which is what he just said as well!
  24. @Mannyfresh31 in the future when responding please hit the reply button rather than Quote. Quoting everything everyone says pads the thread unnecessarily.
  25. _DlgBox <> _DlgWnd =)
  26. @Funtime60 the difference in lines is due to your includes, as all of those lines are counted too. The best way to narrow down errors is through good coding practices. This would include proper error checking after every action. Below is just a short example of this inside your script: Local $CoFPath, $CoFile, $Config $CoFPath = @WorkingDir & "\Settings.cfg" If FileExists($CoFPath) Then $CoFile = Fileopen($CoFPath, $FO_READ) Else ConsoleWrite("Unable to open " & $CoFPath & @CRLF) EndIf Writing your script in this manner allows you to track down issues much more quickly, and the line number become irrelevant
  27. I'm getting an error on that says there is an error at line 7000 something. There are two major problems here, A) this worked early although it was a different machine, and my code is only 61 lines long. Any clues as to what's going on? (Please excuse any stupid things I wrote in here. I bet there's a lot.) Chat.au3
  1. Load more activity