Jump to content
UBot Underground

Threading Guys Please Help!


Recommended Posts

Im tearing my hair out here. Ive just finished threading a huge complicated bot but for some reason 1 piece of it won't work. I isolated the script. Can anybody tell me why when you run "Check it" the spun link won't print. But if you set #SpunLinksFinal within the "LinkAdder" define command to Global it will print. I am pretty sure I am passing the variable correctly. Any help would be much appreciated.

 

ui html panel("<select variable=\"#SpunLinksChoice\" fillwith=\"value\" name=\"selt\" id=\"selt\">
<option>No Spun Links</option>
<option>1 Random Link Per Site</option>
</select><input type=\"text\" variable=\"#SpunLinksNumber\" fillwith=\"value\" name=\"linksboxmove\" id=\"linksboxmove\" placeholder=\"# Links\" style=\"display: none; width: 50px;\">
<br>
<cite><strong><span style=\"width: 50%\" class=\"style20\">Spun Money Site Links</span></strong></cite><br>
<textarea variable=\"#SpunLinks\" fillwith=\"value\" style=\"width: 95%; height: 75px;\"></textarea>", 200)
define LinkAdder(#SpunLinksFinalPass) {
   clear list(%SpunLinks)
   add list to list(%SpunLinks, $list from text(#SpunLinks, $new line), "Delete", "Global")
   clear list(%SpunLinksFinal)
   if($contains(#SpunLinksChoice, "1 Random Link Per Site")) {
       then {
           add item to list(%SpunLinksFinal, $random list item(%SpunLinks), "Delete", "Local")
           set(#SpunLinksFinal, $spin(%SpunLinksFinal), "Local")
       }
       else {
       }
   }
}
define LinkAdderCheck(#SpunLinksFinalPass) {
   set(#SpunLinksFinal, #SpunLinksFinalPass, "Local")
   save to file("\\\\psf\\Home\\Desktop\\SpunLink.txt", #SpunLinksFinal)
}
define Check it {
   LinkAdder(#SpunLinksFinal)
   LinkAdderCheck(#SpunLinksFinal)
}
Check it()

Link to post
Share on other sites

If it is a bug I'm not sure whats causing it since my other local variables are setting and passing through. Im thinking it may be a bug with passing the variable through the "if" command. I would love TJ or John to chime in and see if Im just doing something wrong.

Link to post
Share on other sites

It's not threaded. Like I said its an isolated code thats not passing the local variable. I'm trying to thread it but the #SpunkLinksFinal variable won't pass locally through the define commands so I'm not able to thread it.

Link to post
Share on other sites

Simplified further, and adjusted as needed.

 

Working and shows its working with the load html node and a 30 second wait in each browser window.

 

ui html panel("<select variable=\"#SpunLinksChoice\" fillwith=\"value\" name=\"selt\" id=\"selt\">
<option>No Spun Links</option>
<option>1 Random Link Per Site</option>
</select><input type=\"text\" variable=\"#SpunLinksNumber\" fillwith=\"value\" name=\"linksboxmove\" id=\"linksboxmove\" placeholder=\"# Links\" style=\"display: none; width: 50px;\">
<br>
<cite><strong><span style=\"width: 50%\" class=\"style20\">Spun Money Site Links</span></strong></cite><br>
<textarea variable=\"#SpunLinks\" fillwith=\"value\" style=\"width: 95%; height: 75px;\"></textarea>", 200)
define LinkAdder {
   clear list(%SpunLinks)
   add list to list(%SpunLinks, $list from text(#SpunLinks, $new line), "Delete", "Global")
   clear list(%SpunLinksFinal)
   if($comparison(#SpunLinksChoice, "=", "1 Random Link Per Site")) {
       then {
           add item to list(%SpunLinksFinal, $random list item(%SpunLinks), "Delete", "Local")
           set(#SpunLinksFinal, $spin(%SpunLinksFinal), "Local")
       }
       else {
       }
   }
   save to file("\\\\psf\\Home\\Desktop\\SpunLink.txt", #SpunLinksFinal)
   load html(#SpunLinksFinal)
   wait(30)
}
loop(5) {
   thread {
       in new browser {
           LinkAdder()
       }
   }
}

Link to post
Share on other sites

Hey TJ thanks for you help. Sorry if I'm not clear though. I know how to get this to work in a simplified way but I don't have that option. My question is why is what I have not working? I have a script that is about 3000 lines long. The snippet I took is just one tiny piece of it. Its not about how to simplify this, its about why is the variable not passing in the original script?

 

When you run "Check it" it should check whether the drop down is set to 1 random spun link. If it is it should then grab one of those links randomly and print it to the file. If you set #SpunLinksFinal to global it works but local it doesn't. Its either a bug that won't pass local variables through an if command and then a define command or I'm overlooking something.

 

In my actual script I need to pass that #SpunLinksFinal variable through about 5 different define commands. For some reason it won't pass if its set to local and it will if its set to global which to me suggests a bug unless I am doing something wrong. So my question is not how to get rid of elements to make this script work its about why is what I am doing not working? In a nutshell the "Check it" define command in the actual script is a submission node taking that spun link with a other local variables and submitting it. So I can't just cut it out of the equation. Shouldn't what I have pass the local variable through and print it to a file? I just have no idea why it won't.

Link to post
Share on other sites

because you dont need to pass it, its defined locally to the define command.

 

So when that command is called in that thread its held local to that defined command in that thread and should work without a problem. No need to add it as a parameter

Link to post
Share on other sites

because you dont need to pass it, its defined locally to the define command.

 

So when that command is called in that thread its held local to that defined command in that thread and should work without a problem. No need to add it as a parameter

 

But it still needs to pass to the "LinkAdderCheck" command as well which is where it's failing.

Edited by dp40oz
Link to post
Share on other sites

why?

 

define LinkAdderCheck(#SpunLinksFinalPass) {
   set(#SpunLinksFinal, #SpunLinksFinalPass, "Local")
   save to file("\\\\psf\\Home\\Desktop\\SpunLink.txt", #SpunLinksFinal)
}

 

 

Im not sure whatever is in your code so i cant really comment as to the reason you would have this in a separate command like this, just keep it in the original defined command.

 

The problem here i guess is that i dont understand your process and why its broke up like this.

 

I dont see a reason to break it up like this if its not needed, and moving it into the other defined command (where its kept local) will work.

Link to post
Share on other sites

why?

 

define LinkAdderCheck(#SpunLinksFinalPass) {

set(#SpunLinksFinal, #SpunLinksFinalPass, "Local")

save to file("\\\\psf\\Home\\Desktop\\SpunLink.txt", #SpunLinksFinal)

}

I dont see a reason to break it up like this if its not needed, and moving it into the other defined command (where its kept local) will work.

 

Because this is just an example code to showcase the problem. In the real code

 

The define command "LinkAdder" takes whats selected in the drop down. Which in the real code are a bunch of options being:

 

No Spun Links

1 Random Link

Specified Number of Random Links

Create Link Wheel

Create LInk Pyramid

 

Then it grabs the appropriate links and sets the variable "#SpunLinksFinal"

 

Now in the real code "LinkAdderCheck" would be a command that searches for which web 2.0 site is loaded from the table and then will submit to that site with many variables one of them being "#SpunLinksFinal". If I combine these commands the code becomes insanely confusing.

 

Either way whether someone understands why the code is like this it doesn't really matter. What matters is if I needed the code like this for whatever strange reason why wouldn't the local variable pass. Its supposed to pass to the next command unless I am crazy.

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