summaryrefslogtreecommitdiff
path: root/npc/woe-fe/agit_controller.txt
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-11-15 00:54:33 +0100
committerHaru <haru@dotalux.com>2015-11-15 00:57:00 +0100
commit34037c40d28c9fe179d930949320090448b249e9 (patch)
tree3fe4d79c6185df4f165beae47cc3e7a286ce5af8 /npc/woe-fe/agit_controller.txt
parent8ee5eafc741d581579efd696765fb0646b72a553 (diff)
downloadhercules-34037c40d28c9fe179d930949320090448b249e9.tar.gz
hercules-34037c40d28c9fe179d930949320090448b249e9.tar.bz2
hercules-34037c40d28c9fe179d930949320090448b249e9.tar.xz
hercules-34037c40d28c9fe179d930949320090448b249e9.zip
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 <haru@dotalux.com>
Diffstat (limited to 'npc/woe-fe/agit_controller.txt')
-rw-r--r--npc/woe-fe/agit_controller.txt16
1 files changed, 6 insertions, 10 deletions
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;