1
Modification Help / Help with looping issues [SOLVED]
« on: March 10, 2016, 04:22:10 PM »
So, i was just building around a castle and while i'm building. I always type the command ./brickcount to look for
the amount of bricks spent (i don't like wasting memory). Then i though of creating a script to give me support:
This first code didn't work. When i type "./showBricks on" it gives an error : "Error runtime blablabla cancer blabla"
Any idea?
the amount of bricks spent (i don't like wasting memory). Then i though of creating a script to give me support:
Code: [Select]
function serverCmdshowBricks(%this, %asw)
{
%flag = false;
//Let's toggle if
if(%asw $= "on")
{
%flag = true;
} else if(%asw $= "off") %flag = false;
while(%flag) //Yes... .-.
%this.bottomPrint("The number of bricks is: " @ getBrickCount(), 0);
}
This first code didn't work. When i type "./showBricks on" it gives an error : "Error runtime blablabla cancer blabla"
Code: [Select]
function serverCmdshowBricks(%this, %asw)
{
%flag = false;
//Let's toggle if
if(%asw $= "on")
{
%flag = true;
} else if(%asw $= "off") %flag = false;
for(;%flag;) //Why not? It works at C :-(
{
%this.bottomPrint("The number of bricks is: " @ getBrickCount(), 0);
}
}
This was my second try and nothing .-.Any idea?