Jump to content
UBot Underground

Variable In Multi-Thread


Recommended Posts

hello guys ..

i am having problem with my code . it works good when it is single threaded but it mix up variable value.

 

it is like i am saving some value in variable lets say #A variable after it logged into a site . but when i run it on multi-thread 

like on 3 thread then 

 

lets say when thread  1 is running variable #A computed as 11 value.

 

and as it multi-thread thread  2 is also running and is assigned 22 value to #A variable

 

and also thread 3 is running and it assigned 33 value to variable #A

 

but i wan to save all thread results in seperate folder like thread 1 restul in folder "a" thread 2 restult in folder "b" and thread 3 result in folder "C" 

 

 

but problem is after computed variable in each thread it mix up value of #A variable .  i want to tell thread to use their own #A variable .

 

Thank you 

xroot

Link to post
Share on other sites

hello guys ..

i am having problem with my code . it works good when it is single threaded but it mix up variable value.

 

it is like i am saving some value in variable lets say #A variable after it logged into a site . but when i run it on multi-thread 

like on 3 thread then 

 

lets say when thread  1 is running variable #A computed as 11 value.

 

and as it multi-thread thread  2 is also running and is assigned 22 value to #A variable

 

and also thread 3 is running and it assigned 33 value to variable #A

 

but i wan to save all thread results in seperate folder like thread 1 restul in folder "a" thread 2 restult in folder "b" and thread 3 result in folder "C" 

 

 

but problem is after computed variable in each thread it mix up value of #A variable .  i want to tell thread to use their own #A variable .

 

Thank you 

xroot

 

 

 

put your process into a define command (if you havent already) then try changing the variable in question to "Local" if multi-threading mate :)

 

Global will be used/accessed botwide or "Globally" (by all commands etc.. )

Local will be used "Locally" within the define it is run from (can be passed to other defines via parameters but that another story)

 

here you go :

http://wiki.ubotstudio.com/wiki/Set

 

 

 

 

Cheers

CJ

Link to post
Share on other sites

Xroot - Please clarify.

 

The data is being entered correctly on the website you are working with, but when it saves locally it is saving the wrong var value?

 

If this is the case, first I would check to make sure that my call to save the data occurs before the var value changes again. - I know it sounds like common sense, but sometimes our processes can outrun other processes.

 

Some potential fixes are:

 

1- put a 1/2 second wait after data enters the var and before the next thing happens.

 

2- double the var in another location deeper in your script. In other words have that var data saved into another var, then immediately before save, do an [if][compare] so that if both vars content are same, then continue, if different then alert/stop.

 

I'm really just guessing man - I'm my mind, ubot doesn't have the ability to pass the wrong information from a variable - It is only capable of passing the information that is currently stored in the variable at the moment of execution, so if the var is passing bad/incorrect information, then it means the content of that var is changing before the save function is run.

Link to post
Share on other sites

Thank you man i am setting variable to nothing after it save in file

but i like your answer like add time wait and make another variable and then use if statement if both are equal then save else stop 

 

thank you brutal you answer make sense to me ... 

 

one more question is it possible that ubot can mix up variable values when run on multihtread >>

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