Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-10-2003, 12:50 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
Infinite Loops

Wouln't it be fun to check out how many infinite loops there are? I found... four. The Timeout loop.
if (playerenters||timeout){
//stuff
timeout = 1;
}
the for loop
for (i=1;i>0;i++){
//stuff;
sleep 1;
}
the while loop
while (1=1){
//stuff
sleep 1;
}
the recursive function
loop();
function loop(){
//stuff
sleep 1;
loop();
}
i haven't tested above one =\
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #2  
Old 08-10-2003, 01:45 PM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
I know an infinite loop, it's called Graal, when it's running, of course.
__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
Reply With Quote
  #3  
Old 08-10-2003, 01:51 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
I know another one, its called vendetta. And another one, it's called PKing.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #4  
Old 08-10-2003, 02:25 PM
Destorm Destorm is offline
Owner of Leviathan?
Destorm's Avatar
Join Date: Apr 2003
Location: England
Posts: 161
Destorm is on a distinguished road
Send a message via AIM to Destorm
Unless i'm mistaken (sorry if I am) sleep isnt a loop but a pause command? Also function(){} isn't a loop either.
__________________

-Make sure you lock every thread you can Mods-
Reply With Quote
  #5  
Old 08-10-2003, 02:54 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Use several!!!!11

NPC Code:
function loop(){
a=0;
}
if(timeout){
timeout = 1;
a++;
if(a=100){
loop();
}
}




P.S:There are alot of infinite loop possibilities.
Reply With Quote
  #6  
Old 08-10-2003, 02:58 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
Destorm, erm... well...
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #7  
Old 08-10-2003, 03:00 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally posted by Destorm
Unless i'm mistaken (sorry if I am) sleep isnt a loop but a pause command? Also function(){} isn't a loop either.
Sleep is a command he is using in a loop so that his computer doesn't crash. It basically makes his for loop like a timeout loop. Function he is using to switch back and forth.
Reply With Quote
  #8  
Old 08-10-2003, 03:12 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Timeouts aren't really loops per se, nor are recursive functions. And a for loop is basically just an extended while.
__________________
Reply With Quote
  #9  
Old 08-10-2003, 03:52 PM
Destorm Destorm is offline
Owner of Leviathan?
Destorm's Avatar
Join Date: Apr 2003
Location: England
Posts: 161
Destorm is on a distinguished road
Send a message via AIM to Destorm
Basically the only real loops are for and while although timeout can be used as a loop
__________________

-Make sure you lock every thread you can Mods-
Reply With Quote
  #10  
Old 08-10-2003, 04:42 PM
faenix faenix is offline
Registered User
Join Date: Jul 2003
Posts: 56
faenix is on a distinguished road
you can have an infinite amount of loops anyway. I don't see the point in this but all you're doing is a creating a conditions that can never be satisfied... and in mathematics there's an unlimited amount of conditions like that.
while (1==1) while (2==2) while (3==3) while (1+1==2) while (1/1==1) while (1^1==1) while (1^3==1)
hehe you get the point
__________________
In a mad world, only the mad are sane.
Reply With Quote
  #11  
Old 08-10-2003, 04:44 PM
Destorm Destorm is offline
Owner of Leviathan?
Destorm's Avatar
Join Date: Apr 2003
Location: England
Posts: 161
Destorm is on a distinguished road
Send a message via AIM to Destorm
So who would like to slap him/her in the face first?
__________________

-Make sure you lock every thread you can Mods-
Reply With Quote
  #12  
Old 08-10-2003, 04:48 PM
faenix faenix is offline
Registered User
Join Date: Jul 2003
Posts: 56
faenix is on a distinguished road
Unhappy

Quote:
Originally posted by Destorm
So who would like to slap him/her in the face first?
o.O
__________________
In a mad world, only the mad are sane.
Reply With Quote
  #13  
