Jump to content
UBot Underground

Make a bot begin at a specific point in the bot and possibly end at a specific point?


Recommended Posts

Ok so basically I have a bot that is submitting articles to various sites. It then scrapes the url of the article and then posts it in our system so that other articles can then link back to it. Pretty basic stuff!

 

Every once in a while something goes wrong for various reasons. Either the site is down, a page got hung up or a username/password failed.

 

So I'm wondering if there is a way to create a bot with something like a ui dropdown so that if I want to I can tell the bot to start at site 25 rather than site 0.

 

It would also be cool if I could tell it to start at site 25 and end at site 25. In case That was the only site that got screwed up during posting.

 

Any thoughts/ideas?

Link to post
Share on other sites

After each successful submission you can have the bot eliminate the site from the list and save the new list to file... then when you run it again (and subsequently) it is only using sites on the most current updated list... http://ubotstudio.com/forum/public/style_emoticons/default/rolleyes.gif

Link to post
Share on other sites

After each successful submission you can have the bot eliminate the site from the list and save the new list to file... then when you run it again (and subsequently) it is only using sites on the most current updated list... http://ubotstudio.com/forum/public/style_emoticons/default/rolleyes.gif

How would I go about doing that? I'm not sure I understand. The sites withing the bot aren't on a list because each site is different and so I basically have a bot that has a ton of definitions in it. Each definition for a new site. I just don't know what you mean with the list concept.

Link to post
Share on other sites

It depends where you are getting your sites from... if you are scraping them you can add them to a list before navigating to them... wherever you are getting them from you can add them to a list first... then you have a list to work with... sorry, without more detail I can't be of much more help...

Link to post
Share on other sites

It depends where you are getting your sites from... if you are scraping them you can add them to a list before navigating to them... wherever you are getting them from you can add them to a list first... then you have a list to work with... sorry, without more detail I can't be of much more help...

The sites are part of the bot. Im not scraping a list of site. (not sure how you would be able to scrape a list of sites and then post articles to them since all article sites are different)

 

Lets say for example that I am posting to sites a,b and c. My bot consists of three definitions one for site a, one for site b,, and one for site c. How would I go about doing what you are suggesting?

Link to post
Share on other sites

I'm still not getting you... there must be a list of sites somewhere that you are navigating to... that is the list I'm referring to (it sounds like you have 3 lists.. one for each definition). As you go to each site on the list you would remove it from the list and save the new list. Sorry if I'm missing something here... http://ubotstudio.com/forum/public/style_emoticons/default/huh.gif

Link to post
Share on other sites

Right...what Duane is saying is you have specific sites your are navigating to. How many sites are you navigating to, and are they all hard coded?

 

John

Link to post
Share on other sites

Right...what Duane is saying is you have specific sites your are navigating to. How many sites are you navigating to, and are they all hard coded?

 

John

 

There are currently about 20 sites. They are all hard coded. Maybe I have been going about this the wrong way. I don't know of any other way to go about it. I have attached a sample bot. It won't work because I have removed some of the pieces of the bot as they included passwords to our system where the article data is downloaded from, but you will get an idea from this how my bot is working.

 

test-article-posting.ubot

Link to post
Share on other sites

There are currently about 20 sites. They are all hard coded. Maybe I have been going about this the wrong way. I don't know of any other way to go about it. I have attached a sample bot. It won't work because I have removed some of the pieces of the bot as they included passwords to our system where the article data is downloaded from, but you will get an idea from this how my bot is working.

 

test-article-posting.ubot

 

Anyone have any ideas for this?

Link to post
Share on other sites

If you're trying to stop the bot if a submission fails... (That's what you're trying to do right?)

 

You're going to have to MANUALLY go through each site, and come up with some type of identifier you can use when a submission fails. For example if a page doesn't load within 15 seconds, or if 'submission failed' is displayed in the browser, etc etc.

 

Look for these identifiers when something fails, and user your script to set some kind of variable when one of these identifiers is true or exists, and simply do an if then statement, if variable = true, stop script.

Link to post
Share on other sites

If you're trying to stop the bot if a submission fails... (That's what you're trying to do right?)

 

You're going to have to MANUALLY go through each site, and come up with some type of identifier you can use when a submission fails. For example if a page doesn't load within 15 seconds, or if 'submission failed' is displayed in the browser, etc etc.

 

Look for these identifiers when something fails, and user your script to set some kind of variable when one of these identifiers is true or exists, and simply do an if then statement, if variable = true, stop script.

 

I don't think you are understanding my question clearly. If you look at the bot I sent I already have if then commands in the bot. Let me try to be more clear.

 

So lets say the bot posts an article to sites A, B, C, D and E.

 

Let's say the post fails on site C, and moves on to post to site D and E to complete the rest of the bot. I still want to go back and post to site C and I don't want it to repost to site D and E because it already posted to sites D and E. I am looking for a way to tell the bot to start at site C and end at site C so that it doesn't repost to the sites that it already posted to successfully.

Link to post
Share on other sites

Ok, so then have a variable that you set to 1 or 0 depending on whether or not your bot posted to the site correctly, at the end of your script, have an additional if then else that basically says,

 

if site_1_complete = 1 > then run site_1 > else nothing

 

if site_2_complete = 1 > then run site_2 > else nothing

 

If I understand your question correctly that should work.

Link to post
Share on other sites

Hey Josh,

 

I will PM you with a solution.

 

Getting late here, but I think I just solved a problem similar to what you are facing.

 

You might get the answer in the mean time though.

 

Justin

Link to post
Share on other sites

Ok, so then have a variable that you set to 1 or 0 depending on whether or not your bot posted to the site correctly, at the end of your script, have an additional if then else that basically says,

 

