trinitrotoluen Posted February 9, 2009 Share Posted February 9, 2009 Can you add a possible click with coordinate x,y in the _FFClick function ? Link to comment Share on other sites More sharing options...
Stilgar Posted February 9, 2009 Share Posted February 9, 2009 (edited) @trinitrotoluen: I'm not sure. What would you do with it? Edited February 9, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
FireFox Posted February 9, 2009 Share Posted February 9, 2009 Can you add a possible click with coordinate x,y in the _FFClick function ? It would be great Cheers, FireFox. Link to comment Share on other sites More sharing options...
Stilgar Posted February 11, 2009 Share Posted February 11, 2009 (edited) I can try do add something, but I'm not sure if it's possible without toooo much work.Here is a other example for the FF.au3. You can not only control the browser - all AddOns, too!Here's an example for FireFM:expandcollapse popup#region Includes #include <Array.au3> #include <FF.au3> #endregion Includes $Socket = _FFConnect() If $Socket > -1 Then _FF_FireFM_Player($Socket, "Play") If Not @error Then sleep(10000) ; set volume _FF_FireFM_SetVolume($Socket, 70) ; get title information $a = _FF_FireFM_GetTitleInfo($Socket) _ArrayDisplay($a) sleep(10000) ; skip the current song _FF_FireFM_Player($Socket) ; stop playing sleep(10000) _FF_FireFM_Player($Socket, "Stop") EndIf EndIf Exit ; #FUNCTION# =================================================================== ; Name ..........: _FF_FireFM_GetTitleInfo ; Description ...: FireFM informations of the current title ; AutoIt Version : V3.3.0.0 ; Requirement(s).: FF.au3 / MozRepl ; Syntax ........: _FF_FireFM_GetTitleInfo(ByRef $Socket) ; Parameter(s): .: $Socket - TCP Socket ; Return Value ..: Success - 2 dim Array with the title information: [discription][info] ; - [0] = id ; - [1] = location ; - [2] = title ; - [3] = recording ; - [4] = albumTitle ; - [5] = artist ; - [6] = duration ; - [7] = imagePath ; - [8] = trackAuth ; - [9] = albumID ; - [10] = artistID ; - [11] = artistURL ; - [12] = albumURL ; - [13] = trackURL ; - [14] = buyTrackURL ; - [15] = buyAlbumURL ; - [16] = freeTrackURL ; - [17] = startTime ; Failure - Array [0][0]=0 ; @ERROR - ; Author(s) .....: Thorsten Willert ; Date ..........: Wed Feb 11 11:46:19 CET 2009 @490 /Internet Time/ ; ============================================================================== Func _FF_FireFM_GetTitleInfo(ByRef $Socket) Local $aInfo, $aRet[1][1], $aTmp, $bPlaying Local $iTicks, $iHours, $iMins, $iSecs $bPlaying = _FFSetGet($Socket, "FireFM.Player.isPlaying;") If @error Or Not $bPlaying Then SetError(1) Return $aRet[0][0] = 0 EndIf $aInfo = StringSplit(_FFSetGet($Socket, "repl.inspect(FireFM.Player.track);"), @crlf, 2) If Not @error And IsArray($aInfo) And Ubound($aInfo) > 18 Then ReDim $aRet[18][2] For $i = 0 To 17 $aTmp = StringRegExp($aInfo[$i], "<object>.(.*?)=(.*?)$", 3) $aRet[$i][0] = $aTmp[0] $aRet[$i][1] = $aTmp[1] Next $iTicks = Round($aRet[6][1] / 1000) $iHours = Int($iTicks / 3600) $iTicks = Mod($iTicks, 3600) $iMins = Int($iTicks / 60) $iSecs = Round(Mod($iTicks, 60)) If $iHours > 0 Then $aRet[6][1] = $iHours & ":" & $iMins & ":" & $iSecs Else $aRet[6][1] = $iMins & ":" & $iSecs EndIf Else SetError(1) Return $aRet[0][0] = 0 EndIf Return $aRet EndFunc ;==>_FF_FireFM_GetTitleInfo ; #FUNCTION# =================================================================== ; Name ..........: _FF_FireFM_Player ; Description ...: FireFM Player ; AutoIt Version : V3.3.0.0 ; Requirement(s).: FF.au3 / MozRepl ; Syntax ........: _FF_FireFM_Player(ByRef $Socket[, $sAction = "skip"]) ; Parameter(s): .: $Socket - TCP Socket ; $sAction - Optional: (Default = "skip") : play, stop, skip ; Return Value ..: Success - Status playing 1/0 ; Failure - -1 ; @ERROR - ; Author(s) .....: Thorsten Willert ; Date ..........: Wed Feb 11 11:57:17 CET 2009 @498 /Internet Time/ ; ============================================================================== Func _FF_FireFM_Player(ByRef $Socket, $sAction = "skip") Local $iCount = 0 Local $bPlaying = _FFSetGet($Socket, "FireFM.Player.isPlaying;") If @error Then SetError(1) Return -1 EndIf Switch $sAction Case "stop" _FFSetGet($Socket, "FireFM.Player.stop();") Case "play" If Not $bPlaying Then _FFSetGet($Socket, "FireFM.Player.play();") While Not _FFSetGet($Socket, "FireFM.Player.isPlaying;") And $iCount < 5000 Sleep(250) $iCount += 250 Wend EndIf Case "skip" If $bPlaying Then _FFSetGet($Socket, "FireFM.Player.skip();") While Not _FFSetGet($Socket, "FireFM.Player.isPlaying;") And $iCount < 5000 Sleep(250) $iCount += 250 Wend EndIf Case Else SetError(1) Return -1 EndSwitch Return _FFSetGet($Socket, "FireFM.Player.isPlaying;") EndFunc ;==>_FF_FireFM_Player ; #FUNCTION# =================================================================== ; Name ..........: _FF_FireFM_SetVolume ; Description ...: FireFM Volume ; AutoIt Version : V3.3.0.0 ; Requirement(s).: FF.au3 / MozRepl ; Syntax ........: _FF_FireFM_SetVolume(ByRef $Socket[, $iVolume = 50]) ; Parameter(s): .: $Socket - TCP Socket ; $iVolume - Optional: (Default = 50) : 0-100 ; Return Value ..: Success - Volume 0-100 ; Failure - -1 ; @ERROR - ; Author(s) .....: Thorsten Willert ; Date ..........: Wed Feb 11 11:57:25 CET 2009 @498 /Internet Time/ ; ============================================================================== Func _FF_FireFM_SetVolume(ByRef $Socket, $iVolume = 50) _FFSetGet($Socket, "FireFMChrome.UIState._setVolume(" & $iVolume & ");") If @error Then SetError(1) Return -1 EndIf Return _FFSetGet($Socket, "FireFM.Player.volume;") EndFunc ;==>_FF_FireFM_SetVolumeIn the future are more examples and updates are there:FF.au3 Examples Edited February 11, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
Stilgar Posted February 15, 2009 Share Posted February 15, 2009 Added more examples to control FF-AddOns: FireFM, Fox!Box and ScreenGrab:FF-AddOn UDFs jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
Stilgar Posted February 16, 2009 Share Posted February 16, 2009 I've uploaded a new version:V0.3.6.1bAdded some new functions in the last versions:; returns the text or html of a table cell _FFTableGetCell(ByRef $Socket, $vTable, $iColumn, $iRow[, $sMode = "index"[, $sReturnMode = "text"[, $bCompress = true]]]) ; returns the value of a XPath query _FFGetValueByXPath(ByRef $Socket, $sQuery[, $sReturnType = "string"[, $iFilter = 1]]) ; duplicates a tab _FFTabDuplicate(ByRef $Socket[, $vTab = -1[, $sMode = "index"[, $bToFront = false]]])Changelog jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted February 16, 2009 Share Posted February 16, 2009 Hi, Stilgar. I've downloaded your newest version. I wanna ask if there is any function can extract text in the defined region. Link to comment Share on other sites More sharing options...
Stilgar Posted February 16, 2009 Share Posted February 16, 2009 Hi, Stilgar. I've downloaded your newest version. I wanna ask if there is any function can extract text in the defined region.How is the region defined? Have you an example ot the html-code? jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted February 16, 2009 Share Posted February 16, 2009 How is the region defined? Have you an example ot the html-code?Sorry I don't know how to explain that, do you know Imacros, a great automatic addon for Firefox, it can extract text in the region defined.https://addons.mozilla.org/en-US/firefox/addon/3863 Link to comment Share on other sites More sharing options...
Stilgar Posted February 16, 2009 Share Posted February 16, 2009 (edited) Sorry I don't know how to explain that, do you know Imacros, a great automatic addon for Firefox, it can extract text in the region defined. https://addons.mozilla.org/en-US/firefox/addon/3863 I think you can use _FFGetValueByXPath to do this e.g.: #include <FF.au3> $Socket = _FFConnect() If $Socket > -1 Then _FFTabAdd($Socket, "http://ff-au3-example.thorsten-willert.de/") MsgBox(64, "Fieldset-Legend:", _FFGetValueByXPath($Socket, "//form[@id='Programmiersprache']/fieldset/legend")) EndIf The XPath queries can you generate with the AddOns XPather or FireBug. https://addons.mozilla.org/de/firefox/addon/1192 https://addons.mozilla.org/de/firefox/addon/1843 Edited February 16, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted February 16, 2009 Share Posted February 16, 2009 I think you can use _FFGetValueByXPath to do this e.g.: #include <FF.au3> $Socket = _FFConnect() If $Socket > -1 Then _FFTabAdd($Socket, "http://ff-au3-example.thorsten-willert.de/") MsgBox(64, "Fieldset-Legend:", _FFGetValueByXPath($Socket, "//form[@id='Programmiersprache']/fieldset/legend")) EndIf The XPath queries can you generate with the AddOns XPather or FireBug. https://addons.mozilla.org/de/firefox/addon/1192 https://addons.mozilla.org/de/firefox/addon/1843 Thank you ! Great ! Link to comment Share on other sites More sharing options...
trinitrotoluen Posted February 17, 2009 Share Posted February 17, 2009 ERROR: _FFFrameGetSelected(): undefined function.Hi, After I download your newest FF.au3 I can't build FF_Page_Analyzer Link to comment Share on other sites More sharing options...
Stilgar Posted February 17, 2009 Share Posted February 17, 2009 Sure you can. You only must download the FF_Page_Analyzer again jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted February 17, 2009 Share Posted February 17, 2009 No, I can't either. ERROR: _FFFrameGetSelected(): undefined function. Link to comment Share on other sites More sharing options...
Stilgar Posted February 17, 2009 Share Posted February 17, 2009 No, I can't either. Which FF.au3 version do you have? In V0.4.0.0 I changed some function names. jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted February 17, 2009 Share Posted February 17, 2009 I've downloaded your newest FF.au3 and in fact there is no _FFFrameGetSelected() function Link to comment Share on other sites More sharing options...
Stilgar Posted February 17, 2009 Share Posted February 17, 2009 (edited) I've downloaded your newest FF.au3 and in fact there is no _FFFrameGetSelected() function Strange:Here's a"screenshot" from the latest version I've uploaded:There is the _FFFrameGetSelected function and you must have some more informations in the console if you made a new connection to FF.Just try it again, please FF.au3 Edited February 17, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted February 17, 2009 Share Posted February 17, 2009 I downloaded from http://thorsten-willert.de/Themen/AutoIt-F...3/FF.au3/FF.au3 Link to comment Share on other sites More sharing options...
trinitrotoluen Posted February 17, 2009 Share Posted February 17, 2009 (edited) Everything fine ! Edited February 18, 2009 by trinitrotoluen Link to comment Share on other sites More sharing options...
trinitrotoluen Posted February 23, 2009 Share Posted February 23, 2009 Hi, Stilgar, there is a error in FF.au3 when FF start slower. Link to comment Share on other sites More sharing options...
Recommended Posts