Fuledbyramen wrote:As always thank you for your quick and helpful replies Chivracq!
So i searched up some of your old posts and things and a few of them helped me find the syntax so that my code will run now! but it wont do what I need it to do...
So this is the code I made so far
Code: Select all
VERSION BUILD=8961227 RECORDER=FX
TAB T=1
FILTER TYPE=IMAGES STATUS=OFF
SET !ERRORIGNORE Yes
SET !TIMEOUT_PAGE 1
URL GOTO=https://www.instagram.com/instagram/
TAG POS=1 TYPE=BUTTON ATTR=TXT:* EXTRACT=TXT
SET !VAR0 {{!EXTRACT}}
SET !EXTRACT NULL
SET !VAR3 Follow
SET !VAR4 Following
SET !VAR7 EVAL("if (\"{{VAR0}}\" == \"{{VAR3}}\") {VAR7= 30;} else null; ")
SET !VAR7 EVAL("if (\"{{VAR0}}\" == \"{{VAR4}}\") {VAR7= 0;} else null; ")
wait seconds = {{!VAR7}}
TAG POS=1 TYPE=BUTTON ATTR=TXT:Follow
wait seconds = {{!VAR7}}
So I want it to set the wait time to 30 if it says Follow and wait time to 0 if it says Following
Dont need to change the button position because it wont find anything to click and will time out in a second
The problem is that when it runs, it seems to ignore the if statement and just changes the Variable 7 to the last Eval, so if I put the first one second itll change the wait time to 30 seconds, and if I leave this as is it will always have the wait time be 0
Not sure what Im doing wrong, obviously it isnt reading the if or else statements, not sure if null even works as an else statement, any further advisement would be great! feels like its very close but it just isnt quite there.
Getting close indeed, but you are doing a few things wrong...
1- '!TIMEOUT_PAGE' set to 1, sounds indeed like a good ("Creative"!) Idea, but I find it "dangerous"...:
You have an 'URL GOTO' loading your 'Instagram' Page after it, and you only allow 1 sec for the Page to load and you go straight away after the Extract within 1/6th of a Second, so the chances are you are going to get many '#EANF#''s because the Page didn't have enough time to load... It might work sometimes if you have a very quick Connection, but your Script won't be very "reliable"...
=> It is still a good Idea, but you should better allow for a "decent" '!TIMEOUT_PAGE' for the 'URL GOTO' and set it only after to a much shorter Value. And maybe, instead of playing with '!TIMEOUT_PAGE', you should rather play with '!TIMEOUT_STEP' (=> set to 1 or 0).
2- Not sure either if setting your '!VAR7' to "null" for a 'WAIT' Statement will work...
When you are not sure... => You test...!!
And this mini Script:
will yield the following RuntimeError:
BadParameter: expected SECONDS=<number> as parameter 1, line 4 (Error code: -911)
=> It doesn't work...!
But
and
both do work...
3- You have 2 'EVAL()' Statements in a row to set the same '!VAR7' and you check 2 different things... You need to combine them together: if (Not) Found => =30, else =0.
4- Use 'PROMPT' to follow and debug the Vars that you use...:
Code: Select all
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_<BR>VAR0:<SP>_{{!VAR0}}_<BR><BR>VAR3:<SP>_{{!VAR3}}_<BR>VAR4:<SP>_{{!VAR4}}_<BR><BR>VAR7:<SP>_{{!VAR7}}_
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...