PDA

View Full Version : Clock NPC


WoRlaNN2k
12-24-2001, 03:22 AM
Hello, I was wondering if anyone here can make me a Clock NPC that will give the exact time. Here is what i want in it:

-I want it say say the day,hours,minutes, seconds,and AM or PM.
-I want it in the format day hour:minutes:seconds AM/PM
-I want the default time to say Sunday 12:00:00 AM.
-I want it so that the owner of a house can say reset clock and it will reset back to the default.
-I want the time to still work even tho no one is in that level.
-I want it to actually work ^_^.

If there is anything out there that is exactly like this, tell me where i can get it. I need this clock so i can put it in the house i want to make, so people that are paying rent will know exacly when i want my rent :).

royce
12-24-2001, 04:20 AM
the time is already on the server........also with the rent thing...nm ur pretty stupid

btedji
12-24-2001, 04:25 AM
geez no one is going to do that much work for you

WoRlaNN2k
12-24-2001, 04:43 AM
im not talking about the crappy clock that follows you on the screen, i want it to display real time. I am not stupid, i just don't know how to make npcs very well. I could do this myself if i knew how to create variables, how to increase them or make them say something else at a certain time, and if i knew how to make an npc say all the variables at once.

WoRlaNN2k
12-24-2001, 09:39 AM
Ok i managed to script it, sort of. I had to split it into different parts. 1 for day, 1 for hours, 1 for minutes, 1 for AM/PM, and 1 for that flashing : thing. It took long n00b code instead of 1337 short code... does anyone know the code to make it work even tho no one is in that level?

WoRlaNN2k
12-24-2001, 08:25 PM
fine fine... I kinda did it myself... here it is:

if (created||strequals(#c,reset clock)) {
setstring this.day,Sunday;
this.hours=12;
this.minutes1=0;
this.minutes2=0;
this.seconds1=0;
this.seconds2=0;
setstring this.ampm,AM;
timeout=0.05;
}
//The Clock Model
if (timeout) {
message #s(this.day) #v(this.hours):#v(this.minutes1)#v(this.minutes2): #v(this.seconds1)#v(this.seconds2) #s(this.ampm);
sleep 0.5;
message #s(this.day) #v(this.hours) #v(this.minutes1)#v(this.minutes2) #v(this.seconds1)#v(this.seconds2) #s(this.ampm);
timeout=0.5;
}



What I need to know now is how do I increase the strings and variables? And how do i set the time to what ever i say (for example: set clock day hours minutes AM/PM, and then i will say set clock Monday 8 23 PM. I want the seconds to start over as well)

mikepg
12-24-2001, 09:48 PM
ive demised a way to keep it real time based on a starting time....but i need to keep that a secret. I put a lot of thought into this one, lol ;)

if i finish the script, ill let you know.

mikepg
12-25-2001, 12:39 AM
ive demised a way to keep it real time based on a starting time....but i need to keep that a secret. I put a lot of thought into this one, lol ;)

if i finish the script, ill let you know.

WoRlaNN2k
12-31-2001, 11:39 PM
okies i have another question... how do i split the text into different parts?

for example: setclock #1 #2:#3#4 #6
#1=days, #2=hours, #3+4=minutes, and #6=AM/PM...

So when I say "seclock Sunday 12:00 AM" it will set the clock to Sunday 12:00:00 AM (yes i am aware there is another :00 in there, those are seconds and I want those to reset to 00 each time I change the clock).

In the script I have made, these are the different parts:

server.wd=Days
server.wh=Hours
server.wm1=Minutes1
server.wm2=Minutes2
server.ws1=Seconds1
server.ws2=Seconds2
server.wampm=AM/PM

Here's the code I've given the clock itself.

if (created) {
timereverywhere;
timeout=0.05;
}
if (timeout) {
message #s(server.wd) #v(server.wh) #v(server.wm1)#v(server.wm2) #v(server.ws1)#v(server.ws2) #s(server.wampm)
sleep 0.5;
message #s(server.wd) #v(server.wh):#v(server.wm1)#v(server.wm2):#v(serv er.ws1)#v(server.ws2) #s(server.wampm)
timeout=0.5;
}

I hope the information i have given you will help you to help me :)

LiquidIce00
01-03-2002, 06:18 AM
Originally posted by mikepg
ive demised a way to keep it real time based on a starting time....but i need to keep that a secret. I put a lot of thought into this one, lol ;)

if i finish the script, ill let you know.

well u would have to find the current time divided by 5 .. then that is the timevar value.. and u just add that to the current timevar..
if u wanna do date u have to figure it out based on the date.. it would depend how u do it ...