Jump to content
UBot Underground

What's Wrong With My Code ?


Recommended Posts

Hey peeps, been trying for the past hour to check some proxies from a list, multithreaded without success.

Any help would be appreciated

clear list(%proxy)
add list to list(%proxy,$list from text("89.38.144.11:80
197.232.17.83:8080
54.79.63.137:3128
142.165.19.133:3128
197.232.17.83:8080
192.99.190.5:3128
92.222.167.44:3128
Restart list",$new line),"Delete","Global")
set list position(%proxy,0)
thread spawn(20,10) {
    in new browser {
        ChangeProxy()
    }
    wait(3)
}
define ChangeProxy {
    set(#proxy,$next list item(%proxy),"Global")
    wait(1)
    set(#proxyposition,$list position(%proxy),"Global")
    wait(1)
    if($comparison(#proxyposition,"= Equals",$list total(%proxy))) {
        then {
            set list position(%proxy,0)
            wait(1)
            ChangeProxy()
        }
    }
    change proxy(#proxy)
    wait(1)
    allow images("No")
    allow flash("No")
    navigate("https://whoer.net/","Wait")
    wait for browser event("Everything Loaded","")
    wait(3)
    wait for element(<title="Copy to clipboard">,10,"Appear")
    if($exists(<title="Copy to clipboard">)) {
        then {
            alert("Success!!!")
        }
        else {
            alert("Restart!!!")
            ChangeProxy()
        }
    }
}

Link to post
Share on other sites

The code after you call the Command again is still being ran, it's not returning, for example see how the alert will go off each time the command is called:

set(#num,1,"Global")
CheckNumber()
define CheckNumber {
    if(#num <= 3) {
        then {
            increment(#num)
            CheckNumber()
        }
        else {
        }
    }
    alert("Greater than 3")
}

There are things you can put there like return or stop script (although stop script probably isn't a good choice because sometimes it stops all scripts). But probably it's better to just put everything in an if else, or call another command.

 

I don't see why you couldn't separate out the part that actually navigates to the site, it can be its own command and accept a proxy it can call restart if needed at the very end of that command or it can be a function that returns true/false if the proxy is good.

 

I would get the code working properly first before trying to multithread it.

  • Like 1
Link to post
Share on other sites

Can't seem to figure it out , i even tried to exclude a chunk of code by picking random proxies without success.

If i untick show errors from ubot menu the code work's as it suppose to in both cases

Getting this error and can't seem to pinpoint where this is coming from 

Any help would be apreciated

 

http://i68.tinypic.com/2nhosp5.png

 

Note that Below code uses Heopas Thread Lock

clear list(%proxy)
add list to list(%proxy,$list from text("89.38.144.11:80
197.232.17.83:8080
54.79.63.137:3128
142.165.19.133:3128
197.232.17.83:8080
192.99.190.5:3128
92.222.167.44:3128
Restart",$new line),"Delete","Global")
set list position(%proxy,0)
thread spawn(20,10) {
    plugin command("HeopasCustom.dll", "Heopas Thread Lock", 4)
    in new browser {
        Command()
    }
    plugin command("HeopasCustom.dll", "Heopas Thread Unlock")
    wait(1)
}
define Command {
    wait(1)
    set(#proxy,$random list item(%proxy),"Global")
    wait(1)
    change proxy(#proxy)
    wait(1)
    allow images("No")
    allow flash("No")
    navigate("https://whoer.net/","Wait")
    wait for browser event("Everything Loaded","")
    wait(3)
    wait for element(<title="Copy to clipboard">,10,"Appear")
    if($exists(<title="Copy to clipboard">)) {
        then {
            alert("Success!!!")
        }
        else {
            alert("Denied!!!")
            Command()
        }
    }
}

Link to post
Share on other sites

First of all i thank both of you for taking the time and try to help me with this issue

My main goal is to check proxies from a list on a site that i want to do some actions to, like account creation.

The logic is like this : list of proxies --> assign 1st proxy to var --> check proxy to site i want to make accounts --> if proxy ok continue making account --> else restart from step1 assign 2nd proxy  and so on (if var has reached the end of the list restart from 1st proxy)

Link to post
Share on other sites

Here is a basic example (untested but it should work) I suggest not trying to do multithreading until your code works as expected and it bug free if you try to introduce multithreading too early it will become a nightmare. Anyways, try this:

clear list(%proxy)
add list to list(%proxy,$list from text("89.38.144.11:80
197.232.17.83:8080
54.79.63.137:3128
142.165.19.133:3128
197.232.17.83:8080
192.99.190.5:3128
92.222.167.44:3128
Restart",$new line),"Delete","Global")
set(#running,"true","Global")
loop while($comparison(#running,"=","true")) {
    CheckProxy($next list item(%proxy))
    if($comparison($list position(%proxy),"=",$list total(%proxy))) {
        then {
            set list position(%proxy,0)
        }
        else {
        }
    }
}
define CheckProxy(#proxy) {
    in new browser {
        allow images("No")
        allow flash("No")
        change proxy(#proxy)
        navigate("https://whoer.net/","Wait")
        wait for browser event("Everything Loaded","")
        wait(3)
        if($exists(<title="Copy to clipboard">)) {
            then {
                CreateAccount(#proxy)
            }
            else {
            }
        }
    }
}
define CreateAccount(#proxy) {
}
Link to post
Share on other sites

Ok so today i had some free time and tried to give this another shot.

I've followed HelloInsomnia's advice and run it single threaded.Everithing work's as i was expecting , no errors what soever.

If i ad multithreaded to the mix i get the same errors.

I'm going to put the 2 sample codes so some of you guys can test it out and tell my why is this happening

 

Single threaded Code :

clear list(%proxy)
add list to list(%proxy,$list from text("89.38.144.11:80
197.232.17.83:8080
54.79.63.137:3128
142.165.19.133:3128
197.232.17.83:8080
192.99.190.5:3128
92.222.167.44:3128",$new line),"Delete","Global")
set list position(%proxy,0)
loop(10) {
    ChangeProxy()
}
define ChangeProxy {
    set(#proxy,$next list item(%proxy),"Global")
    wait(1)
    set(#proxyposition,$list position(%proxy),"Global")
    wait(1)
    if($comparison(#proxyposition,"= Equals",$list total(%proxy))) {
        then {
            set list position(%proxy,0)
            wait(1)
            ChangeProxy()
        }
    }
    change proxy(#proxy)
    wait(1)
    allow images("No")
    allow flash("No")
    navigate("https://whoer.net/","Wait")
    wait for browser event("Everything Loaded","")
    wait(3)
    wait for element(<title="Copy to clipboard">,10,"Appear")
    if($exists(<title="Copy to clipboard">)) {
        then {
            alert("Success!!!")
        }
        else {
            alert("Restart!!!")
            ChangeProxy()
        }
    }
}

Multi Threaded code : 

clear list(%proxy)
add list to list(%proxy,$list from text("89.38.144.11:80
197.232.17.83:8080
54.79.63.137:3128
142.165.19.133:3128
197.232.17.83:8080
192.99.190.5:3128
92.222.167.44:3128",$new line),"Delete","Global")
set list position(%proxy,0)
thread spawn(10,4) {
    in new browser {
        ChangeProxy()
        wait(1)
    }
}
define ChangeProxy {
    set(#proxy,$next list item(%proxy),"Global")
    wait(1)
    set(#proxyposition,$list position(%proxy),"Global")
    wait(1)
    if($comparison(#proxyposition,"= Equals",$list total(%proxy))) {
        then {
            set list position(%proxy,0)
            wait(1)
            ChangeProxy()
        }
    }
    change proxy(#proxy)
    wait(1)
    allow images("No")
    allow flash("No")
    navigate("https://whoer.net/","Wait")
    wait for browser event("Everything Loaded","")
    wait(3)
    wait for element(<title="Copy to clipboard">,10,"Appear")
    if($exists(<title="Copy to clipboard">)) {
        then {
            alert("Success!!!")
        }
        else {
            alert("Restart!!!")
            ChangeProxy()
        }
    }
}

Link to post
Share on other sites

You have to separate out the proxy stuff from being inside of a thread and also any time you use "set" in a thread you need it to be set to Local not Global.

 

Try this:

clear list(%proxy)
add list to list(%proxy,$list from text("132.148.77.98:8080
172.93.110.27:1080
104.131.63.238:80",$new line),"Delete","Global")
set(#running,"true","Global")
loop while($comparison(#running,"=","true")) {
    thread spawn(3,3) {
        CheckProxy($next list item(%proxy))
        if($comparison($list position(%proxy),"=",$list total(%proxy))) {
            then {
                set list position(%proxy,0)
            }
            else {
            }
        }
    }
}
define CheckProxy(#proxy) {
    in new browser {
        allow images("No")
        allow flash("No")
        change proxy(#proxy)
        navigate("https://whoer.net/","Wait")
        wait for browser event("Everything Loaded","")
        wait(3)
        if($exists(<title="Copy to clipboard">)) {
            then {
                CreateAccount(#proxy)
                alert("Success")
            }
            else {
                alert("Failed")
            }
        }
    }
}
define CreateAccount(#proxy) {
}
Link to post
Share on other sites

Thank's bud for this work's great , and finally understood the way threading work's and some other stuff like setting a variable inside a define makes it local (didn't know that i was setting it from inside the set command) or setting list total and list position without writing the value in a variable will work

Thank's again for this

  • Like 1
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...