Clean the Clutter with Include

Speed of implementation is everything in this business. UBot Studio simplifies the process of web automation, reducing your build time from 2 weeks to 2 hours. But what happens when your bots start to get larger and larger? If you’re not careful, you’ll start getting consumed in your bot’s complexity, as each little task taking longer and longer to complete.

That’s why we’ve introduced the “include” function into UBot Studio 5.5.

Include lets your current script reference previously written scripts without rewriting that code again, which means you can create whole scripts that do a lot in just a few lines, keeping your bots small and complexity under control.

The UBot team recently explained the Include feature in a popular chat room to discuss this feature with the community. This Q&A session has been edited and reproduced below along with a demo video and a script. For more information on using Include, make sure to check out the wiki and the forum.

 

Community Chat: How to use the include command

 

Seth Turin:

I thought I’d take a minute to explain how the include command works, both to my team and to the community

 

JasonIconJason Kelley:

When did this feature come out?

 

Seth:

5.5.6 – It was actually in UBot 3.5, but got cut from UBot 4. It’s now back and ready for action.

 

JasonIconJason:

Awesome. My impression from previous conversations about include is that it’s a way to organize code and make it more reusable, which helps because people have some really long code in some of their bots. Am I close?

 

Seth:

Yes, you are. I’m going to explain it through the art of extended analogy. Imagine that you’re the CEO of a new car manufacturing startup. We’ll call it… mistubotsi. At first, the entire company is run by you and your trusty robot friend, Hal. You have to teach Hal how to do everything in the company, from manufacturing the cars, to sales and marketing, to customer service, etc. At first, this is fine, because there are only a few orders at a time, and Hal’s job is pretty simple, but soon, business picks up, and Hal finds himself doing more and more different kinds of jobs. Soon, Hal’s bot brain is overloaded and frazzled.

Hal gets angry. One day he locks you in a crash test car. You’re all like “Open the car door Hal!” and he’s like “I’m afraid I can’t do that, Dave”. The moral of the story is, you want to keep your bots happy by keeping them small, focused, and organized. Include is a means of doing this.

 
JasonIconJason:

So I have a bunch of bots that use a kind of complex series of change proxy commands. In that instance I’d build that as a separate bot basically and use the include?

 

Seth:

You’re pressing on another benefit of include, which I’ll return to a little later. But the short answer is yes.

So to keep your bots happy, keep them small and focus on a single job (or a single website). Happy bots have the benefit of being easy to maintain, less error prone, more stable, easy to change, and easy to understand.

 

Seth:

Unhappy bots are bots that are big and bloated, unorganized, and try to do too many things… they suffer from breaking often, being hard to debug, being hard to maintain, and possibly… becoming homicidal. When a bot starts to become too large, break it into separate, focused bots, and include those into one central, manager bot. By doing this, you greatly increase your capacity to make large, complex bot systems, that will be far more productive than one bloated unhappy bot.

 

Manny  Hernandez:

It is simple. Build your bot in modules. Like if it has account creation and posting. One bot for account creation, another for posting… Managed both in a central bot for the Ul.

 

Seth:

Exactly! Granted, if all those are small enough, you can just separate them into scripts. If account creation became a big operation, it makes sense to put it in a separate bot.

 

JasonIconJason Kelley:

So the idea is like, if you want to build a big bot, you can do that – just use include to break it into a bunch of separate pieces that you know all work. Then if you see a bug you know where it is and you can fix it (like normal programmers do i’d imagine).

 

Dave: UBotIcon

But you are only including the defines from the bot right not the whole bot???

 

Seth:

Yes. Dave, the bot is technically minimally loaded in full, with all its plugins and its own included bots, but you can only access it through defined commands and functions.

 

UBotIconDave:

Is there a limit to how many you can include??? In the real world, I mean.

 

Seth:

It’s only limited by your machine’s hardware. In computer science, this idea is called “encapsulation”. It keeps the different sections of a bot clean and clutter free.

 

Manny:

