Maxx53 / SCMBot

Steam Community Market auto-buying bot
http://scmbot.com
GNU General Public License v2.0
238 stars 116 forks source link

Host changing #202

Open Maxx53 opened 9 years ago

Maxx53 commented 9 years ago

Enhancement to prevent caching and "to much requests per second" error. Fist phase: viability of the method. Scan Newly Listed without delay (delay between requests and delay at Newly Listed tab must be "0"). http://scmbot.ru/uploads/scmbot_bin.rar

Attention: Put to "hosts.txt" your values, that have the best ping from your computer. Find steamcomunity hosts at http://startping.com/ping/steamcommunity.com/5430f3128c3dcff231dffb23

Host using you can track with: image Good luck!

Next phase: Multi-threading.

Denissio commented 9 years ago

Мужик, скажи, пожалуйста, нормальный способ покупки предметов с описанием... Копирование ссылки с фильтром не работает, бот покупает предмет не зависимо от его описания. Если указать ссылку во вкладке "Страница предмета", то там бот покупает правильно, только предметы с нужным описанием, а в новых поступлениях он покупает абсолютно все предметы с указанным именем.

xienxienzai commented 9 years ago

@Maxx53 min. rrt avg. rrt max. rrt which 1 is showing the best ping ?

l4m0r commented 9 years ago

unbenannt

Works good, no "too many requests" so far.

30% of the time "Move along" though.

With Multithreading and working parallel at the same time, it will be a cool feature for sure

Maxx53 commented 9 years ago

@l4m0r Now, when no "too many requests", we can simply skip "move along" without delay. @Denissio Так вкладка "новые поступления" и работает, сравниваем только по имени.

l4m0r commented 9 years ago

Used Quantity is far over 100 by now, still no too many requests, so it be worth a try to skip without delay :)

Maxx53 commented 9 years ago

@xienxienzai Do not look at ping values on this page. You must ping every host address by yourself, from your computer. For example, using cmd.exe + ping.

kitzik commented 9 years ago

hosts.txt используется постоянно, да? Вне зависимости от, есть окно с хостами или нет. Тогда пункт меню будет правильно называться "Host usage status". А так вообще, крутая идея с разными хостами!

UgaBugaBoo commented 9 years ago

@Maxx53 Hats off to you man :) Will surely make some donation when I get back to my country :+1:

EDIT: Can you please describe what is the work of this host ? (ignore if this question is too lame to answer :3)

kitzik commented 9 years ago

bot posts every next request to different steam server from the list, unlike the common situation when bot posts request only to one server causing request flood

Maxx53 commented 9 years ago

@UgaBugaBoo Oh, yes, thanks for donation! @kitzik Post sends very rare, so no flood in this situation. Added multi-threading version.

berberitos commented 9 years ago

i tried running 0 delay with 10 servers on the hosts list, i still get "move along" pretty often. should i try to run it with few more servers or are the random "move alongs" unavoidable?

Maxx53 commented 9 years ago

@berberitos yes, just don't pay attention.

l4m0r commented 9 years ago

@Maxx53: Tried out multi-threading version, doesn't seem to work yet, sending out no request at all.

Nothing starts to happen in log and host status when starting to scan.

Maxx53 commented 9 years ago

@l4m0r check your values image

l4m0r commented 9 years ago

@Maxx53: Yeah, they are correct, unless delay is required (did put 0 there).

/edit: It was problem with "stop selected, start selected. When using button it works (for 1 item).

/edit2: First impression:

xienxienzai commented 9 years ago

@Maxx53 can i have the multi threading version download link?

l4m0r commented 9 years ago

@xienxienzai: Link is in the 1st post

berberitos commented 9 years ago

@xienxienzai just download the latest binary files

Maxx53 commented 9 years ago

No guys, send me donations and i'll give you "ultimate mega multi thread deluxe platinum director's cut version". XD

Maxx53 commented 9 years ago

Binary updated, now you can see ping at status form: image So, normal ping is <100

kitzik commented 9 years ago

@kitzik Post sends very rare, so no flood in this situation.

Yeah, I know. It was an answer to @UgaBugaBoo question :)

xienxienzai commented 9 years ago

@Maxx53 i found that still got alot items missing in newly listed page..because when i post something from other account..the bot cannot detect it

berberitos commented 9 years ago

I tried running with the following settings:

servers on the hosts list: 10 simultaneous requests limit: 10 number of threads: 5 delay between requests: 0 delay on newly listed: 350

I tried using 333 on the delay between requests and 0 on newly listed tab, but it seems much slower like that compared to what I posted above. I wonder if its risky though?

xienxienzai commented 9 years ago

@Maxx53 what will happen if simultaneously request i put 100 ?

l4m0r commented 9 years ago

Am I the only one with problems? At first it works well, after 5 minutes I get only "move along" and it stops working.

Settings: simultaneous requests limit: 10 number of threads: 4 delay between requests: 0 delay on newly listed: 0

Maxx53 commented 9 years ago

@l4m0r wow, nice, that's what i call real test. keep it up! But, what if you stop scan for 1 second and re-start it? Maybe we should delay after getting "move along" thing?

