From: Mark Tearle Date: Sun, 24 Feb 2008 11:43:02 +0000 (+0000) Subject: add menacing "FEED ME!" X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=a4b49159270882af29e779b0410bdec336adcf71;p=zanchey%2Fdispense2.git add menacing "FEED ME!" --- 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