VentureOnline 49 Posted August 13, 2012 Report Share Posted August 13, 2012 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() Quote Link to post Share on other sites
a2mateit 395 Posted August 13, 2012 Report Share Posted August 13, 2012 It will not set for me either when trying to set it to local... But if I set it to global it works perfectly Not sure if this is a bug or not. Quote Link to post Share on other sites
VentureOnline 49 Posted August 13, 2012 Author Report Share Posted August 13, 2012 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. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted August 14, 2012 Report Share Posted August 14, 2012 i dont see how the above is threaded. PM me the full copy and ill have a look for ya.. Quote Link to post Share on other sites
VentureOnline 49 Posted August 14, 2012 Author Report Share Posted August 14, 2012 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. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted August 14, 2012 Report Share Posted August 14, 2012 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() } } } Quote Link to post Share on other sites
nimbystripes 0 Posted August 14, 2012 Report Share Posted August 14, 2012 What does it mean if it is threaded exactly? Sorry for such a dumb question.. Quote Link to post Share on other sites
VentureOnline 49 Posted August 14, 2012 Author Report Share Posted August 14, 2012 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. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted August 14, 2012 Report Share Posted August 14, 2012 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 Quote Link to post Share on other sites
dp40oz 0 Posted August 14, 2012 Report Share Posted August 14, 2012 (edited) 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 August 14, 2012 by dp40oz Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted August 14, 2012 Report Share Posted August 14, 2012 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. Quote Link to post Share on other sites
VentureOnline 49 Posted August 15, 2012 Author Report Share Posted August 15, 2012 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 Links1 Random LinkSpecified Number of Random LinksCreate Link WheelCreate 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. Quote Link to post Share on other sites
VentureOnline 49 Posted August 15, 2012 Author Report Share Posted August 15, 2012 Just for people wondering in the future I solved this issue. The answer is to not have "LinkAdder" be a command but have it as a function and then you can pass the return locally. 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.