ID:170447
 
How would I cause a repeated check upon world new until the game closes down, Like call a proc every so often . Please help if you can. Also I need to know how to repeat a verb or call it again after it is done.
world
spawn()
//proc here


Then, in your proc, have it call itsself at the end. This is called recursion.

proc/GenericProc()
...Do whatever here
GenericProc()


As for the verbs, it can't be done. Verbs are activated by the player using macros or statpanel. But you could make the verb call a proc that uses recursion.

Prodigal Squirrel
In response to Prodigal Squirrel
Meh, What i'm trying to do is make it call the Repop proc every so often, but what you put works for self coded procs. >.<
In response to WickedlyAndy
world/New()
while(1)
spawn(1337)//Replace with your time here
world.Repop
In response to Hell Ramen
can you explain what while does? So I can remember what it does so i can use it in the future
In response to WickedlyAndy
It'll make it keep on repeating. :)
In response to Hell Ramen
Thanks, you wouldn't happen to know how to save turf vars. That has been the most annoying thing ever to me.
In response to Hell Ramen
Um, I get one hell of an error when I use the thing. When I open the game it lags Tremendously(Spellcheckthat) this only happens when i use the whole world/New() >.<
In response to WickedlyAndy
Whoops, I think I forgot ..()
Also, did you change the ticks(the 1337 part)? >_>
In response to Hell Ramen
Yes i changed teh Tick rofl I'm not 100% newb Lol
In response to WickedlyAndy
_>
What'd you change it to?
In response to Hell Ramen
Every spawn(20) for testing. Lol I don't think thats causing it When i use world/New() for some reason it lags my game and won't run. Weird
In response to WickedlyAndy
Did you add "..()" under world/New()?
(I forgot to do it, I know)
And spawn(20) should -kind of- lag it.
It repops every 2 seconds. o.o
In response to Hell Ramen
It lags so bad the game won't load.
In response to WickedlyAndy
world/New()  //---Call world/New()
..()
while(1)
WorldRepop() //----Call the Repop proc

proc/WorldRepop() //The proc
sleep(6000) //----Sleep 10 minutes
world.Repop() //----Repop the world
WorldRepop() //----Call WorldRepop again


Technically, I like using repop in a proc, instead of using the built-in one in world/New(). Or you can just dump the whol proc version and go with this:

world/New()
..()
while(1)
sleep(600)
Repop()
In response to Mega fart cannon
The problem with all the approaches to infinite loops in this thread is that they alll overlook one critical fact... world/New() must be allowed to return! You must spawn() the loop itself, not just the contents of the loop.

What do I mean? I mean this...

world/New()
spawn() ProcWithoutEnd()
..()

proc/ProcWithoutEnd()
while(1)
sleep(600)
world << "One minute passes."


Notice how world/New() will return immediately.

That's one valid approach. Here's the other common version:

world/New()
spawn(600) InfinitelySelfSpawningProc()
..()

proc/InfinitelySelfSpawningProc()
world << "One minute passes."
spawn(600) InfinitelySelfSpawningProc()


Both of these work fine. Some people prefer one over the other - the first version is arguably slightly more efficient (though the difference is so slight that you'd never notice it in a million years), but the second version is more convenient to profile using the Profile World feature in Dream Seeker (which only works when debug mode is on for your project).
In response to WickedlyAndy
Lol. Sorry, I mis-understood your question. I should read more carefully.

Prodigal Squirrel