Add state machine for caching items into chests
This commit is contained in:
9
bot.py
9
bot.py
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user