mamica 10 Posted December 11, 2014 Report Share Posted December 11, 2014 I m trying to make a bot that switch proxys inside thread so i use proxy setting to local, but it is not working properly. Can someone confirm if they made a sucesful bot with prxy switching inside threads? Quote Link to post Share on other sites
Bot-Factory 602 Posted December 11, 2014 Report Share Posted December 11, 2014 I m trying to make a bot that switch proxys inside thread so i use proxy setting to local, but it is not working properly. Can someone confirm if they made a sucesful bot with prxy switching inside threads?Yes that works fine. Don't forget "In new browser" command. Or do you talk about http plugin / sockets? Because that would be different then. Dan Quote Link to post Share on other sites
mamica 10 Posted December 11, 2014 Author Report Share Posted December 11, 2014 i use this: thread { set(#proxy,$next list item(%proxylist),"Local") in new browser { change proxy(#proxy) navigate(#website,"Wait") } } See i set proxy to local since i wish to use 5 different proxys, will this work or i messed it up?Problem is that i can not sucesfully make a navigation bot with proxys. Quote Link to post Share on other sites
Bot-Factory 602 Posted December 11, 2014 Report Share Posted December 11, 2014 Give this a try.IP:PortIf your proxies need authentication then you have to add that as well. Navigatewithproxy("http://www.amazon.com", "None")define Navigatewithproxy(#url, #proxy) { thread { in new browser { change proxy(#proxy) navigate(#url,"Wait") wait(10) } }} Try it without proxy first. Then add your proxy. If it's not working with the proxy, then it's not the script. :-) 1 Quote Link to post Share on other sites
mamica 10 Posted December 12, 2014 Author Report Share Posted December 12, 2014 So in your code i dont need to set up any variable to local? Thats interesting, i will try this. Thanks Quote Link to post Share on other sites
Pete 121 Posted December 12, 2014 Report Share Posted December 12, 2014 So in your code i dont need to set up any variable to local?I think you will find the variable #proxy is set to local before its sent to the define NavigatewithproxyIf it was global you would create a conflict Quote Link to post Share on other sites
Marton 48 Posted December 12, 2014 Report Share Posted December 12, 2014 I think you will find the variable #proxy is set to local before its sent to the define NavigatewithproxyIf it was global you would create a conflict No-no-no! I think you might be confusing variables with parameters. I realize this is a common mistake amongst Ubotters, because unfortunately it's not explained anywhere properly (even though this is a basic programming concept, I think the Ubot wiki could be a bit more clear about this, because most people come here without any prior programming knowledge). The #proxy that you see inside the define of Dan's code doesn't even exist outside of the define. Because #proxy is what "becomes" of whatever is sent to the define. Anything can "become" #proxy. Any variable value (doesn't even have to be called #proxy), any list item, any table cell etc... And they can all be global before they are passed to the define, no problem there (depending on where they are coming from of course), because inside the define the corresponding value(s) will be used locally. So in your code i dont need to set up any variable to local? Thats interesting, i will try this. Thanks That is actually correct. In Dan's code, whatever you pass to the define as parameter will be used locally automatically (it can even be any global variable, or in your case maybe a specific list item, since we are talking about proxies), so you don't necessarily have to declare a local variable inside the define (contrary to popular belief that I see in some "pro" tutorials ). Hope you understand that. Marton 1 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.