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
  #1  
Old 09-13-2003, 12:29 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Percentages

Well, i had a lot of homework today, most of them is boring stuff you all have to do with the same calculation, so i decided to make a NPC to do the work for me. Well, here it is!

A brief explaination:

Calculate 100%
With this option, you need to give the percentage, and then how much it's worth. Then, the NPC will calculate what 100% is.

Example:
NPC Code:

6% = 108
108*100=10800
10800/6 = 1800
1800 = 100%



Calculate Percent
You must pass what 100% is, and what the value is. Then, the NPC will calculate how much percent the value is.

Example:
NPC Code:

100% = 80
Value = 20
20*100
2000/80
25 %



Calculate value of a percent
You must tell what 100% is, and a percent. Then, the computer will calculate how much the value is of the percent.

Example:
NPC Code:

100%=100
Value=20
100/100
1*value(20)
20 = 20%



Yes i know it's a bit simple but it's useful for doing homework XD
Attached Files
File Type: nw homew0rk.nw (13.0 KB, 168 views)
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #2  
Old 09-13-2003, 02:20 PM
Benm00t Benm00t is offline
I made a tree!
Benm00t's Avatar
Join Date: Jul 2003
Location: The Intarwebbernetwork!
Posts: 987
Benm00t is on a distinguished road
i'm sure a few extra seconds with a calculator would have done the job for you :-P
Reply With Quote
  #3  
Old 09-13-2003, 03:17 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Yes but it makes my head hurt.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #4  
Old 12-07-2003, 06:32 PM
KuJiGX KuJiGX is offline
Registered User
Join Date: Dec 2003
Location: New York
Posts: 52
KuJiGX is on a distinguished road
Send a message via AIM to KuJiGX
Quote:
Originally posted by GoZelda
Yes but it makes my head hurt.
Wow dude. Your lazy x.x
__________________
-KuJi
Reply With Quote
  #5  
Old 12-07-2003, 08:38 PM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
i write stuff in graal script all the time to do my work. ussualy i create a way to do everything that is needed on my paper, then i insert everything into arrays hardcoded into the script. then i make it just display each answer.
__________________
new account: Trevor
Reply With Quote
  #6  
Old 12-07-2003, 09:03 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Beh i re-wrote it in C++
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #7  
Old 12-07-2003, 11:31 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
What math class is this oO Intro to prealgebra?
Reply With Quote
  #8  
Old 12-07-2003, 11:43 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally posted by Python523
What math class is this oO Intro to prealgebra?
I guess so, the teacher once wrote down something on the blackboard for the higher class, so next year we'll probably do Sinus and Cosinus, that is, if you pick Algebra 'heavy' or 'strong' (dunno in English ). Amazing what knowledge you can pick up from hearing people speak in hallways and glancing at the blackboard once
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #9  
Old 12-07-2003, 11:44 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally posted by KuJiGX


Wow dude. Your lazy x.x
[WHINY] three months... [/WHINY]


but yeah, graal is usefull for homework, bah why am I perpetuating this revival?
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #10  
Old 12-07-2003, 11:48 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 GoZelda

I guess so, the teacher once wrote down something on the blackboard for the higher class, so next year we'll probably do Sinus and Cosinus, that is, if you pick Algebra 'heavy' or 'strong' (dunno in English ). Amazing what knowledge you can pick up from hearing people speak in hallways and glancing at the blackboard once
Going from calculating percentages to sine and cosine is... a pretty big jump
Reply With Quote
  #11  
Old 12-08-2003, 12:33 AM
wonderboysp2p wonderboysp2p is offline
Registered User
wonderboysp2p's Avatar
Join Date: Sep 2002
Location: -Wonderboy
Posts: 537
wonderboysp2p is on a distinguished road
Send a message via AIM to wonderboysp2p
Quote:
Originally posted by Python523


Going from calculating percentages to sine and cosine is... a pretty big jump

O_o im thinking they might cover more than just precentages in their math class?
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #12  
Old 12-08-2003, 02:27 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 wonderboysp2p



O_o im thinking they might cover more than just precentages in their math class?
usually it's
basic math -> prealgebra -> algebra -> geometry -> trig, I think
Reply With Quote
  #13  
Old 12-08-2003, 05:42 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
Quote:
Originally posted by Python523

usually it's
basic math -> prealgebra -> algebra -> geometry -> trig, I think
-> precalc -> calc/stats -> somthing else
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
Reply With Quote
  #14  
Old 12-08-2003, 07:37 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally posted by Python523


Going from calculating percentages to sine and cosine is... a pretty big jump
Hey, i'm not the teacher

And it was mainly some revising.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #15  
Old 12-08-2003, 11:08 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
my county's system is

fundamentals-> pre-algebra (if needed)-> algebra I-> geometry(trig included I guess)-> algebra II-> pre-calculus->calculus->..

a lot of the stuff I do in the class i'm taking now i've already learned, so i'll script my calculator to do it
__________________

Reply With Quote
  #16  
Old 12-08-2003, 11:21 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally posted by CheeToS2
my county's system is
I don't use a national system :o
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #17  
Old 12-08-2003, 11:35 PM
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 GoZelda

I don't use a national system :o
Um. county != country.
Reply With Quote
  #18  
Old 12-15-2003, 07:44 AM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
I forget the order of mine, but I know trig is mixed in with geometry and algebra2 where I live.
Heres my nifty way of calculating percents.
lets say we want to find out what percent 8 is of 47.
first we'd take 100 and devide it by 47...
NPC Code:
#  100/47


then we'd take that resulting number and multiply it by the 8...
NPC Code:
#  (100/47)*8


and then you'd get the answer, wich comes to about 17, I think.
NPC Code:
#  (100/47)*8=17.ish

__________________
Reply With Quote
  #19  
Old 12-15-2003, 05:44 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally posted by Lance


Um. county != country.
Oh, i thought it was a typing error. I'm on an European school.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #20  
Old 12-15-2003, 08:20 PM
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 GoZelda

Oh, i thought it was a typing error. I'm on an European school.
Schools in the USA are in large part controlled by their school district, and the school districts by each state.
Reply With Quote
  #21  
Old 12-16-2003, 02:20 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
OMG why are you people making this harder for yourself? Think about it, you have to first make up the script around 10-20 seconds, and then type in the questions (depending on the amount of questions), and then read the answer. If you just do the math in your head, then write down the answer, wouldn't that be a lot faster? I'm sure this stuff isn't hard for you people:
6%=108
108*100=w00t add two zeros to the end of 108=10800
10800/6=w00t 10/6=1 remainder 4
48/6=8 remainder 0 (add these up)
--------------------------------
1+8+(two zeros left)
w00t, you get 1800 omg?!? but but but how?
Wow that took like a good 2 minutes? Subtract the time it took writing this from 2 minutes, and you got ???, 15 seconds max.
__________________
Reply With Quote
  #22  
Old 12-16-2003, 10:53 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
here is something that will definately spare you some time, matricies! *checks out level* wow, I explained alot in the signs... wait, I thought I added support for any dimensions of matrice-ey, ohwell 2-2 to 3-3 is good enough for me
Attached Files
File Type: zip matrices.zip (5.0 KB, 104 views)
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
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 07:04 PM.


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