From 34037c40d28c9fe179d930949320090448b249e9 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 15 Nov 2015 00:54:33 +0100 Subject: Fixed too-generic constant names of gettime() types - Follow-up to 3bd77ffc0daca508352834add828766490075aee - The names were too generic (not namespaced), and were easily clashing with custom (and potential future official) constants or variables. - Constants are now prefixed with a 'GETTIME_' namespace: - GETTIME_SECOND - GETTIME_MINUTE - GETTIME_HOUR - GETTIME_WEEKDAY - GETTIME_DAYOFMONTH - GETTIME_MONTH - GETTIME_YEAR - GETTIME_DAYOFYEAR - Fixed some excessive (and some times incorrect) parentheses in various scripts using gettime(). - Updated documentation. Signed-off-by: Haru --- npc/woe-fe/agit_controller.txt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'npc/woe-fe') diff --git a/npc/woe-fe/agit_controller.txt b/npc/woe-fe/agit_controller.txt index 8d038c322..3644ad67b 100644 --- a/npc/woe-fe/agit_controller.txt +++ b/npc/woe-fe/agit_controller.txt @@ -7,10 +7,6 @@ //= 2.0a //===== Description: ========================================= //= Auto Start for War of Emperium -//============================================= -//= gettime(3): Gets hour (24 hour time) -//= gettime(4): Gets day of week 1=Monday, 2=Tuesday, -//= 3=Wednesday, 4=Thursday, etc. //===== Additional Comments: ================================= //= v1.1a changed OnInit to OnAgitInit.[kobra_k88] //= v1.2 added gettime checks. removed $AgitStarted var.[kobra_k88] @@ -44,9 +40,9 @@ OnClock1800: //end time for Sat(6) OnAgitInit: // starting time checks - if((gettime(4)==2) && (gettime(3)>=21 && gettime(3)<23) || - (gettime(4)==4) && (gettime(3)>=21 && gettime(3)<23) || - (gettime(4)==6) && (gettime(3)>=16 && gettime(3)<18)) { + if((gettime(GETTIME_WEEKDAY) == TUESDAY && gettime(GETTIME_HOUR) >= 21 && gettime(GETTIME_HOUR) < 23) || + (gettime(GETTIME_WEEKDAY) == THURSDAY && gettime(GETTIME_HOUR) >= 21 && gettime(GETTIME_HOUR) < 23) || + (gettime(GETTIME_WEEKDAY) == SATURDAY && gettime(GETTIME_HOUR) >= 16 && gettime(GETTIME_HOUR) < 18)) { if (!agitcheck()) { agitstart; callsub S_DisplayOwners; @@ -55,9 +51,9 @@ OnAgitInit: } // end time checks - if ((gettime(4)==2) && (gettime(3)==23) || - (gettime(4)==4) && (gettime(3)==23) || - (gettime(4)==6) && (gettime(3)==18)) { + if ((gettime(GETTIME_WEEKDAY) == 2 && gettime(GETTIME_HOUR) == 23) || + (gettime(GETTIME_WEEKDAY) == 4 && gettime(GETTIME_HOUR) == 23) || + (gettime(GETTIME_WEEKDAY) == 6 && gettime(GETTIME_HOUR) == 18)) { if (agitcheck()) { agitend; callsub S_DisplayOwners; -- cgit v1.2.3-70-g09d2