Jump to content
UBot Underground

I dare you....Take the Challenge


Recommended Posts

I am baffled.

 

This bot used to work but now it does not.

 

It is a simple search using Javascript. If it finds the string then it should come back True if then then False.

 

No matter how many times I run it with whatever text it always returns True. Plus, the script terminates in a state that suggests that it is still running even those there is a Stop Script node.

 

I have tried the Javascript code with no quotes, a single quote and double quotes but no luck in either instance.

 

I have tried refreshing, saving and reloading and even rebooting my machine.

 

Any ideas? Is this a glitch within UBot or Buddy?

 

Thanks!

Not working - Search.ubot

Link to post
Share on other sites

I am baffled.

 

This bot used to work but now it does not.

 

It is a simple search using Javascript. If it finds the string then it should come back True if then then False.

 

No matter how many times I run it with whatever text it always returns True. Plus, the script terminates in a state that suggests that it is still running even those there is a Stop Script node.

 

I have tried the Javascript code with no quotes, a single quote and double quotes but no luck in either instance.

 

I have tried refreshing, saving and reloading and even rebooting my machine.

 

Any ideas? Is this a glitch within UBot or Buddy?

 

Thanks!

 

The return will always return something even if the string you are looking for exists or not. Also, indexOf returns the position of the string if it is found or -1 if it is not. All that said, here is a modified version that should work for you.

 

Dave

 

Working - Search.ubot

  • Like 1
Link to post
Share on other sites

Just a side note (I now it doesn't apply to this post, but definitely applies to general scripting).

 

I just started a new bot. It has no UI elements. The first part of this bot simply goes out, finds the top 30 performing products via a couple of analytics sites, scrapes the results and and saves them to a file.

 

It clears the file (and associated list) on every run so you always get the most current top 30.

 

This scripting is REALLY simple, and I scripted it in about 5 minutes. I double, triple, quadruple checked the code when I realized it didn't work.

 

So I started deleting code from the end up until it started working (up to whatever point I was at).

 

One by one I added nodes again, and nodes that were inarguably correct didn't work..so, for that node I would delete it and re-add it (exactly as it was). After about 3 attempts, mysteriously the node would work as expected. So I would move on to the next node, and the same thing happened.

 

Ultimately everything works as expected now, but the moral of this story is that I had correctly configured nodes that didn't want to work until they were deleted and re-added a couple of times.

 

If you have a similar situation, I would suggest doing just that. delete and re-add the node (assuming you KNOW it should work).

 

Now that I know that, I will not get so frustrated when it happens.

 

Since I will likely be asked, the problem was occurring with "save to file". It created the file, but had no content. I changed nothing at all, just kept trying with the same code. How do I know it was the same code? Because I never re-wrote it, I just kept deleting and pasting it back in.

 

I hope this helps someone. I am not considering this to be a bug because it may just be environment related (something on my end...and it worked itself out anyhow.

 

John

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...