vmunich 0 Posted February 17, 2014 Report Share Posted February 17, 2014 Hello, I have a bot which has variable #a, #b and #c. I compiled it and ran 10 compiled bots at the same time. I noticed that some bots were overwriting the content of the variable of other bots!! So, do I have to set different variable names for each new compiled bot I run? Please someone answer me. Quote Link to post Share on other sites
UBotDev 276 Posted February 17, 2014 Report Share Posted February 17, 2014 I think you should first tell us which version you are using and share the code, since it's hard to help you without that. Quote Link to post Share on other sites
blumi40 222 Posted February 17, 2014 Report Share Posted February 17, 2014 search for Threads in ubotu dont must have open 10 times the same botone with threadingsystem is enougth Quote Link to post Share on other sites
vmunich 0 Posted February 18, 2014 Author Report Share Posted February 18, 2014 (edited) Using Ubot Professional 5.0.7. Ok my bot has around 800 lines, this is the problematic part:http://pastebin.com/Bkqu4hqX 5 of this same thread (of course with different variabels) are executed at the same time. Please note this part: {#currentaccount}&n=1 Each thread is coded to follow the following pattern: Thread1 = {#currentaccount}&n=1Thread2 = {#currentaccount}&n=2Thread3 = {#currentaccount}&n=3Thread4 = {#currentaccount}&n=4Thread5 = {#currentaccount}&n=5 However, sometimes thread1 posts n=4, sometimes thread2 posts n=1, so one thread overlaps the other. I've tried to make some verification steps to prevent that from happening, as you can see on the code on pastebin, but that still happens, even when I'm running only 1 bot on the same computer. Can someone help? Edited February 18, 2014 by vmunich Quote Link to post Share on other sites
vmunich 0 Posted February 18, 2014 Author Report Share Posted February 18, 2014 Anyone? Quote Link to post Share on other sites
Pete 121 Posted February 18, 2014 Report Share Posted February 18, 2014 Without seeing the your code its hard to say, but i would bet you have no idea how to do multi threading and thats the problem Quote Link to post Share on other sites
blumi40 222 Posted February 18, 2014 Report Share Posted February 18, 2014 vmunich your vars should comes from define function wich returns the needet values...also your vars should set in this define with Local Scope for doing that u need a little bit skillsbut like zap wrote here we have to see the code to show u a solution or idea how to do Quote Link to post Share on other sites
vmunich 0 Posted February 18, 2014 Author Report Share Posted February 18, 2014 (edited) I can't post the code publicly i'm looking for someone I could hire to solve my problem. I contacted both BotGuru and UBotDev.com but both seem to be busy.. Is there anyone reliable and professional that I can hire? PS: I Can't PM yet.. Edited February 18, 2014 by vmunich Quote Link to post Share on other sites
Aymen 385 Posted February 19, 2014 Report Share Posted February 19, 2014 did you make sure to set the variables scope to local like many suggested ?if you've done everything correctly , you may want to try my local dictionary plugin! Quote Link to post Share on other sites
UBotDev 276 Posted February 19, 2014 Report Share Posted February 19, 2014 I can't post the code publicly i'm looking for someone I could hire to solve my problem. I contacted both BotGuru and UBotDev.com but both seem to be busy.. Is there anyone reliable and professional that I can hire? PS: I Can't PM yet..Sorry, but we also have other work; I replied 10 minutes after you, but you were gone! You can always feel free and post your code and we can help you when we have time... Quote Link to post Share on other sites
pftg4 102 Posted February 20, 2014 Report Share Posted February 20, 2014 Variables are local to a define not a thread Quote Link to post Share on other sites
Bot-Factory 602 Posted February 23, 2014 Report Share Posted February 23, 2014 Using Ubot Professional 5.0.7. Ok my bot has around 800 lines, this is the problematic part: http://pastebin.com/Bkqu4hqX 5 of this same thread (of course with different variabels) are executed at the same time. Please note this part: {#currentaccount}&n=1 Each thread is coded to follow the following pattern: Thread1 = {#currentaccount}&n=1Thread2 = {#currentaccount}&n=2Thread3 = {#currentaccount}&n=3Thread4 = {#currentaccount}&n=4Thread5 = {#currentaccount}&n=5 However, sometimes thread1 posts n=4, sometimes thread2 posts n=1, so one thread overlaps the other. I've tried to make some verification steps to prevent that from happening, as you can see on the code on pastebin, but that still happens, even when I'm running only 1 bot on the same computer. Can someone help? The link is not working. If you want to work with Threads, I highly recommend the Threads Counter plugin. Basically you have one loop from where you start your threads. And a define which contains all the code for a thread. Here's some example code: set(#active threads, $plugin function("Threads Counter.dll", "threads counter", "reset"), "Global")set list position(%userurl, 0)loop($list total(%userurl)) { loop while($comparison($plugin function("Threads Counter.dll", "threads counter", "read"), ">=", 25)) { wait(0.5) } set(#active threads, $plugin function("Threads Counter.dll", "threads counter", "increment"), "Global") filterresults($next list item(%userurl))} define filterresults(#nextitem) { thread { comment("THREAD COMMANDS HERE") set(#active threads, $plugin function("Threads Counter.dll", "threads counter", "decrement"), "Global") }} If you have a specific question please PM me. If you need someone to do the work and look at your code, I can help with that to. Dan 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.