erkkimies 0 Posted August 3, 2010 Report Share Posted August 3, 2010 Soo hello. Im making a bot and the idea is to put urls in list untill the list runs out. Then i have if for list position = list total. And if thats the case run sub which is out from the loop. But after it have run the sub it hops back in the loop . How can i make it not to do that. After all Urls are put it should just go to next site not start fucking it all over. Thnx Quote Link to post Share on other sites
pftg4 102 Posted August 3, 2010 Report Share Posted August 3, 2010 hi why don't you post the code so we can take a look for ya pftg4 Quote Link to post Share on other sites
erkkimies 0 Posted August 3, 2010 Author Report Share Posted August 3, 2010 Well i think i described the problem pretty well. I have sub outside the loop and run sub inside. It does like it should and runs the sub. But then it just continues from the "run sub" which is inside the loop and keeps looping instead of continuing from the sub . I don't recall having this problem before and i have used this succesfully in few other bots i made. Quote Link to post Share on other sites
pftg4 102 Posted August 3, 2010 Report Share Posted August 3, 2010 ok let me get this straight runs loop goes off to run sub then returns and starts running the loop from the begining or from where it left off?? pftg4 Quote Link to post Share on other sites
MiriamMB 63 Posted August 3, 2010 Report Share Posted August 3, 2010 I need to see the bot in order to pinpoint whatever the problem is. It's probably something minuscule, but it's a problem that needs to be seen to be solved. Quote Link to post Share on other sites
JohnB 255 Posted August 4, 2010 Report Share Posted August 4, 2010 One thing not very clearly explained is how many times you have the loop set to run. I am trying to figure out if your explanation is describing %List Total as the number of times to run the loop: "Then i have if for list position = list total"On the surface it would appear some node in the sub is sending it back to the loop, OR it doesn't have the appropriate condition to exit it (i.e. it is set to run more loops than you intended). But Lilly is right, it really needs to be seen. Quote Link to post Share on other sites
erkkimies 0 Posted August 4, 2010 Author Report Share Posted August 4, 2010 Okey. Sorry, was bit probably bit angry last night due the error and spent time trying to figure it out. Here is the bot in attachment. it also has folder called data which has some information for lists so you don't need open them every time. Youll need some kind of list of URLs tho, should not be a problem the "RSS" open file box is not needed since i did not get that far yet. Also You need put the data folder to your \program files\UBOT\ since the developer tool runs from there. For some reason it did not let me upload with attachment so here is DL link http://g5y.net/erroz.rar Quote Link to post Share on other sites
MiriamMB 63 Posted August 4, 2010 Report Share Posted August 4, 2010 no problem Erkkimies. I'm taking a look at your bot now. Quote Link to post Share on other sites
Seth Turin 223 Posted August 5, 2010 Report Share Posted August 5, 2010 your description of what is happening is a little unclear, but what I notice in this script is that you run the sub from inside the same sub. this creates something called a recursion, and is generally something to be avoided. while I don't fully understand the problem, I think you'll be able to fix it if you restructure your code in a way that avoids these recursions. Quote Link to post Share on other sites
erkkimies 0 Posted August 5, 2010 Author Report Share Posted August 5, 2010 your description of what is happening is a little unclear, but what I notice in this script is that you run the sub from inside the same sub. this creates something called a recursion, and is generally something to be avoided. while I don't fully understand the problem, I think you'll be able to fix it if you restructure your code in a way that avoids these recursions. No thats not the problem only problem is when it should run the sub "valmis" i put the first Run sub inside it becosuse it did not work otherwise. I dunnno this really have not happened before. The problem is It runs the sub "Valmis" But after that it continues running from where it says "Run sub" instead of continuing to end of the script after Sub "valmis" Normally i use the run sub to hop some place mostly out of the loop. This has worked before For example in This Youtube Comment scraper check it out Comment scraper.ubot Quote Link to post Share on other sites
Seth Turin 223 Posted August 5, 2010 Report Share Posted August 5, 2010 the behavior you're describing is the way that ubot is supposed to work.run sub will go to a sub, and then the script will resume the commands after the run sub command. Quote Link to post Share on other sites
erkkimies 0 Posted August 5, 2010 Author Report Share Posted August 5, 2010 Then how can i get out from the loop if it will loop pretty much infinite(actually came up with some kind of plan.make it set loop to 1, then it should have done it and wont loop again ?, but stil}. And if you check the Youtube comment scraper i attached its working just like that . Quote Link to post Share on other sites
Seth Turin 223 Posted August 5, 2010 Report Share Posted August 5, 2010 there are two ways - one is to make sure you loop the correct number of times. if that is indeterminable, then the answer is to use a while loop, which will loop for as long as a certain condition is met. it sounds like a while loop is what you need to use here. Quote Link to post Share on other sites
erkkimies 0 Posted August 5, 2010 Author Report Share Posted August 5, 2010 Okey sweet, Thanks for help Need really take look into while thingy. Have been using Automate so much and its goto so though the subbing out of loop being good idea Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.