Jump to content
UBot Underground

How are variables handled in memory?? Running 10 of the same bot at the same time


Recommended Posts

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.

Link to post
Share on other sites

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=1

Thread2 = {#currentaccount}&n=2

Thread3 = {#currentaccount}&n=3

Thread4 = {#currentaccount}&n=4

Thread5 = {#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 by vmunich
Link to post
Share on other sites

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

Link to post
Share on other sites

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 skills

but like zap wrote here  we have to see  the code to show u a solution or idea how to do

Link to post
Share on other sites

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 by vmunich
Link to post
Share on other sites

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!

Link to post
Share on other sites

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

Link to post
Share on other sites

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=1

Thread2 = {#currentaccount}&n=2

Thread3 = {#currentaccount}&n=3

Thread4 = {#currentaccount}&n=4

Thread5 = {#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

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