View Single Post
  #19  
Old 12-30-2004, 06:21 PM
CaTigus CaTigus is offline
Scripter
Join Date: Oct 2002
Posts: 80
CaTigus is on a distinguished road
Quote:
Originally Posted by Python523
Too many unneeded calculations. Modulus is pretty inefficient to use repeatedly, I think. You can use the seconds to calculate the minutes and the minutes to calculate the seconds...

NPC Code:

if (created) {
with (getplayer(Python523)) {
this.temp = playeronlinetime;
}
this.temp = this.temp / 60^2;
this.realhrs = int(this.temp);
this.temp = this.temp - this.realhrs;
this.temp *= 60;
this.realmin = int(this.temp);
this.temp = this.temp - this.realmin;
this.temp *= 60;
sendtonc H: #v(this.realhrs) M: #v(this.realmin) S: #v(this.temp);
}

I seemed to have much more accurate time with Jagens, and I tried both.
Reply With Quote