Events NPC

Zordon

Golden Oldie
Golden Oldie
Apr 26, 2008
1,176
20
145
Manchester, UK
Ok, I'm thinking of making an events npc to generate events on a specific map.

What i want to do, is notify people of the event starting, and 60 seconds later notify that the event has started and then load the specific .GEN file. - I have this bit sorted so far.

What I want to know, would say something like this work? Or is the timeframe too long? What is the maximum time frame you can set in a delaygoto?
Code:
delaygoto [local] 84600

If that isn't possible, is there another way of doing it? Maybe with a timecall or something? But how would I set that for say in 24 or 48 hours or even maybe 1-2 weeks time, the event stops and the .GEN file that was loaded is unloaded so to speak?

Next, how would I force everyone to leave the event map once the event is finished? I know a checkhum command checks for any humans on the map, but how do I get it to teleport everyone there out?
 

chimera

LOMCN VIP
VIP
Jul 30, 2003
1,054
23
235
UK
Ok well that's many questions, a time delay won't work because if the server goes down or you reboot the timer will end, the only way i can see you doing this is to do a check dayofweek script and an hour, possibly minute, write it to a table in sql and then check that day, hour, minute on a regular basis as part of the default00 scripts. as for booting them out of it, why bother, if you clear the map of mobs and stop the spawning they will leave of own accord. but you could do a map ping, moves all on a map to a specific location, like i said though why bother. :)
 
Upvote 0

Zordon

Golden Oldie
Golden Oldie
Apr 26, 2008
1,176
20
145
Manchester, UK
Ok well that's many questions, a time delay won't work because if the server goes down or you reboot the timer will end, the only way i can see you doing this is to do a check dayofweek script and an hour, possibly minute, write it to a table in sql and then check that day, hour, minute on a regular basis as part of the default00 scripts. as for booting them out of it, why bother, if you clear the map of mobs and stop the spawning they will leave of own accord. but you could do a map ping, moves all on a map to a specific location, like i said though why bother. :)

1: Ok how would I get it to write to a table in SQL?

2: Why bother? Because I wanna run events for xmas/easter etc and have them start either auto and end auto, or be gm initiated and auto stop at a set time after. Not sure which way to do it though, was thinking maybe just update the script as/when required but a lot of work that way.

Any way of setting it to check for dates? Like say get it to run a script at say 12.00am on 13th December?
 
Upvote 0

chimera

LOMCN VIP
VIP
Jul 30, 2003
1,054
23
235
UK
no way to check dates that i know of.

i meant why bother about booting people out of map if you take away whole reason to be there they will leave of own accord :)

[@whatever]
#ACT
ReadValueSqlsys "TBL_personal" "FLD_daystartevent" "FLD_hourstartevent" [@whatever2]
#ELSEACT
break



[@whatever2()]
#ACT
mov a1 %arg(1)
goto @whatever3



================================
#ACT
mov A5 MON
FormatStr "FLD_daystartevent='%s'" %A5
MOV A6 %A9
UpdateValueSql "TBL_personal" %A6


hope you get the idea from that of the possibilities by setting up your own tables in sql :)
 
Upvote 0

Zordon

Golden Oldie
Golden Oldie
Apr 26, 2008
1,176
20
145
Manchester, UK
no way to check dates that i know of.

i meant why bother about booting people out of map if you take away whole reason to be there they will leave of own accord :)

[@whatever]
#ACT
ReadValueSqlsys "TBL_personal" "FLD_monthstartevent" "FLD_daystartevent" "FLD_hourstartevent" [@whatever2]
#ELSEACT
break



[@whatever2()]
#ACT
mov a1 %arg(1)
goto @whatever3



================================
#ACT
mov A5 MON
FormatStr "FLD_daystartevent='%s'" %A5
MOV A6 %A9
UpdateValueSql "TBL_personal" %A6


hope you get the idea from that of the possibilities by setting up your own tables in sql :)

How about.. I make the table in sql like you said, but add in this extra bit to make this...

Code:
[@whatever]
#ACT
ReadValueSqlsys "TBL_personal" "FLD_monthstartevent" "FLD_daystartevent" "FLD_hourstartevent" [@whatever2]
#ELSEACT
break

then could create new rows with different dates... Figure some variable so that it checks i.e. FLD_monthstartevent = December or 12, FLD_daystartevent could be the date, only thing left is the time.... But would it work like that if i had say 4 different rows with different figures would it select the date correctly?? meh its a nice idea in theory but no idea how i would get it to only work on that date/time if the field is permanently entered the answer should stay same unless i could figure a way to generate the date from windows or is there any way of getting sql to check say time.windows.com and update the date and time every so often?
 
Last edited:
Upvote 0

Zordon

Golden Oldie
Golden Oldie
Apr 26, 2008
1,176
20
145
Manchester, UK
with server files all you can check is:

dayofweek
hour
min

as far as i know.

I mean sql, is there anyway of setting custom settings within sql to update the tables? or maybe set it so a website of some sort can update sql with those details? Is there anyway of writing something like a PHP script to do it?
 
Last edited:
Upvote 0