Old 08-10-2003, 05:25 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
*raised hand*
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #14  
Old 08-10-2003, 08:22 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
while (1==1) {
slapeveryone();
sleep .05;
}
function slapeveryone() {
for (i=0;i==i;i++) {
slapposter[i%postercount];
}
slapeveryone();
}
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #15  
Old 08-10-2003, 08:51 PM
Destorm Destorm is offline
Owner of Leviathan?
Destorm's Avatar
Join Date: Apr 2003
Location: England
Posts: 161
Destorm is on a distinguished road
Send a message via AIM to Destorm
for (i=0;i=>2;i--) {
slapposter[i%postercount];
}

why all the bells and whistles ;-)
__________________

-Make sure you lock every thread you can Mods-
Reply With Quote
  #16  
Old 08-10-2003, 09:56 PM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Quote:
Originally posted by Destorm
for (i=0;i=>2;i--) {
slapposter[i%postercount];
}

why all the bells and whistles ;-)
To add the effect, I mean at a movie you don't just sit down and then the movies done. You have to see the action.
*slaps*
*gets slapped*
__________________
Reply With Quote
  #17  
Old 08-11-2003, 12:36 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
id be happy with just sound effects...

if (strequals(#a,faenix)){
while(1==1){
play UBERSLAP.wav;
}
}

oops.. forgive that post i just woke up lol
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #18  
Old 08-11-2003, 01:55 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Or you could do what they did in the earliest viruses, make something calculate Pi or the squareroot of two. Lovely thing, continued fractions.
__________________


Help me keep scripting
Reply With Quote
  #19  
Old 08-11-2003, 01:58 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
isnt there an npc on 2k1 that calulates pi?
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #20  
Old 08-11-2003, 03:23 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Quote:
isnt there an npc on 2k1 that calulates pi?
It may approximate it, but you can never actually calculate pi.
__________________


Help me keep scripting
Reply With Quote
  #21  
Old 08-11-2003, 08:09 AM
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
pi is infinite...
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #22  
Old 08-11-2003, 08:12 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by GoZelda
pi is infinite...
No, it just has infinite complexity.
__________________
Reply With Quote
  #23  
Old 08-11-2003, 08:31 AM
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
That's right. But would 1 divived by 3 have an infinite complxity or IS it infinite?
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #24  
Old 08-11-2003, 07:37 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 GoZelda
That's right. But would 1 divived by 3 have an infinite complxity or IS it infinite?
to oversimplify, infinite is to big as infinite complexity is to alot of friggen numbers that aren't necessarily big
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #25  
Old 08-11-2003, 09:48 PM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Quote:
No, it just has infinite complexity.
Eh, if we really want to get technical we could just say it was irrational.
__________________


Help me keep scripting
Reply With Quote
  #26  
Old 08-12-2003, 04:52 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by TribulationStaff
Eh, if we really want to get technical we could just say it was irrational.
True, but that doesn't say quite the same thing. 1/3 is not irrational, but its denary representation has infinite complexity. I'm not even sure if 'infinite complexity' is a mathematical term - I chose it because its meaning is intuitive.
__________________
Reply With Quote
  #27  
Old 08-12-2003, 06:55 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
was there a purpose to this thread at some point?
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #28  
Old 08-12-2003, 07:01 AM
Questa Questa is offline
Back to the Beat
Join Date: Jan 2002
Location: USA
Posts: 1,230
Questa is on a distinguished road
Send a message via AIM to Questa
Quote:
Originally posted by Dach
while (1==1) {
What if someday 1 doesn't equal 1? Hmm? HMMM?!
__________________
Reply With Quote
  #29  
Old 08-12-2003, 07:06 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
Quote:
Originally posted by Questa

What if someday 1 doesn't equal 1? Hmm? HMMM?!
what would we care? when 1 doesn't equal 1 then our heads would explode due to the fact that we now actually have 2 or 3 or any other number of heads...
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #30  
Old 08-12-2003, 07:24 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
*gasps*
if (created) 1=random(0,450);


__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #31  
Old 08-12-2003, 07:48 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
*sigh*

I like the square root of 2. It's useful.



Irrational numbers... bah they just.... they just aren't rational!
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #32  
Old 08-12-2003, 07:59 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
irrational?? nu nu nu!! what if NASA only used rational numbers?? the hubbletelescope would crash into the earth and the sun would explode and 7-11's worldwide would lock their doors
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:03 PM.


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