54 from CFTimeOfDay
import TimeOfDay
56 event = Crossfire.WhatIsEvent()
57 parameters = cjson.decode(event.Message)
58 alreadymatched = (event.Value!=0)
59 connected =
int(parameters[
"connected"])
60 inverse =
"inverse" in parameters
and parameters[
"inverse"] ==
True
62 if not "match" in parameters:
63 Crossfire.Log(Crossfire.LogError,
"Script push_period.py didn't get a 'match' parameter. Only got %s" %parameters)
64 elif parameters[
"match"].lower() ==
"one":
65 match=
TimeOfDay().matchAny(parameters[
"when"]) != inverse
66 elif parameters[
"match"].lower() ==
"all":
67 match=
TimeOfDay().matchAll(parameters[
"when"]) != inverse
69 Crossfire.Log(Crossfire.LogError,
"Script push_period.py didn't get a 'match' parameter. Only got %s" %parameters)
72 if (match & (
not alreadymatched)):
77 map.TriggerConnected(connected,1,Crossfire.WhoAmI())
79 if ( (
not match) & alreadymatched):
84 map.TriggerConnected(connected,0,Crossfire.WhoAmI())