Jump to content
UBot Underground

[library] Strings


Guest Jim

Recommended Posts

iglow, I will try and knock something up for you tonight. Got some bots I need to get finished as they have been dragging for 2 weeks now and I keep getting distracted by tangents (like captchas).

 

If I don't post anything, please send me a PM reminding me as I tend to forget :)

Link to post
Share on other sites

Ok, have attached a bot that contains a sub that returns true or false (1 or 0) if a string (the haystack) contains another string (needle).

 

Have included the run sub call and an alert to display what the sub returns true or false.

 

Should be straight forward to modify it to work it into your bot, if you're having trouble though, just gimme a shout.

contains_bot.ubot

  • Like 1
Link to post
Share on other sites
  • 3 weeks later...

hey some_guy, got a question for you... I need exactly what your bot does for a bot I'm working on, but for reasons I can't figure out it works great in your bot, but not in mine. Same exact code only change being that I'm substituting a page scrape as #haystack and of course a different #needle.

 

I wanted to use the library originally in this thread but I couldn't get that to work either.

 

I have no idea why it works perfectly in your file, but once I paste it into mine it won't work at all. I just get "error" returned every time instead of 0 or 1.

 

Any ideas what I should be looking for?

 

Thanks!

 

Jonathan

Link to post
Share on other sites

OK WTF?!?!??! This is nuts.

 

I've now deleted EVERYTHING from my bot, and pasted in ONLY what you created in your contains_bot, modified with my small changes. This is exactly what works perfectly in your file, and it still will not work in mine.

 

The two are (visually) IDENTICAL! Every node is exactly the same. How could it work in one and not the other??

 

Can you say frustrated?!?! :angry:

 

Jonathan

Link to post
Share on other sites

Holy crap I solved it. This is a UBot bug for sure.

 

When copying nodes from one bot to another, if the first script calls subs in "this one", those get messed up when they paste into the other bot, even though they still say "this one" they appear to have some link back to the previous bot, and so error out.

 

By recreating the identical run sub with the identical parameters IN the second bot, it works fine.

 

Seth?

 

Jonathan

Link to post
Share on other sites

Holy crap I solved it. This is a UBot bug for sure.

 

When copying nodes from one bot to another, if the first script calls subs in "this one", those get messed up when they paste into the other bot, even though they still say "this one" they appear to have some link back to the previous bot, and so error out.

 

By recreating the identical run sub with the identical parameters IN the second bot, it works fine.

 

Seth?

 

Jonathan

 

Hi, sorry for not replying have been out of action last couple of weeks. I've had issue with copying nodes, especially subs and if changing the text in the name. As Alc hitting refresh should help, I also used to do something else which would mean it always worked, but can't remember what as am abit ubot rusty. If I remember I shall post it here :)

Link to post
Share on other sites
  • 1 month later...
  • 3 months later...

That is a very useful add-on to the already powerful Ubot Studio.

 

I am quite a curious creature and like experimenting a lot, I am curious to know if it is possible to use any other languages, maybe say VB, or C#, as UBot Studio is based on the .Net Framework.

 

If not, is there a way to use these languages along with UBot Studio, that will be an awesome thing to do and will make UBot, in my opinion 1 of the most powerful dev. tool out there.

 

I really wanna use few .net functions along side wiu Ubot.

 

Cheers!

 

Praney :)

Link to post
Share on other sites
  • 4 weeks later...

Hi.

 

Would be great if there would be a function to extract the first paragraph from an article.

 

Example:

 

I have a text file with an article (500 words, 5 paragraphs)

I use that to fill a text box.

 

But there is another text box I have to fill. Called "Article Summary". Normally that's the first paragraph of the original article.

 

Currently I struggle to extract that from my original article.

 

Would be really great if the strings function could help here?

 

Thanks in advance

Dan

Link to post
Share on other sites
  • 1 month later...

WARNING :

 

At the time of this writing two functions don't work, and can't work.

 

The following functions : substring and substring alt will not work as they are not returning the "eval" of the javascript <_< , so they simply return what has been concatenated within ubot and not the result of the javascript expression. :o

 

Example :

 

NOT GOOD : :angry:

post-1257-12856069604397_thumb.png

 

GOOD : :rolleyes:

post-1257-12856069878327_thumb.png

 

I also changed the " into ' but I don't know if it makes any difference... not a javascript expert, just trying to make this thing work

 

I don't know how to do it but if someone could correct the original ubot file posted by the OP it could help some people like me from getting "koukou" :blink:

Link to post
Share on other sites

I was considering how best to remove certain lines from a list (like those with more than 3 "/") and came across this library post.

so if I wanted to keep: http://www.drakesomething.com/

but remove http://www.insiderpages.com/s/TX/Dallas/Jewelers?radius=0 (it has more than 3 "/")

would I need the library, would it be helpful, is way without the library?

 

Steve

Link to post
Share on other sites
  • 2 months later...

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...