Add state machine for caching items into chests

This commit is contained in:
2020-09-20 19:08:23 -06:00
parent b8cbd9a5f0
commit f8d44e7e38
12 changed files with 326 additions and 59 deletions

9
bot.py
View File

@@ -10,6 +10,7 @@ from math import floor, ceil
USERNAME = os.environ['USERNAME']
PASSWORD = os.environ['PASSWORD']
SERVER = os.environ['SERVER']
PORT = int(os.environ.get('PORT', 25565))
import monkey_patch # must be before any possible pyCraft imports
@@ -154,7 +155,9 @@ def init(global_state):
g.break_time = 0
g.dumping = None
g.dump_lock = False
g.item_lock = False
g.window = None
g.job = jobs.JobStates(g)
@@ -172,7 +175,7 @@ def bot(global_state):
print(e)
sys.exit()
print("Logged in as %s..." % auth_token.username)
g.connection = Connection(SERVER, 25565, auth_token=auth_token)
g.connection = Connection(SERVER, PORT, auth_token=auth_token)
g.chunks = ChunksManager(g.mcdata)
@@ -198,8 +201,6 @@ def bot(global_state):
init(g)
print('Initialized.')
print(blocks.mcd.windows)
while g.running:
tick(g)