Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 12-23-2004, 04:43 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by ZeroTrack
Jagen i know how commands work and why it does, this is how a programers brain works thats the only way i can really learn things it ask 'why', please dont question my ability to understand commands...

i straight inputed both codes just as is on forums, with a clientside loop checking the string and displaying the text
Try assigning your hours/minutes/seconds to variables.
Reply With Quote
  #17  
Old 12-23-2004, 04:50 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Ok i took them all out and assigned them to var's then set the string this is what happened
2. 0.035332 secs JagenTest
8. 0.006543 secs SernTest

-_- and i didnt initialize it yet
__________________

Reply With Quote
  #18  
Old 12-27-2004, 12:19 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Python523
Try assigning your hours/minutes/seconds to variables.
Has anyone pointed out that yours uses days/hours/minutes rather than hours/minutes/seconds?

Just a thought.
Reply With Quote
  #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
  #20  
Old 12-30-2004, 10:55 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by CaTigus
I seemed to have much more accurate time with Jagens, and I tried both.
.... .... .. more accurate time??? lol the debate wasn't about which ones more accurate cause they both return the same time in real time, but it was over which has more load on the cpu. Before you post again refer to rule 4 here http://forums.graalonline.com/forums...cement.php?f=8
__________________

Reply With Quote
  #21  
Old 12-31-2004, 12:10 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Um, Sern, that person didn't post a solution.
__________________
Reply With Quote
  #22  
Old 12-31-2004, 12:29 AM
CaTigus CaTigus is offline
Scripter
Join Date: Oct 2002
Posts: 80
CaTigus is on a distinguished road
Quote:
Originally Posted by ZeroTrack
.... .... .. more accurate time??? lol the debate wasn't about which ones more accurate cause they both return the same time in real time, but it was over which has more load on the cpu. Before you post again refer to rule 4 here http://forums.graalonline.com/forums...cement.php?f=8
I was commenting, Maybe you should buy Hooked on Phonics before you go insulting my opinion. There was no solution in my post.
Reply With Quote
  #23  
Old 12-31-2004, 12:38 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
Quote:
Originally Posted by ZeroTrack
Ok i took them all out and assigned them to var's then set the string this is what happened
2. 0.035332 secs JagenTest
8. 0.006543 secs SernTest

-_- and i didnt initialize it yet
I have tested them both offline with similar setup and it shows yours faster than Jagens.

I do not know how accurate the CPU usage indicator in the offline debugger is.

I used the following scripts.

Jagen's Method:
PHP Code:
if (playerenters) {
  
timeout 0.05;
}
if (
timeout) {
  
this.temp 23212613;
  
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;
  
message H#v(this.realhrs)  M: #v(this.realmin) S: #v(this.temp);

  
timeout 0.05;

~0.053-0.069 cpuusage

Sern's Method
PHP Code:
if (playerenters) {
  
timeout 0.05;
}
if (
timeout) {
  
this.temp 23212613;
  
this.hours int(this.temp/(60*60));
  
this.mins int((this.temp/60)%60);
  
this.secs int((this.temp)%60);
  
message #v(this.hours)H:#v(this.mins)M:#v(this.secs)S;

  
timeout 0.05;

~0.043-0.048 cpuusage

Edit: I do not know why Sern's cpuusage is less.

This is offline. Scripts may be processed completely differently online.
__________________


Last edited by Evil_Trunks; 12-31-2004 at 12:49 AM..
Reply With Quote
  #24  
Old 12-31-2004, 01:30 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Mine deals with more variable manipulation, so maybe that adds some extra cycles... However, I was talking about the efficiency mathematically, which would be true in my case.
Reply With Quote
  #25  
Old 12-31-2004, 01:37 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by ZeroTrack
Yea i tried pushing that one only cause ben said it to me once so i wanted to haha
Let us moderators handle the moderating.
Reply With Quote
  #26  
Old 12-31-2004, 01:41 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Kaimetsu
Um, Sern, that person didn't post a solution.
Yea i tried pushing that one only cause ben said it to me once so i wanted to haha
Quote:
Maybe you should buy Hooked on Phonics before you go insulting my opinion. There was no solution in my post
phonics has nothing to do with what i said, phonics is “a method of teaching beginners to read and pronounce words by learning the phonetic value of letters, letter groups, and especially syllables” so once again you strike out due to lack of common knowledge. this also does not exclude the fact that our debate has nothing to do with which one shows more accurate cause they both return the same time in real time, but it was over which one puts more load on the CPU.

Quote:
Originally Posted by Phyton523
Mine deals with more variable manipulation, so maybe that adds some extra cycles... However, I was talking about the efficiency mathematically, which would be true in my case.
this isn’t an attack I want to know how yours is more efficient mathematically? i dont see it
__________________

Reply With Quote
  #27  
Old 12-31-2004, 02:10 AM
CaTigus CaTigus is offline
Scripter
Join Date: Oct 2002
Posts: 80
CaTigus is on a distinguished road
Quote:
Originally Posted by ZeroTrack
phonics has nothing to do with what i said, phonics is “a method of teaching beginners to read and pronounce words by learning the phonetic value of letters, letter groups, and especially syllables” so once again you strike out due to lack of common knowledge. this also does not exclude the fact that our debate has nothing to do with which one shows more accurate cause they both return the same time in real time, but it was over which one puts more load on the CPU.
Hooked on phonics is a program to teach children to read, and comprehend better. You obviously didn't read what I read in the first place. I simply stated an opinion on the subject and you started thrashing about. You sent me a "rule" which completely passed up the point of my post. Therefor you probably didn't read my post very thuroghly or cannot read correctly.
Reply With Quote
  #28  
Old 12-31-2004, 02:53 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by ZeroTrack
this isn’t an attack I want to know how yours is more efficient mathematically? i dont see it
Must I point out the obvious.

According to your post, a%b = a - int(a/b)*b

so if I translate Evil_Trunks's variation of your script
NPC Code:

this.hours = int(this.temp/(60*60));
this.mins = int((this.temp/60)%60);
this.secs = int((this.temp)%60);


to
NPC Code:

this.hours = int(this.temp/(60*60));
this.mins = int(this.temp/60 - int(this.temp/60^2)*60);
this.secs = int(this.temp - int(this.temp/60)*60);




You tell me what looks more efficient. Mine or yours.
Reply With Quote
  #29  
Old 12-31-2004, 03:10 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Python523
Must I point out the obvious.

According to your post, a%b = a - int(a/b)*b

so if I translate Evil_Trunks's variation of your script
NPC Code:

this.hours = int(this.temp/(60*60));
this.mins = int((this.temp/60)%60);
this.secs = int((this.temp)%60);


to
NPC Code:

this.hours = int(this.temp/(60*60));
this.mins = int(this.temp/60 - int(this.temp/60^2)*60);
this.secs = int(this.temp - int(this.temp/60)*60);




You tell me what looks more efficient. Mine or yours.
ah i see what you mean now you lost me for a second, yes your its better in that sence , mines better on cpu load
__________________

Reply With Quote
  #30  
Old 12-31-2004, 07:11 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by ZeroTrack
ah i see what you mean now you lost me for a second, yes your its better in that sence , mines better on cpu load
What hes been trying to prove to you in the past pages in this thread is that, mathematically, his script is more efficient then yours. Yes, yours doesnt take up as much space as his does, but it doesnt make yours more efficient then his.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.