From a4b49159270882af29e779b0410bdec336adcf71 Mon Sep 17 00:00:00 2001 From: Mark Tearle Date: Sun, 24 Feb 2008 11:43:02 +0000 Subject: [PATCH] add menacing "FEED ME!" --- sql-edition/servers/VendServer.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sql-edition/servers/VendServer.py b/sql-edition/servers/VendServer.py index 00e33b1..eff58e0 100755 --- a/sql-edition/servers/VendServer.py +++ b/sql-edition/servers/VendServer.py @@ -748,8 +748,24 @@ def handle_grandfather_tick(state, event, params, v, vstatus): vstatus.change_state(STATE_IDLE,1) def handle_door_idle(state, event, params, v, vstatus): + def twiddle(clock,v,wise = 2): + if (clock % 4 == 0): + v.display("-FEED ME-") + elif (clock % 4 == 1+wise): + v.display("\\FEED ME/") + elif (clock % 4 == 2): + v.display("-FEED ME-") + elif (clock % 4 == 3-wise): + v.display("/FEED ME\\") + # don't care right now. - pass + now = int(time()) + + if ((now % 60 % 2) == 0): + twiddle(now, v) + else: + twiddle(now, v, wise=0) + def handle_door_event(state, event, params, v, vstatus): if params == 0: #door open -- 2.20.1