Jump to content
UBot Underground

Bot Layout - How to have multiple scripts (how to have a clean layout)


Recommended Posts

I gave up on uBot a few months ago as it was to hard to work out how to make simple bots. After reading a few php books and learning the basics I am back again with motivation to make some usefull bots.

 

I need to know how to layout my bot properly.

Instead of having every task in one big list, how do I seperate them as seperate scripts in the same bot.

e.g. script 1. log in to gmail, script 2. Search for activation email, Script3. Click on activation link etc.

 

Im sure this is an easy fix.

Link to post
Share on other sites

Hey Jack,

 

Exactly the question we all ask. Please allow me to help you as I think I've found a technique that works very well.

 

1. 10,000 level

Investigate what you want to do at the 10,000 foot level. Pencil and paper are your friend! sketch out the basic flow of what's to happen.

 

2. Dig deep with seperate scripts.

Use the power of scripts to test functionality by itself. You'll want to figure out each chunk of what you want to do by itself. Make sure you encapsulate your sections within subroutines. This way you can copy and paste the subroutine, once working, from one script or bot to another. I will normally do a subroutine that's a throw away, that creates monitoring variables on the top of the window and leave that script behind. This will allow me to test, in detail what's going on within the subroutine i'm working on.

 

3. Write each section as above.

Keep working until you get all you need done. Don't be afraid to open an new script window from a script window to figure out some subsection of a section you are working on. For example, I'm writing a vbulletin scraper and I've figured out how to pull the contents of threads, BUT, realized that I needed to figure out how to grab attachments. I simply place myself on the page with the attachments and start to analyze how to handle that one piece. When done, I can always lay that subroutine into the subroutine that I'm working on.

 

4. Don't be afraid to expand beyond one bot.

Sometimes you'll be working on a huge project. Don't be afraid to move beyond one bot. For example, I was writing a massive article poster script and I was placing one site on one script within a bot. Well, didn't take long for ubot to throw up. I think it was around 30 or so scripts. I decided to isolate each article site to it's own bot and have the primary bot script detect the other scripts to be present and then offer up the ability to access them if they were.

 

Well, that's the over view. Just keep writing bots and trying to overcome problems. Your logic skills will grow exponentially when you do this and you'll get better and better at this game as you go!

 

Frank

Link to post
Share on other sites

I gave up on uBot a few months ago as it was to hard to work out how to make simple bots. After reading a few php books and learning the basics I am back again with motivation to make some usefull bots.

 

I need to know how to layout my bot properly.

Instead of having every task in one big list, how do I seperate them as seperate scripts in the same bot.

e.g. script 1. log in to gmail, script 2. Search for activation email, Script3. Click on activation link etc.

 

Im sure this is an easy fix.

 

There are some useful pointers in this thread too http://ubotstudio.com/forum/index.php?/topic/2944-learning-the-right-way-to-create-bots/

 

Andy

Link to post
Share on other sites

Wow thanks fort he tips Frank.

I am confused at how to have multiple scripts in one bot. I can add a new script which make it easiler as the scripts arent so long. But how do I run a sub script?

Link to post
Share on other sites

Here is a pic to try and explain my self a little better.

As you can see there is a main script, then sub scripts. How do I run the sub scripts (sub task) in the Main Script?

http://www.freeimagehosting.net/uploads/14f6df8dc6.png

 

Right here:

 

http://www.freeimagehosting.net/uploads/24c9615883.jpg

  • Like 1
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...