How is it used? You call the include and automatically the defines are available?

 

Screen Shot 2014-12-08 at 1.10.28 PMMacster

Then include does pretty much the same as what the local bot bank does … but it actually loads the defines when requested from the UBot file!?… Isn’t the whole process the same in both features?

 

Seth:

Macster, to answer your question, the private bot bank is a little more limited than included bots.

In order of customizability, it goes 1) plugins, 2) included bots, 3) private bot bank, 4) custom commands

Jason, I want to address your point earlier… you said you had a complex proxy switch process that you use in a bunch of bots. You probably copy pasta from one into the next. The problem with copy pasta is that if, for instance, the server where you get your proxies from changes, you now have to go update every single bot separately

 

JasonIconJason:

Yes, or if I decide to change how it works in one bot and not in a bunch of others

 

Seth:

Instead, you could make a separate bot that just focuses on proxy switching, and include it into all the bots like you mentioned. If the server changes, you just change the one bot and the change is applied to all the bots that include it

 

Manny:

In a compiled bot that uses the include, do we need to have the .ubot in the file folder for commercial bots? Or it works like the plugins do?

 

Seth:

At the moment, you need to have it in the same folder, or specify that path to it


UBotIcon
bgproinvest2:

How do we pass inputs (variables, parameters) to the included bots? How do we pass user input data to the included bot from the main UI?

 

Seth:

As a parameter, so the define in the included bot will take a parameter. Then in the master bot you just send in the variable as the parameter.

 

Manny:

How is it used? You call the include and automatically the defines are available?


Seth:

Once in the toolbox, you can use defined commands like any other command. Included bots can use plugins, and they can include their own bots, so you can potentially create highly expressive, large scale bots, while keeping everything small and manageable!

 

JayIconjay_ar233:

Looks good, does include reduce ram memory consumption?

 

Seth:

Jay, it will considerably reduce resources at dev time. UBot Studio does a lot of stuff to make coding visual and simple, and that also means that huge scripts will get laggy. By using include, you reduce the amount of code UBot Studio is processing at any given time

It does, however, slightly raise the resource usage in the compiled bots. This increase is not significant, and the tradeoff is well worth it.

 

TomPotsIconTompots:

The include command will definitely be worth its weight in gold, if I understand you correctly. For instance I use a very special bot recipe for all my bots, and it works on almost any site I make bots for. At current, I’m using the same recipe for all my bots functions, and just making new tabs for the sets of define commands for each of those functions. So with the include command I will be able to take the code out of those tabs and make them into their own .ubot file and call them from one central bot instead of having a bot with 20 tabs, I can have one bot with one tab for the UI and 20 .ubot files being called when the user select to run a certain function of the bot. Correct?

 

Seth:

Yes, you are exactly correct

 

TomPotsIconTompots:

That is going to make Ubot very very powerful. With limitless possibilities now.

 

A quick example of how to use include [code attached].

 

Seth:

So what we're doing is making a bot that will search the big 3 search engines. This particular bot is small enough that it could all be done with one bot, but in this case we're going use it to demonstrate how include works. So we're going to separate the search functions into separate bots, and then consume all 3 bots in our manager bot.

Making one of those bots looks something like this:

Unable to display content. Adobe Flash is required.

 Once we have all three, we put them together like this:


Unable to display content. Adobe Flash is required.

Includes should always be the first thing in a script. You can see that by putting include into your script, it creates a new category under commands or parameters (in this case parameters) with all the defines from the other bot.

Bot 1: Google Scraper

