• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 19:01
CEST 01:01
KST 08:01
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL19] Finals Recap: Standing Tall10HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Firefly given lifetime ban by ESIC following match-fixing investigation5$25,000 Streamerzone StarCraft Pro Series announced3Weekly Cups (June 30 - July 6): Classic Doubles5[BSL20] Non-Korean Championship 4x BSL + 4x China9Flash Announces Hiatus From ASL66
StarCraft 2
General
The SCII GOAT: A statistical Evaluation The GOAT ranking of GOAT rankings Firefly given lifetime ban by ESIC following match-fixing investigation Weekly Cups (June 30 - July 6): Classic Doubles Jim claims he and Firefly were involved in match-fixing
Tourneys
$25,000 Streamerzone StarCraft Pro Series announced FEL Cracov 2025 (July 27) - $8000 live event Sparkling Tuna Cup - Weekly Open Tournament RSL: Revival, a new crowdfunded tournament series WardiTV Mondays
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma
Brood War
General
i aint gon lie to u bruh... ASL20 Preliminary Maps BGH Auto Balance -> http://bghmmr.eu/ [ASL19] Finals Recap: Standing Tall SC uni coach streams logging into betting site
Tourneys
[BSL20] Non-Korean Championship 4x BSL + 4x China [BSL20] Grand Finals - Sunday 20:00 CET CSL Xiamen International Invitational The Casual Games of the Week Thread
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile What do you want from future RTS games? Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Stop Killing Games - European Citizens Initiative Summer Games Done Quick 2025! Summer Games Done Quick 2024!
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
momentary artworks from des…
tankgirl
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 654 users

Release of sc2bot, sc2ranks to IRC Eggdrop script

Forum Index > SC2 General
Post a Reply
1 2 3 Next All
ThArGos
Profile Joined October 2010
France37 Posts
Last Edited: 2011-06-28 15:55:46
March 11 2011 16:42 GMT
#1
Current version 0.5.266
New -url command:
!sc2 -url bnetid
!sc2 -url knownplayer
Updated -stats command (username not needed anymore if bnet_id is provided):
!sc2 -stats us 2768741 1

