Jump to content



Photo

FF.au3 (V0.6.0.1b-10)


  • This topic is locked This topic is locked
678 replies to this topic

#661 TomSirler

TomSirler

    Seeker

  • Normal Members
  • 4 posts

Posted 09 January 2015 - 02:51 PM

Thx for your Help.

You solved my problem.

Trying to show a short version of my code I recognized, that I had formerly commented out a code-line (no idea why o:) )

It was a kind of "First Try"-Line, so the script worked nevertheless properly.

Now I'v corrected it

AutoIt         
#include <FF.au3> OeffneSite() Main() EXIT Func OeffneSite() ;   OeffneSite2()           ; <<<======= accidentally commented out !!!     if _FFSearch("Die Verbindung zum Server wurde getrennt.") then         _FFQuit()         ;... some prepearing code         OeffneSite2()     endif EndFunc Func OeffneSite2()   _FFStart() ; Vorabstart damit PROG Zeit hat MozRepl zu erkennen.   _FFOpenURL("http://www.autoitscript.com")   ;... some code EndFunc Func main()   ;... lot of code EndFunc

I just got stuck at the problem due to the Code error in line 2325, (see post #653)









#662 Danp2

Danp2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,133 posts

Posted 09 January 2015 - 03:30 PM

You need to establish a connect to Firefox / Mozrepl before you can utilize the other _FF* functions. Try adding a call to _FFConnect at the beginning of your script, or you could use something like this:

Func _FFCheckConnection() Local $result = True     If Not _FFIsConnected() Then         If Not _FFConnect(Default, Default, 3000) Then             $result = False         EndIf     EndIf     Return $result EndFunc


#663 fxprodigy

fxprodigy

    Seeker

  • Normal Members
  • 7 posts

Posted 12 February 2015 - 02:02 AM

Hi

 

first of thanks for the UDF it is exactly what I need except i can not get it working.

 

I keep on getting this error in debug window.

I tried the example from the help file as below

  1.  
  1. #Include <FF.au3>
  2.  
  3. _FFStart("http://ff-au3-example.thorsten-willert.de/")
  4.  
  5. If _FFIsConnected() Then
  6.     Sleep(2000)
  7.     _FFAction("presentationmode", True)
  8.     Sleep(2000)
  9.     _FFOpenURL("http://www.google.com")
  10.     Sleep(2000)
  11.     _FFAction("back")
  12.     _FFAction("presentationmode", False)
  13.     Sleep(2000)
  14.     _FFOpenURL("chrome:bookmarks")
  15.     Sleep(2000)
  16.     _FFAction("alert", "Bye bye ...")
  17.     _FFQuit()
 
 
 

 

+>12:58:22 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0   Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0409)

+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\kjahanta\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\kjahanta\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.12.0)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\kjahanta\Desktop\Bot\!\mql5.au3
! Au3check doesn't support input files encoded as UTF8 with BOM: C:\Program Files (x86)\AutoIt3\Include\FF.au3
"C:\Users\kjahanta\Desktop\Bot\!\mql5.au3"(3,54) : error: _FFStart(): undefined function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\kjahanta\Desktop\Bot\!\mql5.au3"(5,19) : error: _FFIsConnected(): undefined function.
If _FFIsConnected()
~~~~~~~~~~~~~~~~~~^
"C:\Users\kjahanta\Desktop\Bot\!\mql5.au3"(7,36) : error: _FFAction(): undefined function.
_FFAction("presentationmode", True)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\kjahanta\Desktop\Bot\!\mql5.au3"(9,36) : error: _FFOpenURL(): undefined function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\kjahanta\Desktop\Bot\!\mql5.au3"(17,10) : error: _FFQuit(): undefined function.
_FFQuit()
~~~~~~~~^
C:\Users\kjahanta\Desktop\Bot\!\mql5.au3 - 6 error(s), 0 warning(s)
!>12:58:22 AU3Check ended. Press F4 to jump to next error.rc:2
+>12:58:22 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 0.5737

 

 

 

Any one had this problem? or know what I am doing wrong? Any help would be much appreciated


Edited by fxprodigy, 12 February 2015 - 02:32 AM.


#664 kylomas

kylomas

    BOHICA

  • MVPs
  • 3,618 posts

Posted 12 February 2015 - 07:15 AM

fxprodigy,

 

See this thread...


Forum Rules         Procedure for posting code


#665 fxprodigy

fxprodigy

    Seeker

  • Normal Members
  • 7 posts

Posted 12 February 2015 - 02:51 PM

fxprodigy,

 

See this thread...

Je

 

much appreciate your answer. I am a newbie in AutoIt and still learning so bear with me plz. I read the thread u mentioned and below is what I found the most relevant. Here is my problem, that did not answer my question or more likely, I did not understand what to do exactly to get this right and working.

 

