Jump to content
UBot Underground

Calling a sub in itself and thread / sub window limits


Recommended Posts

Sorry for asking so much.

 

--------

 

Will ubot crash if i call the sub in itself?

 

example:

 

run sub1

sub1

{

if(the thing is true)

{ do what we want }

else

{ run sub1 }

}

 

--------

 

And 1 more thing, how many threads and sub windows can run at the same time?

 

--------

 

Making several sub windows writing at same time and since only 1 object can be selected at a time im making a lock function so they dont write in each others window. Forgot how the normal lock function works so im making it with IDs for every sub window.

 

--------

 

Getting some strange results from the script im making now.

2 threads with 2 sub windows and the main window all trying to navigate and write.

1 sub window didnt close at second try.

The main window didnt navigate at first try, second try it did.

was gonna write:

text

text sub

text sub 2

in the windows but the result at first try it was: "ttt" in one of the sub windows. no text at second try but think that might have been that the pages took to long to load.

3rd try it gave "tttext sub 2ext sub"

might be my lock function that messes with everything. they shouldnt be able to write like that.

 

 

If i make a sub and take a parameter in it, will that local variable be used for every thread that runs it (so if 2 runs it at same time the second one writes on the first onces)?

 

Trying to do like:

>give a id to each thread

>run sub lock(id)

>lock, parameter id

>while locked = 0 (not locked)

>{set lock to id

>delay 3

>if(id = locked)

>do stuff

>else run sub again}

They run at the same time so think each time the sub is run i write over the id parameter, hoped it was gonna be 1 for each instance of the sub.

 

If this is the case, anyway to write a mutex or somethins similar? "Mutex variables are one of the primary means of implementing thread synchronization and for protecting shared data when multiple writes can occur."

Not sure if its possible to make them without their special functions.

 

Think it isnt possible to select in the window that is being used either.

Made 3 lock functions for this, result was that all wrote in the same window even though i wrote select before they write in their own threads.

Link to post
Share on other sites

Regarding your first question, it's not a good coding practise to make recursive calls, as you could end up in an infinite loop or be resource intensive.

 

Questions two and three: Ubot does not currently support true Windows multi-threading. This will be available in Ubot Pro/Dev; which are out soon.

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