Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Bomypet problem. (https://forums.graalonline.com/forums/showthread.php?t=68401)

contiga 08-28-2006 11:12 AM

Bomypet problem.
 
PHP Code:

temp.cmds 1;
temp.cmda this.( "load_" slotindex 2).tokenize"->")[ 0];
temp.cmdb this.( "load_" slotindex 2).tokenize"->")[ bindex];
temp.cmdc = { temp.cmdatemp.cmdb};
temp.cmdt = { "event""action"}; 
for ( 
02++) {
  if ( 
temp.cmdct].length() > 0) {
    if ( 
temp.cmdct].pos"(") = - 1
      
this.( "c" temp.cmdtt]) = requestCommandIndextemp.cmdct]);
    else {
      
this.( "c" temp.cmdtt]) = requestCommandIndextemp.cmdct].substring0temp.cmdct].pos"(")));
      if ( 
this.draw_iconsthis.caction][ 6] == 2) {
        
temp.cmdm "";
        
temp.cmds this.draw_iconsthis.caction][ 8].indextemp.cmdct].substringtemp.cmdct].pos"(") + 1temp.cmdct].pos")") - temp.cmdct].pos"(") - 1));
        
temp.cmdb "dropdown";
        echo(
"Debug (t - temp.cmds): " " - " temp.cmds);
      }
      else {
        
temp.cmdm temp.cmdct].substringtemp.cmdct].pos"(") + 1temp.cmdct].pos")") - temp.cmdct].pos"(") - 1);
        
temp.cmdb temp.cmdtt].substring01).upper() @ temp.cmdtt].substring1).lower();
      }
      
initTextboxtemp.cmdbtemp.cmds); 
      if ( 
temp.cmdm != "")
        ( 
temp.cmdb "_Param").text temp.cmdm;
      
this.( temp.cmdtt].substring01) @ "textbox") = 1;
    }
  }


Rc keeps giving an error that a loop limit has been exceeded, anyone knows why? I mean.. it only makes a loop till 2.. so it shouldn't do anything wrong.

xXziroXx 08-28-2006 05:21 PM

The only time I recived that error, was when I accidentily had two loops using the same var. Example:

PHP Code:

for (0whatever++) {
  for (
0whatever2++) {
  }



_Z3phyr_ 08-28-2006 05:21 PM

for ( t = 0; t <= 2; t ++) {
^that will make it loop to 2. *shrug*

I don't know about any loop limit or whatever so someone else can post about it.


EDIT - to below poster:
Really? I always believed that < makes it stop at the number below the number because if its ==2 then its not less than, and if it was <= it would stop at the number given because it would still be true.

I don't know though so whever works. My mistake.

xXziroXx 08-28-2006 05:22 PM

Quote:

Originally Posted by _Z3phyr_
for ( t = 0; t <= 2; t ++) {
^^that will make it loop until 2.

I don't know about any loop limit or whatever so someone else can post about it.

No, that will make it loop to 3, use '<' instead of '<='.

Tolnaftate2004 08-28-2006 06:26 PM

Quote:

Originally Posted by contiga
Rc keeps giving an error that a loop limit has been exceeded, anyone knows why? I mean.. it only makes a loop till 2.. so it shouldn't do anything wrong.

The error in RC should give you a line at which the script is exceeding the limit.
Give us that block of code.

xXziroXx 08-28-2006 07:43 PM

Quote:

Originally Posted by _Z3phyr_
for ( t = 0; t <= 2; t ++) {
^that will make it loop to 2. *shrug*

I don't know about any loop limit or whatever so someone else can post about it.


EDIT - to below poster:
Really? I always believed that < makes it stop at the number below the number because if its ==2 then its not less than, and if it was <= it would stop at the number given because it would still be true.

I don't know though so whever works. My mistake.

<= will make the var increase for the final time when the var is #, < will make the var increase at the value before #.

contiga 08-28-2006 07:49 PM

Quote:

Originally Posted by xXziroXx
No, that will make it loop to 3, use '<' instead of '<='.

Wrong.
PHP Code:

for ( 02++) 

Will make i = 0 and i = 1.
PHP Code:

<= 2

Would add i = 2 also.


Quote:

Originally Posted by Tolnaftate2004
The error in RC should give you a line at which the script is exceeding the limit.
Give us that block of code.

Quote:

Originally Posted by GraalScript
Loop limit exceeded in script of bomyisland_bomy_idle (in level kontest.nw at pos (6, 39))

That's all it says.

Maybe Stefan or a GST that knows what's wrong can take a look? GServer: dev (Graal2001 Dev), Class: con_bomypet & con_bomycontrol.

It only happens in combination with a gui popup ctrl, not with getting text from gui text ctrl.

contiga 08-29-2006 11:17 AM

Please help me quick.. we need the bomypet finished! ^^

contiga 08-29-2006 09:00 PM

Lol, Ziro was right, I had 2 times the same var used for a loop in a loop..

The function : initTextBox( foo); had a loop in it also, with a var named "t".

How such dumb things can keep you busy! !pissed!

xXziroXx 08-29-2006 09:10 PM

Quote:

Originally Posted by contiga
Lol, Ziro was right, I had 2 times the same var used for a loop in a loop..

The function : initTextBox( foo); had a loop in it also, with a var named "t".

How such dumb things can keep you busy! !pissed!

Mhm, I didnt notice it for hours either. :redface:


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

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