Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Old Scripting Engine (GS1) (https://forums.graalonline.com/forums/forumdisplay.php?f=154)
-   -   This is stupid but whats the command for.... (https://forums.graalonline.com/forums/showthread.php?t=73177)

colin012 03-30-2007 10:51 PM

This is stupid but whats the command for....
 
What command do I use to make a script loop and not stop as long as the players in the room.

Chompy 03-30-2007 10:58 PM

PHP Code:

while() 

Or use timeout

colin012 03-30-2007 11:12 PM

Quote:

Originally Posted by Chompy (Post 1294715)
PHP Code:

while() 

Or use timeout


Timeout? Never saw that one and while you sure it's gs1

cbk1994 03-30-2007 11:14 PM

o.O while (true )
would work, but it's better to use a timeout...

PHP Code:

if (created)
{
timeout 0.05;
}
if (
timeout)
{
// Do Something
timeout 0.05;


I recommend GS2 though.

Bl0nkt 03-30-2007 11:15 PM

Quote:

Originally Posted by colin012 (Post 1294724)
Timeout? Never saw that one and while you sure it's gs1

while (you_use_gs1) suck++;

Anyway, timeout in GS1:

PHP Code:

if (timeout) {
  
blahblahblah;
  
  
timeout=0.05;


GS2:

PHP Code:

function onTimeout() {
  
blahblahblah();

  
setTimer(0.05);


The above scripts loops every 0.05 seconds.

colin012 03-30-2007 11:19 PM

Quote:

Originally Posted by Bl0nkt (Post 1294729)
while (you_use_gs1) suck++;

Anyway, timeout in GS1:

PHP Code:

if (timeout) {
  
blahblahblah;
  
  
timeout=0.05;


GS2:

PHP Code:

function onTimeout() {
  
blahblahblah();

  
setTimer(0.05);


The above scripts loops every 0.05 seconds.

Whats the blah blah part

xXziroXx 03-30-2007 11:21 PM

Quote:

Originally Posted by colin012 (Post 1294732)
Whats the blah blah part

It makes the player say "blah blah blah".

Crow 03-30-2007 11:21 PM

Quote:

Originally Posted by colin012 (Post 1294732)
Whats the blah blah part

The script you want to execute in your loop.

Edit: You are evil Ziro ;o

colin012 03-30-2007 11:43 PM

Quote:

Originally Posted by Crow (Post 1294736)
The script you want to execute in your loop.

Edit: You are evil Ziro ;o

It doesn't work

Rapidwolve 03-31-2007 04:02 AM

PHP Code:

while (playerscount 0){
   function();


GS1

DustyPorViva 03-31-2007 04:09 AM

Quote:

Originally Posted by Bl0nkt (Post 1294729)
while (you_use_gs1) suck++;

Anyway, timeout in GS1:

PHP Code:

if (timeout) {
  
blahblahblah;
  
  
timeout=0.05;


GS2:

PHP Code:

function onTimeout() {
  
blahblahblah();

  
setTimer(0.05);


The above scripts loops every 0.05 seconds.

Don't you have to call the timeout for that to even begin? Like stated above ^

killerogue 03-31-2007 04:13 AM

Quote:

Originally Posted by Rapidwolve (Post 1294834)
PHP Code:

while (playerscount 0){
   function();


GS1

What you posted was GS2. :P

And why are you using GS1 anway. :cry:

Bl0nkt 03-31-2007 06:37 AM

Quote:

Originally Posted by DustyPorViva (Post 1294839)
Don't you have to call the timeout for that to even begin? Like stated above ^

I knew I was forgetting something.

killerogue 03-31-2007 06:54 AM

PHP Code:


function onCreated()
{

  
setTimer(0.05);
}

function 
onTimeOut()
{

  
setTimer(0.05);


Just felt a need to do that. :P

cbk1994 03-31-2007 02:26 PM

Here's the GS1.

PHP Code:

if (created)
{
timeout 0.05;
}
if (
timeout)
{
/*
    Put what you want to loop here.
*/
setplayerprop #c, die; // Make player's chat die every .05 seconds.

timeout 0.05;



Chompy 03-31-2007 08:49 PM

Quote:

Originally Posted by Rapidwolve (Post 1294834)
PHP Code:

while (playerscount 0){
   function();


GS1

This is probably the best way to do it; timeout is more flexible, but I would prefer while() for this kind of use..

Quote:

Originally Posted by killerogue (Post 1294841)
What you posted was GS2. :P

What he posted was GS1 :p

Functions were a part of GS1 :)

colin012 04-01-2007 03:40 AM

I figured it out I put:

timer=0.1

I fixed it by putting:

timer = 0.1


All times are GMT +2. The time now is 08:56 PM.

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