From 65a4820a90799dfd52f64e95e1ac226953e2cbbc Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 24 Aug 2015 03:36:45 +0200 Subject: autorejoin --- main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.py b/main.py index c8cc341..d13c4ea 100644 --- a/main.py +++ b/main.py @@ -48,6 +48,8 @@ gui.set_client(c) # initialize strategy strategy = Strategy(c) +autorespawn_counter = 60 + # main loop while True: c.on_message() @@ -63,3 +65,10 @@ while True: stats.log_pos(c.player.center) stats.log_mass(c.player.total_mass) gui.update() + + if not c.player.is_alive: + if autorespawn_counter == 0: + c.send_respawn() + autorespawn_counter = 60 + else: + autorespawn_counter-=1 -- cgit v1.2.3