-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a31643
commit 5db51f9
Showing
12 changed files
with
175 additions
and
7 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# GTNH 赛博尼哥监控手机端 | ||
目前本APP专供GTNH,版本2.6.0,包括BoxPluxPlus和Twisted Space Technology。 | ||
当GTNH进入无聊的挂机大后期的时候,你是否曾有过这种想法? | ||
"啊,要是能用网页或者手机监控服务器里面干活的电子倪哥,看他们闲了就多下几单让他们干活". | ||
本APP将提供该能力。 | ||
使用该APP需要让服主在服务器安装mod. | ||
 | ||
在ME控制器放下该方块后,会在聊天栏发送你的访问密码。 | ||
 | ||
 | ||
APP启动界面,输入服务器地址(不带端口)和你的密码,可以点击测试连接来验证是否正确。 | ||
 | ||
点击获取所有AE网络,然后从下拉菜单中选取你刚才放下的监控器方块坐标(一般只有一个吧,谁会监控子网啊!),之后就可以点击保存设置。 | ||
 | ||
主网物品,左上角按钮为正序/倒序排序,排序按modid/数量/物品名称顺序,显示可合成/所有物品,功能和AE类似。 | ||
排序功能反应比较慢,因为主网物品太多了,可能需要在两个页面间切换来触发控件刷新,以后再想办法优化吧。 | ||
链接图标为绿代表和服务器通信成功,红色代表断开,点击该图标可以刷新网络访问。 | ||
可合成物品右下角有锤子标记,点进去就可以开始合成计划。 | ||
 | ||
合成CPU监控 | ||
 | ||
合成计划 | ||
 | ||
你可能会发现家里多了很多单元,这不是一个错误。因为GTNH NEI没有提供纹理导出的工具,所以流体只能用单元代替显示了。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import sqlite3 | ||
import csv | ||
import base64 | ||
con = sqlite3.connect('itempanel.db') | ||
cur = con.cursor() | ||
cur.execute(""" | ||
create table if not exists item_panel ( | ||
id integer primary key, | ||
item_name string, | ||
item_id string, | ||
item_meta string, | ||
has_nbt string, | ||
dname string, | ||
icon string | ||
); | ||
""") | ||
cur.execute("create index idx_item_name on item_panel(item_name);") | ||
cur.execute("create index idx_item_id on item_panel(item_id);") | ||
cur.execute("create index idx_item_dname on item_panel(dname);") | ||
cur.execute("create index idx_item_meta on item_panel(item_meta);") | ||
illegalchars = list(map(lambda x: chr(x), [34, 60, 62, 124, 0, 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, 58, 42, 63, 92, 47])) | ||
import os | ||
with open('itempanel.csv','r') as csvf: | ||
reader = csv.DictReader(csvf) | ||
data = [] | ||
i = 0 | ||
for row in reader: | ||
item_name = row['Item Name'] | ||
item_id = row['Item ID'] | ||
item_meta = row['Item meta'] | ||
has_nbt = row['Has NBT'] | ||
dname = row['Display Name'] | ||
fname = dname | ||
for ill in illegalchars: | ||
fname = fname.replace(ill, '_') | ||
path = f'itempanel_icons/{fname}.png' | ||
if not os.path.exists(path): | ||
path = f'itempanel_icons/_{fname}_.png' | ||
if os.path.exists(path): | ||
with open(path, 'rb') as icon: | ||
data.append({'id':i, 'item_name': item_name, 'item_id':item_id, 'item_meta':item_meta, 'has_nbt': has_nbt, 'dname': dname, 'icon': base64.b64encode(icon.read())}) | ||
else: | ||
print(f'file not found:{fname}') | ||
data.append({'id':i, 'item_name': item_name, 'item_id':item_id, 'item_meta':item_meta, 'has_nbt': has_nbt, 'dname': dname, 'icon': None}) | ||
i = i + 1 | ||
cur.executemany("insert into item_panel values(:id, :item_name, :item_id, :item_meta, :has_nbt, :dname, :icon)", data) | ||
print(data[0]) | ||
con.commit() | ||
cur.close() | ||
con.close() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import sqlite3 | ||
import os | ||
import csv | ||
import base64 | ||
|
||
illegalChars = [ 34, 60, 62, 124, 0, 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, 58, 42, 63, 92, 47 ] | ||
def replaceIllegalChars(s): | ||
for c in illegalChars: | ||
s = s.replace(chr(c), '_') | ||
return s | ||
|
||
os.remove("itempanel.db") | ||
db=sqlite3.connect("itempanel.db") | ||
cur = db.cursor() | ||
cur.execute(""" | ||
create table if not exists item_panel ( | ||
id integer primary key, | ||
item_name string, | ||
item_id string, | ||
item_meta string, | ||
has_nbt string, | ||
dname string, | ||
icon string | ||
); | ||
""") | ||
cur.execute( | ||
""" | ||
create table if not exists fluid_container ( | ||
id integer primary key, | ||
fluid_name string, | ||
item string, | ||
meta string, | ||
container_display_name string, | ||
amount integer); | ||
""") | ||
cur.execute("create index idx_item_name on item_panel(item_name)") | ||
cur.execute("create index idx_item_id on item_panel(item_id)") | ||
cur.execute("create index idx_item_meta on item_panel(item_meta)") | ||
|
||
with open("itempanel.csv") as csvf: | ||
reader = csv.DictReader(csvf) | ||
data = [] | ||
i = 0 | ||
for row in reader: | ||
d = {'id':i} | ||
dname = row['Display Name'] | ||
d['dname'] = dname | ||
d['item_name'] = row['Item Name'] | ||
d['item_id'] = row['Item ID'] | ||
d['item_meta'] = row['Item meta'] | ||
d['has_nbt'] = row['Has NBT'] | ||
filename = replaceIllegalChars(dname) + '.png' | ||
try: | ||
with open('itempanel_icons/' + filename, 'rb') as f: | ||
d['icon'] = base64.b64encode(f.read()) | ||
except: | ||
print(d) | ||
print(filename) | ||
i = i + 1 | ||
data.append(d) | ||
cur.executemany("insert into item_panel values(:id, :item_name, :item_id, :item_meta, :has_nbt, :dname, :icon)", data) | ||
db.commit() | ||
|
||
|
||
with open("fluidcontainer.csv") as csvf: | ||
reader = csv.DictReader(csvf) | ||
data = [] | ||
i = 0 | ||
f = {} | ||
for row in reader: | ||
d = {'id':i} | ||
c = row['Fluid'] | ||
if c not in f: | ||
f[c] = [row['Filled Container Display Name'], row['Amount'], row['Filled Container'][2:],row['Filled Container Item']] | ||
elif 'bartworks' in f[c][3] and '胶囊' in f[c][0]: | ||
print(f[c][0]) | ||
f[c] = [row['Filled Container Display Name'], row['Amount'], row['Filled Container'][2:],row['Filled Container Item']] | ||
for fluid in f.keys(): | ||
data.append({'id':i, 'fluid_name':fluid, 'item':f[fluid][3], 'meta':f[fluid][2].split("@")[1], 'dname':f[fluid][0], 'amount':f[fluid][1]}) | ||
i = i +1 | ||
cur.executemany("insert into fluid_container values(:id, :fluid_name, :item, :meta, :dname, :amount)", data) | ||
db.commit() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.