-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathexample.py
63 lines (53 loc) · 2.52 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python
'''
------------------------------------------------------------------------------------------------
Author: @Isaac
Last Updated: 22 Nov 2020
Contact: Message @Isaac at https://forum.c1games.com/
Copyright: CC0 - completely open to edit, share, etc
Short Description:
This is an example script to show some of the svr_lib.py functions.
------------------------------------------------------------------------------------------------
Just change algo_name to be a valid algo name and you can uncomment the functions you'd like to see.
'''
import svr_lib as svr
'''
You must put all of the code regarding the svr_lib module inside of "if __name__ == '__main__':"
since it uses the multiprocessing library.
'''
if __name__ == '__main__':
# change this name to be whatever algo you want
algo_name = 'iotaqq12'
'''
These are functions that are associated with the leaderboard metrics.
'''
# print (svr.get_leaderboard_metrics())
# print (svr.get_num_players())
# print (svr.get_num_matches())
# print (svr.get_num_algos())
'''
These are functions associated with getting algos from the leaderboard.
'''
# print (svr.get_leaderboard_algos(3))
# print (svr.get_leaderboard_ids(pages=[1,2,3], limit=1900))
# print (svr.get_leaderboard_ids(pages=1))
'''
These are functions associated with getting algo's ids.
You can either do this by searching through the leaderboard or all algos.
Searching through the leaderboard is much much faster so if you know it exists, you should enable it.
(verbose is just so you can see the functions run)
'''
# print (svr.search_for_id(algo_name, verbose=True)) # this is if the algo is NOT on the leaderboard
# print (svr.search_leaderboard_for_id(algo_name, verbose=True)) # this is if the algo IS on the leaderboard
'''
These are functions associated with getting an algo's match ids.
If the algo is not on the leaderboard, set that param to False (default is False).
(verbose is just so you can see the functions run)
'''
# print (svr.get_algos_matches(81065))
# print (svr.get_match_ids(algo_name, in_leaderboard=True))
'''
These are some basic string formatting functions to make it so you can copy and paste into a browser url.
'''
# print (svr.get_match_str(1656045))
# print (svr.get_matches_str(algo_name, in_leaderboard=True, verbose=False)) # algo_name could also just be an algo's id, if you know it