if site_1_complete = 1 > then run site_1 > else nothing

 

if site_2_complete = 1 > then run site_2 > else nothing

 

If I understand your question correctly that should work.

 

I think you are on the right track with this only I don't want it to run the site at the end of the bot. Because if a site is down or there are problems with the site sometimes trying to post by the time the bot is finished is too soon and the posting will simply fail again. I would like to be able to reopen the bot and tell it to begin at a specific point in the bot and end at a specific point in the bot. So lets say the bot posts to site A,B,C,D,E, and it fails on site C. I would like to be able to open the bot and tell it to begin posting at site C and end posting at site C. So that it doesn't re-post to the sites that it already posted successfully to.

 

So I guess my question would be, how do I assign a variable to each site, and how do I tell ubot that I want it to begin posting at that variable and stop posting once that variable or another variable has completed?

Link to post
Share on other sites

I think you are on the right track with this only I don't want it to run the site at the end of the bot. Because if a site is down or there are problems with the site sometimes trying to post by the time the bot is finished is too soon and the posting will simply fail again. I would like to be able to reopen the bot and tell it to begin at a specific point in the bot and end at a specific point in the bot. So lets say the bot posts to site A,B,C,D,E, and it fails on site C. I would like to be able to open the bot and tell it to begin posting at site C and end posting at site C. So that it doesn't re-post to the sites that it already posted successfully to.

 

So I guess my question would be, how do I assign a variable to each site, and how do I tell ubot that I want it to begin posting at that variable and stop posting once that variable or another variable has completed?

 

 

Ok, add all failed sites to a list when you run the script. Each time a site fails, add that site to the list, some variable or whatever.

 

At the end of the script, save this list to a file. desktop\software\failed-sites.txt or something.

 

Then have some custom command, for next time you open the bot, that will read this .txt file, then run your custom commands for each site in this list.

Link to post
Share on other sites

You'll just have to get the hang of it, ubot is one of those things there's more than one way to do it.

 

I'd start by reading up on how to create and read from lists, and how to write to and read from files.

 

From there you can just set variables for failed sites, save them to a file, then read the file later on and do whatever you need to do with whatever is in it.

 

Once you understand lists, it will be a little easier. It doesn't really even have to be a list, you could just add a variable to a file for each failed site, and just check if that variable exists in the file when you do your thing.

Link to post
Share on other sites

Ok, add all failed sites to a list when you run the script. Each time a site fails, add that site to the list, some variable or whatever.

 

At the end of the script, save this list to a file. desktop\software\failed-sites.txt or something.

 

Then have some custom command, for next time you open the bot, that will read this .txt file, then run your custom commands for each site in this list.

 

I know how to add failed sites to a list, and I know how to save the list to a file.

 

What I can't figure out is how to go about adding a variable to each of the sites and how to tell ubot to begin the bot at that variable.

Link to post
Share on other sites

Are you putting each site into it's own custom command?

 

If so you can use a ui window with check boxes.

 

If the box is checked, then run that custom command.

 

For example, you have 20 sites. Each with it's own checkbox. Let's say that blogger is check box C, if blogger fails, then check box C and run the bot.

 

Hope this is clear, I will try and give you a working example soon....

 

Justin

Link to post
Share on other sites

Are you putting each site into it's own custom command?

 

If so you can use a ui window with check boxes.

 

If the box is checked, then run that custom command.

 

For example, you have 20 sites. Each with it's own checkbox. Let's say that blogger is check box C, if blogger fails, then check box C and run the bot.

 

Hope this is clear, I will try and give you a working example soon....

 

Justin

 

 

Yes each site is it's own custom command, but I was trying to move away from the custom commands and use the private bot bank instead to keep my ubot files smaller. I had so many sites that simply editing the bot took forever because the file size was just too large for ubot. So I have basically created a bot for each site within the private bot bank. This way I have access to the bots anytime I open ubot and it keeps my file sizes down as well.

Link to post
Share on other sites

HAHAHAHA!!!!!!

 

I think I just figured it out

 

ui check box("Blogger", #bloggersite)
if(#wordbombersite) {
   then {
       private bot bank command(9)
   }
   else {
       alert("not checked")
   }
}

Link to post
Share on other sites

HAHAHAHA!!!!!!

 

I think I just figured it out

 

ui check box("Blogger", #bloggersite)
if(#wordbombersite) {
   then {
       private bot bank command(9)
   }
   else {
       alert("not checked")
   }
}

 

How do I make this work with a dropdown instead of checkboxes?

Link to post
Share on other sites

Hey Josh,

 

Here is a working example that should accomplish exactly what you are trying to do:

example bot for josh.ubot

 

Each site will have a check box that you check if you want to run that site. You can put them in a ui window to keep it cleaner, up to you. Do what you want with it.

 

You can either use custom commands OR call a private bot bank function.

 

Hope this helps,

Justin

Link to post
Share on other sites

How do I make this work with a dropdown instead of checkboxes?

Not sure how to make it work with drop boxes.

 

Dang, I spent all that time making a working example for you, for you to figure it out in the mean time :P

 

Oh well, hopefully I was still helpful.

 

Justin

Link to post
Share on other sites

Not sure how to make it work with drop boxes.

 

Dang, I spent all that time making a working example for you, for you to figure it out in the mean time :P

 

Oh well, hopefully I was still helpful.

 

Justin

 

 

Very helpful. Your bot is actually better because of the check all function which I didn't know how to do. Thank you very much for your help. Working examples are always the best because they actually show you what you are talking about. Thanks so much!!!!!!!!!!!!!!!!!!!!

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