Changelog (v0.4.227 to v0.5.262):
- Removed username from search with bnetid and server (#9).
- Default help displayed in query rather than notices. Enhanced cache. (#3)
- Added division rank and progression (#7).
- Added a -url command (#2).
- Fixed grandmaster display.
- Fixed a bunch of bugs.
- DIVISION SWITCH PREDICTION HAS BEEN REMOVED see http://www.teamliquid.net/forum/viewmessage.php?topic_id=200420&currentpage=2#33
-------------------------------------- OP -------------------------------------------------------
Dear TL members,

I'm glad to share with you what I guess is the first GPLed eggdrop
script giving access to the sc2ranks.com database.

This script gives you the ability to query stats directly from your
irc client.

You can find the script at:
https://bitbucket.org/ThArGos/sc2bot/overview

Eggdrop owners enable the script directly from the party line with:
.chanset #my_great_chan +sc2ranks_search

Then users of the #my_great_chan will be able to type the following set of commands:
!sc2 -stats server user [bnetid|character code] [1-4](bracket)
!sc2 -stats knownuser [1-4](bracket)
!sc2 -version
!sc2 -list [1-4](bracket)
!sc2 -find [exact|contains|starts|ends] server name [offset]

Example:
You want to retrieve the 1v1 stats of "control" from the EU server. Type:
!sc2 -stats eu control 657035 1
> control (master terran): 1092/916 0.54 +1093W +917L (Bonus 11/3010 MMR 3296) (2011-03-11 15:42:33)

Returned informations are:
name
league + fav race
wins/losses
ratio
progession since last sc2ranks.com update. The script is able to keep a track of what happens thanks to its cache system.
Bonus pool/Server Max Bonus Pool
MMR (and the division switch prediction when available)
Date and time of the last sc2ranks.com update.

The script will keep a list of known players. Every queried player will become a known player for the bot.
You can retrieve a known player stats with a simpler command:
!sc2 -stats control 1

You can list the players the bot knows (this is bracket related). For instance, to obtained the list of known 1v1 players type:
!sc2 -list 1

[image loading]

The list shows the player name, her battle.net id and her character code if available (else 0)

[image loading]

The script has a find command:
!sc2 -find exact eu control

[image loading]

[image loading]

This will return the list of players named "control" on the eu server with their battle.net id.
Only returns the first 10 names, but you can see the total number of characters and pass an offset if you need more. Search is case-insensitive.

[image loading]

[image loading]

Finally the script has a simple implementation of the division switch prediction (http://sc2mmr.blogspot.com/). This may improve with time.
You will get a message like this:
(Bonus 1774/3010 MMR 1249. Estimated switching in 5 games)

You can customise the command names and which method the bot should use to display the results (notices, chan message…).

Short options are available:
!sc2 -stats eu control 657035 1
is equivalent to
!s -s eu control 657035 1

[image loading]
[image loading]

A lot of effort has been put on the cache system in order not to flood
sc2ranks.com. By default the script will have a cache of 2 hours for
each record. Bear in mind that sc2ranks.com has a 3 hours cache for
1v1 for instance. So we don't need to have a lower cache.

This is a very first release. Things are missing. MMR and division switch are computed only for 1v1.
Cool things are planned like week rolling stats or month rolling stats.

I would like to thanks sc2ranks.com, Michael from http://sc2mmr.blogspot.com/ and RMS.

Critics, comments, insults are welcomed.
CPTHammer.464
Profile Joined December 2010
United States37 Posts
March 12 2011 16:36 GMT
#2
This is fantastic! Will this work on justin.tv as well?
KevinIX
Profile Joined October 2009
United States2472 Posts
March 12 2011 16:40 GMT
#3
ooh. Interesting. Interesting.
Liquid FIGHTING!!!
ThArGos
Profile Joined October 2010
France37 Posts
March 13 2011 08:14 GMT
#4
On March 13 2011 01:36 CPTHammer.464 wrote:
This is fantastic! Will this work on justin.tv as well?

Thanks.

I tried to setup a bot for irc.justin.tv and I managed to make it connect to the server and join a channel. So I guess it will work. I'll soon try to setup a test channel to let people see the bot in action.

So far I couldn't see if the irc of justin is the same chat we see on the streaming pages. I guess it's sometime the case depending on the streamer's settings but I don't know much justin because I've just setup an account in order to test all this.
If the chat displayed on the streamer's web page is the content of an irc channel, I guess people could ask the bot directly from the web page too.

Wegandi
Profile Joined March 2011
United States2455 Posts
Last Edited: 2011-03-13 08:42:22
March 13 2011 08:41 GMT
#5
I am a complete illiterate when it comes to computer programming, so can you give a brief synopsis on how someone like me can use this without spending hours learning the ins and outs of this? In other words, hold my hand and give me a step by step process :p (Would be appreciated -- thanks!).
Thank you bureaucrats for all your hard work, your commitment to public service and public good is essential to the lives of so many. Also, for Pete's sake can we please get some gun control already, no need for hand guns and assault rifles for the public
Wegandi
Profile Joined March 2011
United States2455 Posts
March 13 2011 18:24 GMT
#6
Bump for answers
Thank you bureaucrats for all your hard work, your commitment to public service and public good is essential to the lives of so many. Also, for Pete's sake can we please get some gun control already, no need for hand guns and assault rifles for the public
Stryk
Profile Joined January 2011
United States22 Posts
March 13 2011 21:10 GMT
#7
Awesome bot, is there an !SC2 help or similar command? On EFnet we run a pretty populated sc2 channel and it would help if the bot could notice users the commands
Wegandi
Profile Joined March 2011
United States2455 Posts
March 14 2011 03:34 GMT
#8
Bump again for answers :p
Thank you bureaucrats for all your hard work, your commitment to public service and public good is essential to the lives of so many. Also, for Pete's sake can we please get some gun control already, no need for hand guns and assault rifles for the public
GjRud
Profile Joined March 2011
Italy2 Posts
March 14 2011 04:08 GMT
#9
On March 12 2011 01:42 ThArGos wrote:
Returned informations are:
name
league + fav race
wins/losses
ratio
progession since last sc2ranks.com update. The script is able to keep a track of what happens thanks to its cache system.
Bonus pool/Server Max Bonus Pool
MMR (and the division switch prediction when available)
Date and time of the last sc2ranks.com update.

how does this script find your MMR?
I was sure that none know how to find this value.
I apologize for my english.
ThArGos
Profile Joined October 2010
France37 Posts
March 14 2011 12:51 GMT
#10
Hi,

On March 13 2011 17:41 Wegandi wrote:
I am a complete illiterate when it comes to computer programming, so can you give a brief synopsis on how someone like me can use this without spending hours learning the ins and outs of this? In other words, hold my hand and give me a step by step process :p (Would be appreciated -- thanks!).


Setting up an eggdrop requires some understanding and some underlying operating system setup. Typically you will need a shell access to a Unix server (see http://www.egghelp.org/whatis.htm ). There are bots for windows too (Windrop for instance) but I don't know them at all.
I guess the simplest way for you is that someone sets up a bot on your irc server and makes it possible to invite it to channels. Then you invite the bot to your specific channel.
I'm pretty sure there are already some bots present on the irc server you are connected to. Maybe you can try to reach a bot owner and ask her to include the sc2bot module.

On March 14 2011 06:10 Stryk wrote:
Awesome bot, is there an !SC2 help or similar command? On EFnet we run a pretty populated sc2 channel and it would help if the bot could notice users the commands


Thanks. To have some help you can type !sc2 help. The bot will send the usage to the user with the "notice" protocol. In fact everytime a user types a missformated command the bot will send her the usage. I will add a !sc2 -help option. You are right it is kind of missing. Thanks for the feedback =)

On March 14 2011 13:08 GjRud wrote:
how does this script find your MMR?
I was sure that none know how to find this value.
I apologize for my english.


The bot is using the http://sc2mmr.blogspot.com/ MMR algorithm discovered by Michael.
The displayed MMR is the hidden MMR.
Some fine tuning needs to be done but it should be quite the good result.
About the switch prediction, it is a very early work and may not be that precise. Remember that if you are too close to division switch the algorithm may end up predicting things poorly. A lot of simplification has been done and it needs to be reworked a bit in order to fully reproduce the computations explained by Michael. For instance the division switch computation is using average wins/losses points values at the moment (24 and 11). In the future it may be able to compute these values from you actual average points. This introduces some little delta in the result. There are some missing information about the inactivity effect on the division switch too.

Well to sum things up. The MMR computation is quite accurate and is the same as explained on Michael's blog. The division switch is not very accurate and is the implementation of the simple computation explained on Michael's blog. Yet, it gives you an idea of your ability to switch division.

I strongly suggest to read Michael's blog if you are interested in these computations.

Cheers!
annul
Profile Blog Joined June 2010
United States2841 Posts
March 14 2011 14:11 GMT
#11
have you brought this bot onto quakenet?
ThArGos
Profile Joined October 2010
France37 Posts
March 14 2011 17:40 GMT
#12
I have quickly set up a testbot and made it join #akundo on quakenet.
That way you will be able to see it in action.

But I have to say that It doesn't run on a stable server and may be disconnected though. I have limited resources and won't be able to become an eggdrop provider (and it is not the purpose of the initial post)

Anyway, I hope you like it

Stryk
Profile Joined January 2011
United States22 Posts
March 15 2011 04:39 GMT
#13
I love it so far. Be careful of spam with notice... a lot of servers have limits and if multiple people queue commands the bot could get backed up. For example if your list contains more than several hundred people, will it notice a line for all of them?
TehForce
Profile Joined July 2010
1072 Posts
March 15 2011 05:39 GMT
#14
you should exclude the mmr calculation from your program because it is completly false! http://sc2mmr.blogspot.com/ contains mostly unproven assumptions and informations proven wrong. For a better understanding of the ladder see this thread: http://www.teamliquid.net/forum/viewmessage.php?topic_id=195273
NesTea <3
ThArGos
Profile Joined October 2010
France37 Posts
March 15 2011 09:33 GMT
#15
Thank you guys for the constructive feedback!

On March 15 2011 13:39 Stryk wrote:
I love it so far. Be careful of spam with notice... a lot of servers have limits and if multiple people queue commands the bot could get backed up. For example if your list contains more than several hundred people, will it notice a line for all of them?


I haven't thought about this! Thanks.
I will try to change this. For instance I will change the default behaviour to send private messages rather than notices. Sort the list alphabetically and give the ability to ask for names starting with a specific letter.
Thanks for pointing this out.

On March 15 2011 14:39 TehForce wrote:
you should exclude the mmr calculation from your program because it is completly false! http://sc2mmr.blogspot.com/ contains mostly unproven assumptions and informations proven wrong. For a better understanding of the ladder see this thread: http://www.teamliquid.net/forum/viewmessage.php?topic_id=195273


Thanks a lot about this. I wasn't aware of that thread. I will read and try to understand it. I will then fix the MMR calculation.

Again thanks for the feedback. I'll keep you in touch about the bot upgrades.
ThArGos
Profile Joined October 2010
France37 Posts
March 24 2011 17:27 GMT
#16
I updated the bot according to the patch 1.3:

Removed losses and losses differential for non masters.
Removed MMR computation and division switch prediction.
Added a direct url back to the sc2ranks.com page for every player displayed by the -list command.

Fixed some stuff

Players who are not in master league will only see their number of wins and how many wins they obtained since the last sc2rank update. Master players will see wins/losses, ratio and +W +L since last update like it was before.

The bot running on Quakenet #akundo is running the latest version of the script if you want to test.
i.of.the.storm
Profile Joined April 2009
United States795 Posts
Last Edited: 2011-04-03 07:34:27
April 03 2011 07:10 GMT
#17
Hey, I just tried to set this up on my server, I got this message:

[00:06:06] Sc2ranks : You need the json package to run this script.


Any ideas? I've had a lot of trouble with eggdrop bots for some reason, even though they seem straightforward enough to me. I can't run any commands.

Edit: D'oh, installed tcllib. Still not getting it to respond to commands, but that message went away.

Edit: So do I always need to run the .chanset command manually? I tried setting it up like

channel add #mychan{
+sc2ranks_search
}
in the bot's config file, but apparently that doesn't actually make it work. Doing .chanset worked, but now I can't actually get stats for anyone. I see this error:

[00:32:18] Tcl error [::sc2ranks::sc2ranks_command]: couldn't open socket: host is unreachable (Name or service not known)


Great stuff in any case, this should make it easier for my student group to keep track of people's accounts.
Maru - The Terran hope is alive!
ThArGos
Profile Joined October 2010
France37 Posts
Last Edited: 2011-04-07 08:53:42
April 07 2011 08:52 GMT
#18
Hi!

Great, I see you managed to install json via the tcllib. That was the right thing to do.

About the .chanset command. I usually type it manually but there must be a way to configure it right through the configuration file. I'll have a look at this and come back here to tell.

About the host is unreachable.
This is strange. It seems the bot cannot access either the battle.net web page of the player or the json script from sc2ranks

You can turn on debug informations with the following command:
!sc2debug [0-9]
Where 0 to 9 is the verbosity level.
9 is very very verbose. It will print the debug informations in the channel. Maybe you should join a debug channel with the bot.

Hope that helps.
i.of.the.storm
Profile Joined April 2009
United States795 Posts
Last Edited: 2011-04-09 07:25:08
April 09 2011 07:23 GMT
#19
Hmm, I did verbosity 9 but all it tells me is (12:22:47 AM) SC2ranks: DEBUG Searching for iofthestorm using type exact. I can definitely browse sc2ranks and battle.net via lynx (remote server).

Will investigate more when I have time.
Maru - The Terran hope is alive!
ThArGos
Profile Joined October 2010
France37 Posts
April 12 2011 08:12 GMT
#20
Sure.
According to what you pasted the bot is calling the following function.
In this function we can see the bot is trying to access the following address:
http://sc2ranks.com/api/search/$type/$server/$name/$offset.json?appKey=sc2bot

In order to test you can try the following command:
wget -O result.txt http://sc2ranks.com/api/search/exact/us/iofthestorm/0.json?appKey=sc2bot

Then open the result.txt file. There should be the following content:
{"characters":[{"bnet_id"26032,"name":"iofthestorm"}],"total":1}

If not, you have a problem accessing sc2ranks from your machine.
If yes, you have a problem accessing sc2ranks from the bot with the ::http::geturl tcl command.

Keep me in touch.
1 2 3 Next All
Please log in or register to reply.
Live Events Refresh
Next event in 59m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
JuggernautJason118
UpATreeSC 101
CosmosSc2 38
StarCraft: Brood War
Artosis 684
Counter-Strike
fl0m1841
Fnx 1828
Stewie2K923
taco 802
sgares93
Super Smash Bros
AZ_Axe122
Liquid`Ken45
Heroes of the Storm
Liquid`Hasu474
Other Games
Grubby2674
C9.Mang0523
Maynarde213
ViBE141
Organizations
Other Games
gamesdonequick50076
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• davetesta49
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Diggity8
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota22334
League of Legends
• Jankos2367
Other Games
• imaqtpie2009
Upcoming Events
PiGosaur Monday
59m
The PondCast
10h 59m
uThermal 2v2 Circuit
16h 59m
WardiTV European League
16h 59m
Jumy vs NightPhoenix
Percival vs Nicoract
ArT vs HiGhDrA
MaxPax vs Harstem
Scarlett vs Shameless
SKillous vs uThermal
Replay Cast
1d
RSL Revival
1d 10h
ByuN vs SHIN
Clem vs Reynor
OSC
1d 13h
Replay Cast
2 days
RSL Revival
2 days
Classic vs Cure
FEL
2 days
[ Show More ]
OSC
2 days
RSL Revival
3 days
FEL
3 days
FEL
3 days
CSO Cup
3 days
BSL20 Non-Korean Champi…
3 days
Bonyth vs QiaoGege
Dewalt vs Fengzi
Hawk vs Zhanhun
Sziky vs Mihu
Mihu vs QiaoGege
Zhanhun vs Sziky
Fengzi vs Hawk
Sparkling Tuna Cup
4 days
RSL Revival
4 days
FEL
4 days
BSL20 Non-Korean Champi…
4 days
Bonyth vs Dewalt
QiaoGege vs Dewalt
Hawk vs Bonyth
Sziky vs Fengzi
Mihu vs Zhanhun
QiaoGege vs Zhanhun
Fengzi vs Mihu
Replay Cast
6 days
Liquipedia Results

Completed

BSL Season 20
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
CSL Xiamen Invitational
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.