l4m0r commented 9 years ago

@Maxx53: Still same... need to to restart to fix it. Also I get too many requests as well now.

Wild guess, without knowing your code too good: Getting new JSONs works sometimes faster old ones were searched/checked and then it starts to loop in "move along"?

berberitos commented 9 years ago

for me the new bot seems to work fine at start, but it has slowed down a lot after running it for few hours. it might be that the servers themselves are slow at this time of the day. I have been running delay on both at 0, no problems with only getting move alongs here. sometimes I get a big burst of move along for like 5 seconds but it starts working normally after that.

@l4m0r edit: I tried restarting the bot and it fixed it being slow, so yeah i can confirm something happens with the bot after you run it for a long period of time. for me it doesnt stop working completely, instead it slows down a lot

l4m0r commented 9 years ago

@berberitos: Thanks for the input. With added delay (doesnt matter if between requests or on newly) it seems to be better as well. But why? When I use old version (without hosts) I can run 0 ms delay too without isses.

Maxx53 commented 9 years ago

Not sure, it can be large number of open connections, try set to 100: https://github.com/Maxx53/SCMBot/blob/master/scr/SCMBot/Main.cs#L85

UgaBugaBoo commented 9 years ago

"No guys, send me donations and i'll give you "ultimate mega multi thread deluxe platinum director's cut version". XD"

Sure I am in :D @Maxx53

l4m0r commented 9 years ago

@Maxx53: It was indeed something with the connection, worked well on other server.

After trying whole night with several items, I have found: Either several threads see the item or all miss them.

Selling a lot of items by myself as test showed: Almost 50% of the items miss /recently/ completely and were not bought by other bots too.

=> Result: Multithreads + Multihost doesn't solve cache problem, only allows more requests to be sent (bigger chances to buy item). Still good, but not a full solution :(

linuxuserpro commented 9 years ago

@Maxx53 does this host changing even work? Cos you cant connect to the server just by using the ip address... You can try this on your browser, by replacing steamcommunity.com by one of the ip addresses listed on startping.com. You will get some error message (http status code 400)

Am i missing out something?

l4m0r commented 9 years ago

Yes you are missing out. Browser URL != get.request in C#

linuxuserpro commented 9 years ago

whats the diff? typing the url on browser is basically a get request as well...

EDIT: it gives Invalid URL. you can try using the ip 23.205.195.148 EDIT2: heck it. i figured out the issue...

l4m0r commented 9 years ago

You have different set parameter in your request header cause of browser/cookie that you cant influence and webserver wont accept this I think. Maybe Max can explain better.

Maxx53 commented 9 years ago

@linuxuserpro if you specify host-header as steamcommunity.com, your request will succeed.

linuxuserpro commented 9 years ago

@Maxx53 yep i figured it out. thanks for replying though :) I forgot my basics :p

berberitos commented 9 years ago

@l4m0r how long have you had this problem of not being able to buy items? for me it started early september, before that I used to be able to buy hard to get csgo items daily. now im only able to buy those same items once every 3 or 4 days. i thought this new version of the bot would help me buy again, havent gotten anything so far atleast. i dont know whats causing it but there is a clear difference compared to how i used to be able to buy.

l4m0r commented 9 years ago

The problem is not "not buying items", the problem is not seeing them.

Not buying depends on bad network or too much/more competetion. Competition will always get bigger, it's a logical thing to happen.

berberitos commented 9 years ago

yeah well i meant the combination of both, not seeing items -> not being able to buy. how long have you had this problem for?

linuxuserpro commented 9 years ago

@Maxx53 btw wouldn't it be better for steam to dictate which server your request gets routed to instead? I believe they route based on server loads

linuxuserpro commented 9 years ago

@berberitos i think the problem is that steam servers are getting slower and slower

Maxx53 commented 9 years ago

@linuxuserpro it is. But, main thing why we started all this - forbidden 403 error. Steam often routes all requests to one host.

puteen commented 9 years ago

default ничего не находит, хотя в браузере предметы проскакивают, что я делаю не так ?

xienxienzai commented 9 years ago

@Maxx53 possible to remove -move along - in log ?it takes so much of space..thanks ! :)

iDeception commented 9 years ago

Guys, do you use html or json scan?

Maxx53 commented 9 years ago

@xienxienzai sure, remove this string: https://github.com/Maxx53/SCMBot/blob/master/scr/SCMBot/SteamSite.cs#L618

xienxienzai commented 9 years ago

@Maxx53 possible to add the item name beside the price ? like 1200 : Not Found 1201: Not Found 1202: $0.80 (counter strike case)

l4m0r commented 9 years ago

Just a general question for you @Maxx53 :

1) What would you suggest is the best usage of the "new" implementation? How many threads would be needed to work with ~6 servers smoothly (too many threads would cause some kind of overhead/delay I suppoe), and not many threads enough would result in missing jsons/info.

Any suggestion, since you are the one who wrote the actual code?

2) More information about the setting "Simultaneously requests limit" would be appreciated, too. What exactly does it do?

3) Are the Host IPs only used to get the data from /recent/ or also for the buyrequest and login?