X-Git-Url: https://plomlompom.com/repos//%22https:/validator.w3.org/check?a=blobdiff_plain;f=client_prototype.py;h=f5fc336791e5245518da7503a54d72f3610b6a76;hb=87a95c28348a0d8ee25aa4c2faac3aebb39674c0;hp=01bb74b4d78b712d8ae994eb77c2513ec7303ced;hpb=6777a44f123233f2e0ee45940265bdc4936d87bf;p=plomrogue diff --git a/client_prototype.py b/client_prototype.py index 01bb74b..f5fc336 100644 --- a/client_prototype.py +++ b/client_prototype.py @@ -447,9 +447,12 @@ def command_toggle_look_mode(): 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 @@ -513,8 +516,10 @@ io = { "path_worldstate": "server/worldstate" } commands = { + "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")),