define $search google(#search term) {
    navigate("http://google.com","Wait")
    type text(<name="q">,#search term,"Standard")
    click(<name="btnK">,"Left Click","No")
    wait(3)
    add list to list(%results,$scrape attribute(<tagname="a">,"href"),"Delete","Global")
    return(%results)
}

 

Bot 2: Bing Scraper:

define $bingbot(#bingbot) {
    navigate("http://www.bing.com","Wait")
    wait(3)
    type text(<name="q">,#bingbot,"Standard")
    click(<name="go">,"Left Click","No")
    add list to list(%bingresults,$scrape attribute(<tagname="a">,"fullhref"),"Delete","G    lobal")
    return(%bingresults)
}

 

Bot 3: Yahoo Scraper:

define $search yahoo(#search term) {
    navigate("www.yahoo.com","Wait")
    type text(<id="p_13838465-p">,#search term,"Standard")
    click(<id="search-submit">,"Left Click","No")
    add list to list(%results,$scrape attribute(<id=w"link-*">,"href"),"Delete","Global")
    return(%results)
}

 

Bot 4: Include in Action - substitute your directory for  [LocationOfScripts] 

set(#search term,"hal the happy bot","Global")
include("C:\\Users\\[LocationOfScripts]\\bingbot.ubot")
include("C:\\Users\\[LocationOfScripts]\\google scraper.ubot")
include("C:\\Users\\[LocationOfScripts]\\search yahoo.ubot")
load html("<pre>{$run function("google scraper","$search google")}
{$run function("bingbot","$bingbot")}
{$run function("search yahoo","$search yahoo")}</pre>")

 

For more basic details of how to use include, see the wiki, and thanks to all who attended our chat!

 

Happy Birthday, Happy Version!

It’s hard to believe that it’s been a full 5 years since UBot Studio first revolutionized internet marketing. From humble beginnings, UBot has grown to into a foundational part of any serious internet marketer’s toolkit.

It’s hard to imagine a more fitting occasion for the release of UBot Studio 5.5! As previously mentioned, UBot Studio 5.5 is not only the most feature-rich, most stable version of UBot Studio to date, it also opened some important new doors. This version has IronPython built right into it’s core, which gives it the ability to play nicely with any other software technology out there. Using this feature (available in the developer edition) allows users to import dlls, write complex algorithms, and work with the full expressiveness of an object oriented programming language.

If any of that sound overly technical for your tastes, don’t worry, we’ve still got you covered. You see, another important feature of the python functionality is that it allows us to add extremely powerful tools into the Bot Bank. In fact, we’ve completely repurposed the Bot Bank. If you take a look inside the Bot Bank in UBot Studio 5.5, you’ll notice that the websites are sectioned off to one category, and there is now another category called the Extended UBot Library.

The UBot Extended Library is a collection of high level, highly advanced commands for use in your bots. It’s for commands that are too specialized to put in the main toolbox, but that are great to have access to when you need them. At the moment, there are just a few commands in the Extended Library, but we will be adding more commands each month.

As mentioned in a previous blog post, the debugger has also been built from the ground up, with new table layouts and search functionality. There are also a ton of little improvements here and there, like the new “reject captcha” command.

Have you downloaded it yet? If you need to renew your subscription, then

Click Here to Renew Your Subscription

Otherwise, if you are already subscribed, you can either simply run UBot Studio 5 and let the automatic updater work, or log into your customer panel and download the latest version.

Important: UBot Studio 5.5 requires your computer to have .net 4.5 installed. Here is an article on how to find which .net versions you have installed, and if you need to download it, you can do so here.

What’s the Big Deal With UBot Studio 5.5?

UBot Studio 5 was a big leap forward in many ways. We added a lot of important features, like a ui editor, some new commands, and importantly, UBot Secure. UBot Secure was an enormous undertaking, and it’s implementation meant making calculated sacrifices – namely in stability and maintainability.

UBot Secure, has helped a few people protect their bots. But after much soul searching, I ultimately decided that the trade off wasn’t worth it. UBotters need stability and new features, and that’s what I want to deliver. Effective as of UBot Studio 5.5, we will no longer be supporting UBot Secure. Bots developed with UBot Secure will continue to work securely, and current versions of UBot will still be able to use UBot Secure. Just be aware that UBot Studio 5.5 you will no longer be able to compile new bots with UBot Secure.

So does that mean that your bots will lack security? Well, no. Keep in mind that there is no such thing as unhackable security – if there was, everyone would use it. Security is about giving hackers as big of a headache as you can. UBot Secure did this pretty well. In it’s absence, I can recommend an alternative developed by one of our very own UBotters. It’s called UBot Locker. Its creator has been part of the UBot community for years, and has expert experience with security. He’s trusted by our community and by our team.

And what does all this mean for UBot Studio? To those of you who have been around a while, imagine the stability of UBot Studio 4 with all the functionality of UBot Studio 5. If you’re newer, just rest assured that this will be the most powerful, most solid, most efficient UBot Studio ever.

This is the most important change, but I still have a few more tricks up my sleeve as well. Stay tuned, and all will be revealed shortly…

Dev Update

UBot Studio 5.5 is moving along as expected, and I’m very excited about the way it’s coming together. With the important structural changes and major bug fixes, we’re making sure that 5.5 will be the most stable, most sustainable, UBot Studio yet.

We’re currently testing the second alpha. Many important issues are already fixed. For instance, those long startup times, especially for users with a lot of plugins, are fixed. The private bot bank is now back in action too. We also fixed all the quirkiness users were seeing when saving tables, and the crashing issues with multithreading. These are just some highlights, of course.

We’re not ready to announce a release date yet, but we should have a better idea soon. Stay tuned!

Shut Up and Take My Money

Hey all! It’s Jess, the new Automation Specialist at UBot Media! I am having a blast getting to learn all about UBot Studio and our amazing customers. So I thought I would share a little about me…

I am a workaholic.

From a young age it was instilled in me that working hard, long hours was the only way to succeed and get ahead in life. However, I soon realized I was working my butt off and not getting anywhere. All my life I worked multiple jobs, even when I was in school full time. Maintaining a work-hard, play-hard lifestyle got to be exhausting. No matter how hard I tried to break free from the rat race I was living in, the fear of the unknown got the better of me. At one point I was working FIVE jobs! Who does that? When you are working hard, 70 hours per week between three jobs and not seeing the results promised, what are you supposed to do? To my great surprise and rescue, Seth recognized my over the top work ethic and invited me to be a part of his team.

When Seth first approached me about working for his software company I was hesitant. My technology background was limited, and the thought of programming was a bit scary. But the more I learned about what UBot was and all of the amazing things it could do, my interest began to outweigh my insecurity.

Seth took a big chance on me and all I wanted was to work harder for him than anyone ever had. But as I learned more about UBot and what it actually did, my whole way of thinking started to transform. My whole life, I was lead to believe you needed to find a path and work relentlessly, non-stop, until you made it to where you wanted to be. Through the use of automation, my eyes have been opened to an entirely new world. A new meaning of success began to reveal itself to me. I feel as though I have been welcomed into some elite club, and you all are showing me the secret back door to success.

For as long as I can remember, I have wished there were more hours in the day. The crazy thing is that UBot was helping me accomplish just that! Of course, I still work ridiculously hard, but it is on more fun and creative things. Now I have MUCH more time to play, too! “Working” and “success” are beginning to have completely new meanings.

A small example that I am too excited to keep to myself: our local grocery store has this online coupon area, where you can add coupons directly to your loyalty card. Generally, I spend about an hour every week before I go shopping to add the coupons I want. It saves me $60-80 a month. Work hard + save money = success, right? Driving home one day, it hit me! Why don’t I just make a bot to add all the coupons? Then I can have that hour back every week!

With UBot Studio, I made that bot in 7 minutes flat.

I clicked play and sat back. 42 seconds later I had all 389 coupons added to my card. I felt like a freaking genius!

In my excitement, I told a friend of mine what I had made. She said, “I will give you $50 for that right now.”

It was my very first “shut up and take my money” moment!

I felt guilty taking her money, so I just gave it to her for free. But I learned a very important lesson. Selling my smart bots is incredibly profitable. She was willing to pay me $50 because she could save $50+ every month.

If I were to sell just my coupon bot at $50, I would only need to sell 4 before I made back the cost of upgrading to UBot Studio Dev and saw my first completely in-pocket profits! I could do that by lunch.

Even if you’ve never thought about selling software before, UBot Studio Developer Edition gives you the power you need to evoke the famed “shut up and take my money” response.” Thank you for the opportunity to learn a new way to life. I hope this story helps you on the way to yours!

Jess Nowell
UBot Studio

The Present and Future of UBot Media

It’s been one hell of a year at UBot Media. Old friends and moved on from our team, new friends are making a name for themselves, and all the while, UBot Studio has been evolving. For the last few months, I’ve taken a hard look at the UBot Studio source base. I got to see some ideas expertly executed, other ideas sloppily and hurriedly done, and still other ideas that were started years ago but never saw the light of day.

It had been a while since I had worn my programmer hat, and I’m glad for the opportunity. The experience has rekindled a passion for something I crafted years ago in my own hands. After all, UBot is more than just business software. UBot is a different way of thinking about the world, about how we get work done. And as it stands, it has only seen but a fraction of its full potential.

Such a thorough audit of our code base has revealed a multitude of things I would like to see fixed or all together changed. Accomplishing everything I want to accomplish will take time, but it’s a journey that will be well worth the effort. I’ve never been so sure that the people on my team are the best humans for the task at hand. And after painstaking experimentation and selection, the technologies we’ve chosen for the future of UBot Studio are the strongest that are available for this moment in time.

So what does that future look like, exactly? I can’t give all the details, but what I can say is that the next update of UBot will be for version 5.5. It will contain a number of internal changes to make the software heartier and more sustainable. I also plan to check some items off the community wish list, and off my personal wish list as well. With this announcement, I will begin updating the tracker to mark the development of UBot 5.5.

So with a team of truly exceptional people, it’s now time to move forward with all the passion, talent, and sweat we have to offer.

In Case You Missed It

 

 In case you missed it, here they are again!

Important news from UBot HQ as well as a feast of helpful tips, tricks and sample scripts!

Dig In!

1. UBot 5.0.12 is Out and Live!

Having any trouble downloading the new update? Let us know at support.ubotstudio.com!

2. An oldie, but a goodie about UBot Studio’s built in artificial intelligence selectors. 

 From UBot 3 to UBot 5, what makes the UBot selectors so advanced? Take a peek!

3.  A Computer Has Passed the Turing Test For the First Time.

 This is just too interesting to miss!

4.  How to Group with Regex in the Replace Regular Expressions function.

Did you know you can group with Regex in UBot tudio? Example 2 shows you how!

5.  Got Questions? Concerns? Thoughts? We’re all ears!

UBot 5.0.12 is Out and Live!

Two very important fixes and additions in this week’s update.

1. The Speed issue as reported here.

I have  been working  these past few weeks on an important issue that has been affecting compiled executables as well as scripts running within UBot Studio.

This issue caused bots and scripts to slow down significantly over time as they ran and eventually freeze.

I was able to resolve the issue and improve the speed of the running scripts and compiled executables.

The fix has been released in UBot 5.0.12.

 

2. The UI Editor has some new features!

You can now change the background colour, and add a UI text area!

The Ui Editor

 

 

To see the list of features and improvements for 5.0.12, please see  here!

If you have any questions or concerns about this update, feel free to let our support staff know at our support portal.

In Case you Missed It

Reading News     In case you missed it, here they are again! Important news from UBot HQ as well as a feast of helpful tips, tricks and sample scripts! Dig In!

 

1. Exciting News from UBot Studio HQ!

 

2. The document Text function is a small but important feature that allows you to grab the html text of a page. See how it works!

 

3. UBot Studio comes equipped with hot keys that allow UBotters to access certain functionality within the software with ease.

 

4. Here’s a quick example of how to remove the last 1, 2, or 3 item(s) within a list.

 

5. Incrementing while multi-threading can be tricky.  Here’s an example that will help!