Can someone help with this script? (js)

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Can someone help with this script? (js)

by Avarixzen on Tue Oct 31, 2017 5:04 pm

I've never used these forums before, sorry if this is in the wrong location or only problems are allowed to be posted!

iMacros: VERSION BUILD=9030808
Browser: FIREFOX 55.0.3 (32-Bit)
OS: Windows 10

I don't know if that info is needed, but there it is.

My code:

Code: Select all
while(true){
var macro;
macro ="CODE:";
macro +="TAG POS=1 TYPE=* ATTR=TXT:*This<SP>username<SP>is<SP>already<SP>in<SP>use.* ";

var ret=null;
ret=iimPlay(macro);
if(ret>0)
{
ret = iimPlay("Name")
}
else
{
}
}


Okay, so I barely know Java! And I'm completely lost on what is actually going on in this code, all I know is that it works. So why am I posting?

Well here is what the script currently does: Each loop it checks for "This username is already in use" and if it finds that, it runs my "Name" macro which is perfect. But I need it to have an or like this:

if "This username is already in use" OR "This username is not appropriate"

Help maybe? :oops: :shock: :roll:
Avarixzen
 
Posts: 1
Joined: Tue Oct 31, 2017 4:53 pm

Re: Can someone help with this script? (js)

by chivracq on Tue Oct 31, 2017 7:37 pm

Avarixzen wrote:I've never used these forums before, sorry if this is in the wrong location or only problems are allowed to be posted!

Code: Select all
 iMacros:    VERSION BUILD=9030808
Browser:    FIREFOX 55.0.3 (32-Bit)
        OS:     Windows 10


I don't know if that info is needed, but there it is.

My code:

Code: Select all
while(true){
var macro;
macro ="CODE:";
macro +="TAG POS=1 TYPE=* ATTR=TXT:*This<SP>username<SP>is<SP>already<SP>in<SP>use.* ";

var ret=null;
ret=iimPlay(macro);
if(ret>0)
{
ret = iimPlay("Name")
}
else
{
}
}


Okay, so I barely know Java! And I'm completely lost on what is actually going on in this code, all I know is that it works. So why am I posting?

Well here is what the script currently does: Each loop it checks for "This username is already in use" and if it finds that, it runs my "Name" macro which is perfect. But I need it to have an or like this:

if "This username is already in use" OR "This username is not appropriate"

Help maybe? :oops: :shock: :roll:

- Sub-Forum is perfect, as Threads related to using a '.js' Script belong indeed to the 'iMacros for FF' Sub-Forum... :D
- FCI mentioned: => Perfect...! :D
- But...!, grrr...!!!, the Thread Title is a bit useless (= non-Descriptive): => I don't read..., sorry... :oops: Try searching the Forum for an Answer in similar Threads with "Can someone help with this script? (js)" as Search Keywords... => Well, good luck...! :idea:
=> Give a Descriptive Title to your Thread about its real Content and your real Qt/Pb for me to read..., unless you expect a "Dunno, maybe...!?" Answer to your Qt... :idea:
(You can always edit all your (previous) Posts...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6489
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to iMacros for Firefox

Who is online

Users browsing this forum: Bing [Bot] and 11 guests

-->