Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Alternative to Thread.Sleep(time);

Under the thread WIP: AMB, I have made a bot to create emails, except I have a problem with how it conducts itself.

Lets say a page doesn't load fast enough, My only current option is to extend the sleeping time and wait for a response. This is not ideal.

I want to be able to return whether the page is fully loaded or not but found that repeatedly using needle and haystack method isn't very efficient.

Is there some other method I can use to return when a page is fully loaded, rather then putting it to sleep constantly.
(I am aware of TaskFactory but again, that's a timed event and doesn't help)

My bot has managed to create 8 emails in 40 minutes, far too long, but then one page took too long and it shit itself

Only just added error logging and safe handling today
(Its running another two hour test and being recorded, but the problem is definitely the response time)
(Mar 12, 2019 03:19 PM)Steam Wrote:  Under the thread WIP: AMB, I have made a bot to create emails, except I have a problem with how it conducts itself.

Lets say a page doesn't load fast enough, My only current option is to extend the sleeping time and wait for a response. This is not ideal.

I want to be able to return whether the page is fully loaded or not but found that repeatedly using needle and haystack method isn't very efficient.

Is there some other method I can use to return when a page is fully loaded, rather then putting it to sleep constantly.
(I am aware of TaskFactory but again, that's a timed event and doesn't help)

My bot has managed to create 8 emails in 40 minutes, far too long, but then one page took too long and it shit itself

Only just added error logging and safe handling today
(Its running another two hour test and being recorded, but the problem is definitely the response time)

Are you using WebClient, WebRequest, HttpClient??

They should all have a load complete event (named something else obv.) but you get the point.
(Mar 12, 2019 03:27 PM)devvariety Wrote:  Are you using WebClient, WebRequest, HttpClient??

They should all have a load complete event (named something else obv.) but you get the point.

I do but only for 2Captcha.

It's simply served by opening the process, pressing ctrl shift n (for chrome)
Entering the URL, going to sleep, entering all the information and further sleeping when pages load send captcha, sleep even longer (I'm working on async function for that) then click through, close all and repeat.

Not exactly efficient, an email every 5 minutes due to sleeping
(Mar 12, 2019 03:31 PM)Steam Wrote:  I do but only for 2Captcha.

It's simply served by opening the process, pressing ctrl shift n (for chrome)
Entering the URL, going to sleep, entering all the information and further sleeping when pages load send captcha, sleep even longer (I'm working on async function for that) then click through, close all and repeat.

Not exactly efficient, an email every 5 minutes due to sleeping

That's your problem. You're using a captcha service that takes a minute or two to respond/sovle the captcha.

What kind of captcha are we dealing with here?

ReCaptcha, FunCaptcha??
(Mar 12, 2019 03:33 PM)devvariety Wrote:  That's your problem. You're using a captcha service that takes a minute or two to respond/sovle the captcha.

What kind of captcha are we dealing with here?

ReCaptcha, FunCaptcha??

It takes anywhere from 20-45 seconds. I also have that on a loop so if its incorrect, use N&H and report bad/non-capcha and continue.

The capchas are simple alphanumeric capcha, not sure but it solves fine and never had a problem with that yet

The actual problem (since that will be async), is that if one of the 352 VPNs is slow, it won't load before the bot wakes up again, and thats where the issue really lies

Edit: just checked 20 mins into 2 hour test and going strong.
Would something like this work? I tried it with events. I believe this would work pretty good for a bot.

[Image: Syr3DlV.png]
(Mar 12, 2019 03:56 PM)gigajew Wrote:  Would something like this work? I tried it with events. I believe this would work pretty good for a bot.
Looks as if it may work, however I am unsure due to use of a proxy.
I'll definitely try it out after this though, it's 45 minutes into it and still going.

The problem is probably more than just the response time, it needs to fully display the page on the screen for N&H, but I'll definitely try it in an hour and 15 after test is finished

Edit: Bot successfully created 23 more emails in 1 hour and 50 minutes.
Noticeable issue but only occured once was it didn't open the private tab (cause it to continue key spam until it closed the connection and killed chrome and started again).
Logged quite a few errors but I can only keep adding debug logs until I hit it

Just gonna keep tweaking, will take gigajews suggestion on soon


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by BarretJan 5, 2017 10:29 AM 12 445 Jan 5, 2017 10:29 AM
Last Post: Barret
[.NET] by SIM-2362662Nov 10, 2015 11:48 AM 10 507 Nov 10, 2015 11:48 AM
Last Post: IAmNotHere
[C] by Exodus.Feb 22, 2015 03:03 PM 14 478 Feb 22, 2015 03:03 PM
Last Post: Exodus.