ould u plz shed some light on this one. Any help would be greatly appreciated

Ksm

 

 

listee, on 08 Aug 2014 - 6:17 PM, said:snapback.png

If the primary file encoding is UTF8withBOM, #include UDF file encoding is UTF8 without BOM, everything is OK.

 
The file SHOULD BE encoded as UTF8 with BOM to continue processing by AutoIt3Wrapper.   BUT
 Au3check doesn't support input files encoded as UTF8 with BOM

 

 

This is correct. AU3CHECK does NOT support any UTF encoded files. AutoIt3Wrapper has a workaround for this limitation of au3check, but only for the main script, by copying it to a temp file before processing, But again: this is only for the Main script.

 

It is what it is until somebody puts the effort in to fix au3check.

Jos



#666 Danp2

Danp2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,133 posts

Posted 13 February 2015 - 01:06 AM

Open the file ff.au3 in scite and then save it in a different encoding format. I'm not in front of a computer but I believe it's an option under the file menu.



#667 fxprodigy

fxprodigy

    Seeker

  • Normal Members
  • 7 posts

Posted 13 February 2015 - 01:19 AM



Open the file ff.au3 in scite and then save it in a different encoding format. I'm not in front of a computer but I believe it's an option under the file menu.

 

Hi

 

did that, doesn't work. It keeps giving me error message.

 

2zegsw2.jpg

 


 

! Au3check doesn't support input files encoded as UTF8 with BOM: C:\Users\kjahanta\Desktop\Bot\FF.au3

"C:\Users\kjahanta\Desktop\Bot\!\mql5.au3"(3,54) : error: _FFStart(): undefined function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\kjahanta\Desktop\Bot\!\mql5.au3"(5,19) : error: _FFIsConnected(): undefined function.
If _FFIsConnected()
~~~~~~~~~~~~~~~~~~^
"C:\Users\kjahanta\Desktop\Bot\!\mql5.au3"(7,36) : error: _FFAction(): undefined function.
_FFAction("presentationmode", True)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\kjahanta\Desktop\Bot\!\mql5.au3"(9,36) : error: _FFOpenURL(): undefined function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\kjahanta\Desktop\Bot\!\mql5.au3"(17,10) : error: _FFQuit(): undefined function.
_FFQuit()
~~~~~~~~^
C:\Users\kjahanta\Desktop\Bot\!\mql5.au3 - 6 error(s), 0 warning(s)
!>12:11:54 AU3Check ended. Press F4 to jump to next error.rc:2
+>12:11:54 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 0.5017
 


#668 Danp2

Danp2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,133 posts

Posted 13 February 2015 - 03:55 AM

Then you aren't doing it correctly.  :sorcerer:



#669 fxprodigy

fxprodigy

    Seeker

  • Normal Members
  • 7 posts

Posted 13 February 2015 - 04:49 AM

Then you aren't doing it correctly.  :sorcerer:

huum I don't believe so As i had this problem with some other codes of main and solved it in a way you described. I will try that on another PC just to make sure I am not doing it wrong. will put the outcome here once i did it. I hope  I am doing something wrong and what you say works

 

cheers



#670 fxprodigy

fxprodigy

    Seeker

  • Normal Members
  • 7 posts

Posted 13 February 2015 - 07:30 AM

Then you aren't doing it correctly.  :sorcerer:

U were right after all. I am not sure what I was doing wrong but I managed to overcome the first issue now I am having trouble with this new one.

 

When I am trying to run below piece of code (example from FF help file) I get this error regarding registery. Any idea how to troubleshoot this one.

 

Thanks for your help

  1. #Include <FF.au3>
  2.  
  3. _FFStart("http://ff-au3-example.thorsten-willert.de/")
  4.  
  5. If _FFIsConnected() Then
  6.     Sleep(2000)
  7.     _FFAction("presentationmode", True)
  8.     Sleep(2000)
  9.     _FFOpenURL("http://www.google.com")
  10.     Sleep(2000)
  11.     _FFAction("back")
  12.     _FFAction("presentationmode", False)
  13.     Sleep(2000)
  14.     _FFOpenURL("chrome:bookmarks")
  15.     Sleep(2000)
  16.     _FFAction("alert", "Bye bye ...")
  17.     _FFQuit()

 

 

__FFStartProcess ==> General Error: Error reading registry entry for FireFox.

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\*CurrentVersion*\Main\PathToExe
Error from RegRead: 1
_FFIsConnected ==> Socket Error: -1
+>18:28:08 AutoIt3.exe ended.rc:0
+>18:28:08 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 0.942
 


#671 fxprodigy

fxprodigy

    Seeker

  • Normal Members
  • 7 posts

Posted 13 February 2015 - 07:55 AM

On second attempt also I tried to run below code

  1. #Include <FF.au3>
  2.  
  3. ; trying to connect to a running FireFox with MozRepl on
  4. If _FFConnect(Default, Default, 3000) Then
  5.     ; open a page
  6.     _FFOpenURL("http://ff-au3-example.thorsten-willert.de/")
  7.     Sleep(3000)
  8.     ; disconnect from FireFox
  9.     If _FFDisConnect() Then MsgBox(64, "", "Disconnected from FireFox!")
  10.     MsgBox(64, "", "Can't connect to FireFox!")
  11.  

when I get this error

 

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop

_FFConnect: OS: WIN_8 WIN32_NT 9200 
_FFConnect: AutoIt: 3.3.12.0
_FFConnect: FF.au3: 0.6.0.1b-10
_FFConnect: IP: 127.0.0.1
_FFConnect: Port: 4242
_FFConnect: Delay: 2ms
_FFConnect ==> Timeout: TCPConnect Error: 10061
_FFConnect ==> General Error: Timeout: Can not connect to FireFox/MozRepl on: 127.0.0.1:4242
+>18:54:07 AutoIt3.exe ended.rc:0
+>18:54:07 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 6.009

 

 

any thoughts?!



#672 Danp2

Danp2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,133 posts

Posted 13 February 2015 - 01:22 PM

Do you have mozrrpl installed / started? Also, there is an updated version of the UDF posted in this thread. Be sure to get it because it has several key bug fixes.



#673 AutoRun

AutoRun

    Seeker

  • Active Members
  • 13 posts

Posted 18 February 2015 - 03:12 PM

I have got the same trouble. I even had trying to check MozRepl through a telnet, but it says
 

Could not open connection to host, on port 4242…

 

In addons menu of FF 35.0.1 it seems like MozRepl was not installed properly.

moz.jpg

Because it doesn't have any other options, but a "Disable" and a "Remove"

I was trying to install MozRepl from both the github and the add-ons for FF and with turned firewall off and disabled other extensions, you see.


Edited by AutoRun, 18 February 2015 - 03:13 PM.


#674 Danp2

Danp2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,133 posts

Posted 18 February 2015 - 03:57 PM

Your install looks fine. Are you sure MozRepl is started? Look at the MozRepl menu under the Tools menu (press Alt+T to access).


  • AutoRun likes this

#675 AutoRun

AutoRun

    Seeker

  • Active Members
  • 13 posts

Posted 19 February 2015 - 06:47 AM

My mistake was been that I was trying to find the start button in the Add-ons menu.

 

Danp2, a big thanks. Now it work.



#676 AutoRun

AutoRun

    Seeker

  • Active Members
  • 13 posts

Posted 20 February 2015 - 09:48 AM

Is there a bug on line 1396 from FF.au3?

  1.     Switch $sOptionMode
  2.         Case "index"
  3.             If Not IsInt($vOption) Then
  4.                 SetError(__FFError($sFuncName, $_FF_ERROR_InvalidDataType, "(int) $vOption: " & $vOption))
  5.                 Return 0
  6.             EndIf
  7.             $sOption = "position()=" & $vOption + 1
  8.         Case "text"
  9.             $sOption = StringFormat("contains(.,'%s')", $vOption)
  10.         Case "name", "id", "value"
  11.             $sOption = StringFormat("@%s='%s'", $sOptionMode, $vOption)
  12.         Case Else
  13.             SetError(__FFError($sFuncName, $_FF_ERROR_InvalidValue, "(index|text|name|id|value) $sOptionMode: " & $sOptionMode))
  14.             Return 0
  15.     EndSwitch

And the way to do it better:

  1.         Case "text"
  2.             __FFValue2JavaScript($vOption)
  3.             $sOption = StringFormat("contains(text(),'%s')", $vOption)

In that case the function __FFValue2JavaScript($vOption) gives to it more flexibility to select by an option text value with non-ASCII chars.



#677 Danp2

Danp2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,133 posts

Posted 20 February 2015 - 03:44 PM

Is there a bug on line 1396 from FF.au3?

The code as written appears to function correctly.

 

Haven't tested your modification. Can you post an example showing where your enhanced code works and the original code does not?



#678 AutoRun

AutoRun

    Seeker

  • Active Members
  • 13 posts

Posted 21 February 2015 - 11:42 AM

I made a static example for the select form, but it work correctly with both original and modified _FFFormOptionSelect function

 

A problems are appear when the code works with the admin page. Engine's DLE (Data LifeEngine).

 

I can't explain it more exactly. It's only that the modified function works under the real condition in that case and original is not.

 

Also _FFFormCheckBox going well when it a static page and not working at all when it online.



#679 Danp2

Danp2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,133 posts

Posted 22 February 2015 - 10:10 PM

New thread started here: http://www.autoitscript.com/forum/topic/167661-ffau3-v0601b-14/






11 user(s) are reading this topic

0 members, 11 guests, 0 anonymous users