query_mapcell()
-def command_sender(string):
+def command_sender(string, int_field=None):
def command_send():
- io["file_out"].write(string + "\n")
+ int_string = ""
+ if int_field:
+ int_string = " " + str(world_data[int_field])
+ io["file_out"].write(string + int_string + "\n")
io["file_out"].flush()
return command_send
"path_worldstate": "server/worldstate"
}
commands = {
+ "A": (command_sender("ai"),),
+ "D": (command_sender("drop", "inventory_selection"),),
"P": (command_sender("pick_up"),),
"Q": (command_quit,),
+ "U": (command_sender("use", "inventory_selection"),),
"W": (command_sender("wait"),),
"c": (command_sender("move south-east"), command_looker("south-east")),
"d": (command_sender("move east"), command_looker("east")),