Php script and mess with queue

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
wootshuska
Posts: 23
Joined: Mon Mar 07, 2016 12:04 am

Php script and mess with queue

Post by wootshuska » Wed Apr 27, 2016 5:37 pm

Hi!
What i want to do with my macro, is to login to my website, fill the data, click the button, go to another site and play the sound. Clicking the button is running php script which lasts for about 10 minutes. Normally timeout is set to 60 seconds, so i extended that to 9999999 using !timeout, !timeout_page, !timeout_step. None of which worked properly (even three at once).

Js:

Code: Select all

iimPlay("test.iim")

var sound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound);
sound.beep();
iimPlayCode("wait seconds = 1.5");
sound.beep();
iimPlayCode("wait seconds = 1.5");
sound.beep();
Iim:

Code: Select all

SET !TIMEOUT_PAGE 999999999
SET !TIMEOUT 999999999999
SET !TIMEOUT_STEP 99999999
CLEAR
ONLOGIN USER=**** PASSWORD=****
URL GOTO=http://MySite

URL GOTO=http://MySite/load.php
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:load.php ATTR=NAME:file CONTENT=C:\file.txt
SET !TIMEOUT_PAGE 999999999
SET !TIMEOUT 999999999999
SET !TIMEOUT_STEP 99999999
TAG POS=1 TYPE=BUTTON FORM=ACTION:load.php ATTR=TXT:load
SET !TIMEOUT_PAGE 999999999
SET !TIMEOUT 999999999999
SET !TIMEOUT_STEP 99999999
url goto=MySite/2/
Yes, i know. Too many timeouts. But i wanted to be sure, that my code is at least timeouted.
The problem is, that sometimes code is working properly, and play the sound when .iim macro is done. Sometimes it plays the sound when .iim macro is done in a half. And sometimes it plays the sound 10 seconds after launching the .js code. There is no rule. Sometimes it is working like a charm, and sometimes not.

I know that i could check the source code and waiting for text related with second page appers, but im wondering is there any solution to avoid that. I mean that should work. I dont know why it doesnt. I know that because im launching the php script, but still.. damn that should work.

And ideas?


-------------------------------
Firefox 44.0.2
iMacros for Firefox 8.9.6
VERSION BUILD=8961227 RECORDER=FX
chivracq
Posts: 9300
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Php script and mess with queue

Post by chivracq » Wed Apr 27, 2016 11:58 pm

wootshuska wrote:Hi!
What i want to do with my macro, is to login to my website, fill the data, click the button, go to another site and play the sound. Clicking the button is running php script which lasts for about 10 minutes. Normally timeout is set to 60 seconds, so i extended that to 9999999 using !timeout, !timeout_page, !timeout_step. None of which worked properly (even three at once).

Js:

Code: Select all

iimPlay("test.iim")

var sound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound);
sound.beep();
iimPlayCode("wait seconds = 1.5");
sound.beep();
iimPlayCode("wait seconds = 1.5");
sound.beep();
Iim:

Code: Select all

SET !TIMEOUT_PAGE 999999999
SET !TIMEOUT 999999999999
SET !TIMEOUT_STEP 99999999
CLEAR
ONLOGIN USER=**** PASSWORD=****
URL GOTO=http://MySite

URL GOTO=http://MySite/load.php
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:load.php ATTR=NAME:file CONTENT=C:\file.txt
SET !TIMEOUT_PAGE 999999999
SET !TIMEOUT 999999999999
SET !TIMEOUT_STEP 99999999
TAG POS=1 TYPE=BUTTON FORM=ACTION:load.php ATTR=TXT:load
SET !TIMEOUT_PAGE 999999999
SET !TIMEOUT 999999999999
SET !TIMEOUT_STEP 99999999
url goto=MySite/2/
Yes, i know. Too many timeouts. But i wanted to be sure, that my code is at least timeouted.
The problem is, that sometimes code is working properly, and play the sound when .iim macro is done. Sometimes it plays the sound when .iim macro is done in a half. And sometimes it plays the sound 10 seconds after launching the .js code. There is no rule. Sometimes it is working like a charm, and sometimes not.

I know that i could check the source code and waiting for text related with second page appers, but im wondering is there any solution to avoid that. I mean that should work. I dont know why it doesnt. I know that because im launching the php script, but still.. damn that should work.

And ideas?

