timevar increases by 1 every 5 seconds. It appears that the server software here sends this to the client every 5 seconds as well, so I assume the value will be as expected each time the client connects (as in not reset). The server tells the client the value of timevar is the number of seconds (divided by 5) since 01/01/1970 - 11078 days. (Apparently Stefan coded it that way, so they reproduced it for consistency.)
It should be pretty easy to figure out how to use this base as a means of tracking time.
Oh great this is a classic timestamp then, I should be able to figure out a formula to turn this into a date, although my brains hurt too much to do this right now.
I mean, you could still just use timevar. 24 hours in timevar = [(24h)(60m)(60s)] / 5 = 17280. Note: Five is used because five real seconds are one timevar. So with this information we may be able to create daily events with a script that works as following.
if (timeout && this.worldTime > 8640 && this.worldTime < 10000){
message Yo, it’s time to play n’ shit!;
}
[/CODE]
So, if the values are between certain ones, you could have events take place at those specific times. Increase the initial totaltime by multiplying it by seven if you’d like to have events based on things that are weekly. I could have completely missed your point with this, though.
Missed that one on first reading, getting back to calculator
___Merged doublepost__________________
Here’s the final product:
(Plz somebody tell me the syntax to quote text)
// NPC made by Fredi
if (timeout||playerenters){
T = timevar*5 + 957139200; // Timestamp of current GMT
message World Time: #e(0,2,#v(T%86400/3600)):#e(0,2,#v(T%3600/60)):#v(T%60);
this.H=T%86400/3600; // Hour of the day
this.M=T%3600/60; // Minutes
this.S=T%60; // Seconds
if (this.S >34 && this.S <= 35) { //Lay green rupee between 30 and 35 seconds
lay greenrupee;
}
timeout = 1;
}
The first part displays the current GMT time, the last one gives you hours minutes and seconds so you can start events whenever you want during the day.
My example drops a useless green rupee each second between 35 and 40 seconds, each minute.
I suggest we all try to make events on our respective servers, and make them at different hours so there’s always a place to hang out.
I’m gonna make a clock weapon to show current time from anywhere.
Yeah, I was a developer on Classic because I didn’t know how to do anything. Maybe the reason why I don’t like helping people can be partly attributed to how Codr just acted and how Twiggy and others have acted in the past. It’s much easier to yell at people than take bullshit like that.
Ignoring the fact that I don’t care if I bother you in particular, what exactly did I do wrong? The way your calculations were done show that you didn’t actually know what was going on with the value of timevar. I would’ve said the same to anyone because of that. fredi125 has it done in a way that’s consistent with the way it functions and is guaranteed to always produce expected results without question. That’s a good thing and he should be satisfied that he asked for actual clarification and not just something that happens to work.
I understand what timevar is and know how to use it; regardless, I got those numbers from Beholder. Not a code that Beholder made but from Beholder directly from Skype. I’ve been making an effort to be helpful instead of aggressive towards people on these forums, so while I do that perhaps you should try to be less of a spiteful cunt.
Hmm… really? I’m not seeing much of a difference between what you did and what I did. Except that mine was actually a correction and not SOLELY an attempt to be negative. Please don’t even try to say that wasn’t what that was.