forked from Jimboom7/AlphaJong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
51 lines (40 loc) · 1.45 KB
/
build.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
#!/usr/bin/env python3
#-*-coding:utf-8-*-
import os
def addFileToString(inputString, filename):
inputString += "\n\n"
with open('src/' + filename, encoding="utf-8") as fp:
inputString += fp.read()
return inputString
VERSION = "1.3.2_beta"
data = f"""// ==UserScript==
// @name AlphaJong
// @namespace alphajong
// @version {VERSION}
// @description A Mahjong Soul Bot.
// @author Jimboom7
// @match https://mahjongsoul.game.yo-star.com/*
// @match https://majsoul.com/*
// @match https://game.maj-soul.com/*
// @match https://game.maj-soul.net/*
// @match https://majsoul.union-game.com/*
// @match https://game.mahjongsoul.com/*
// ==/UserScript==
"""
def main():
global data
if not os.path.exists("build"):
os.mkdir("build")
data = addFileToString(data, "parameters.js")
data = addFileToString(data, "gui.js")
data = addFileToString(data, "api.js")
data = addFileToString(data, "utils.js")
data = addFileToString(data, "logging.js")
data = addFileToString(data, "yaku.js")
data = addFileToString(data, "ai_offense.js")
data = addFileToString(data, "ai_defense.js")
data = addFileToString(data, "main.js")
with open ('build/AlphaJong_' + VERSION + '.user.js', 'w', encoding="utf-8") as fp:
fp.write(data)
if __name__ == "__main__":
main()