-------------------------------
Firefox 44.0.2
iMacros for Firefox 8.9.6
VERSION BUILD=8961227 RECORDER=FX
Hum, interesting Syntax you are using for the Sound, can be useful for a Conditional Sound, even if it doesn't seem to work for me, I don't get any Beep/Sound at all in those 2 Environments: iMacros for FF v8.8.2, Pale Moon v26.1.1 (=FF44), Win10-x64, and iMacros for FF v8.9.6, FF45, Win10-x64.

But OK, I had a look at your Pb and it looks to me like the Pb comes from the Site, the TAG Objects are found I guess in your Macro, and the '!TIMEOUT_xxx' Settings do work perfectly, well I could only really test '!TIMEOUT_STEP' because I can't force a '!TIMEOUT_PAGE' (it's the same Command like '!TIMEOUT' btw which was deprecated and replaced, so it's useless to include them both, like it's indeed useless to repeat those Statements several times...) longer than about 20 sec, even on my slow Connection...

The 'test.iim' Macro I used is this one, as I couldn't really use the one you posted...:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
'SET !ERRORIGNORE YES

PROMPT TIMEOUT_PAGE:<SP>_{{!TIMEOUT_PAGE}}_<BR>TIMEOUT:<SP>_{{!TIMEOUT}}_<BR>TIMEOUT_STEP:<SP>_{{!TIMEOUT_STEP}}_

SET !TIMEOUT_PAGE 999999999
SET !TIMEOUT 999999999999
SET !TIMEOUT_STEP 99999999

PROMPT TIMEOUT_PAGE:<SP>_{{!TIMEOUT_PAGE}}_<BR>TIMEOUT:<SP>_{{!TIMEOUT}}_<BR>TIMEOUT_STEP:<SP>_{{!TIMEOUT_STEP}}_

'=> Displayed:
'TIMEOUT_PAGE: _999999999999_
'TIMEOUT:      _999999999999_
'TIMEOUT_STEP: _99999999_

TAB OPEN
TAB T=2
URL GOTO=http://www.iopus.com
TAG POS=1 TYPE=BUTTON FORM=ACTION:load.php ATTR=TXT:load
(Tested on iMacros for FF v8.8.2, Pale Moon v26.1.1 (=FF44), Win10-x64, and iMacros for FF v8.9.6, FF45, Win10-x64.)

You can try playing with 'REPLAYSPEED' and adding some mini-WAIT Statement before and after clicking on the ''load' Button... and applying the Suggestions that you mentioned yourself, I don't see why you would want to avoid them...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Trax
Posts: 43
Joined: Thu Sep 13, 2012 4:07 pm
Contact:

Re: Php script and mess with queue

Post by Trax » Sat May 07, 2016 4:25 pm

I had some similar issues when calling a .iim script from .js script. The iim would not completely finish before javascript would move to the next step. My solution was adding a wait after the calling the .iim script, a long wait. It seems the length of wait would not matter as long as it was longer then it took the iim. script to finish. As soon as the the .iim script finished the .js script would just go to the next step ignoring the wait time left, bug or feature ? :twisted:

Code: Select all

iimPlay("test.iim")
iimPlayCode("wait seconds = 9999999999");

var sound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound);
sound.beep();
iimPlayCode("wait seconds = 1.5");
sound.beep();
iimPlayCode("wait seconds = 1.5");
sound.beep();
Might not work properly if 'Show javascript during reply' is checked.
chivracq
Posts: 9300
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Php script and mess with queue

Post by chivracq » Sat May 07, 2016 8:21 pm

Trax wrote:I had some similar issues when calling a .iim script from .js script. The iim would not completely finish before javascript would move to the next step. My solution was adding a wait after the calling the .iim script, a long wait. It seems the length of wait would not matter as long as it was longer then it took the iim. script to finish. As soon as the the .iim script finished the .js script would just go to the next step ignoring the wait time left, bug or feature ? :twisted:

Code: Select all

iimPlay("test.iim")
iimPlayCode("wait seconds = 9999999999");

var sound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound);
sound.beep();
iimPlayCode("wait seconds = 1.5");
sound.beep();
iimPlayCode("wait seconds = 1.5");
sound.beep();
Might not work properly if 'Show javascript during reply' is checked.
Hi @Trax, I don't use '.js' Scripts at all so I never had a chance to test/confirm what I am going to say, but I thought I understood from some "older" Threads, from at least 5-6-7 years ago, then the Behaviour you mention was a "common" Pb with iMacros at that time, guess it got a bit better later as I haven't seen Threads in that "Trend" anymore for years..., and the "Solution" was to force 'iimPlay()' to complete by asking for a Return Code, even if you don't do anything with it:

Code: Select all

iret=iimPlay("test.iim")
(Never tested, ah-ah...!)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply