I made a modscript a while ago and when I used it again, it didn't work anymore. All I know that it has to do with the long lines of code from the getTile, setTile, addItemInventory. Here's the code, the problem occurs at the bolded part.
That means your script is too long. Is there a way to shorten that script?
Maybe put the item IDs in an array and check when you run the command if the block ID is inside the array?
(Yeah, I should fix that one of these days)
I knew that the code was too long, but I used the same exact code before and it worked fine. I think it has to do with Blocklauncher 1.4.6. Well hope you can fix it soon. I've tried to shorten it multiple times, but still doesn't work as well. Any idea what the max lines of code Blocklauncher is able to read?
I knew that the code was too long, but I used the same exact code before and it worked fine. I think it has to do with Blocklauncher 1.4.6. Well hope you can fix it soon. I've tried to shorten it multiple times, but still doesn't work as well. Any idea what the max lines of code Blocklauncher is able to read?
{
var Data = cmd.split(" ");
if(Data[0]=="Eggs")
{
ModPE.setItem(392,9,9,"Spawn Zombie");
ModPE.setItem(393,4,14,"Spawn Creeper");
ModPE.setItem(394,5,14,"Spawn Skeleton");
ModPE.setItem(395,6,14,"Spawn Spider");
ModPE.setItem(396,7,14,"Spawn Zombie Pigman");
Player.addItemInventory(392,1);
Player.addItemInventory(393,1);
Player.addItemInventory(394,1);
Player.addItemInventory(395,1);
Player.addItemInventory(396,1);
clientMessage("Eggs Added!")
}
if(Data[0]=="Grenades"){
clientMessage("Grenades Added!");
ModPE.setItem(397,0,13,"Grenade");
Player.addItemInventory(397,16);
}
if(Data[0]=="Tools")
{
clientMessage("Tools Added!");
ModPE.setItem(398,0,12,"Eraser");
ModPE.setItem(399,1,12,"Eraser x3");
ModPE.setItem(400,2,12,"Eraser x5");
ModPE.setItem(402,3,12,"Teleportation Stick");
ModPE.setItem(403,4,12,"Cut");
ModPE.setItem(404,5,12,"Copy");
Player.addItemInventory(398,1);
Player.addItemInventory(399,1);
Player.addItemInventory(400,1);
Player.addItemInventory(402,1);
Player.addItemInventory(403,1);
Player.addItemInventory(404,1);//Error Page not found!
}
if(Data[0]=="help"){
clientMessage("/Tools, /Eggs, /Grenades");
}}
function useItem(x,y,z,itemId,blockId,side)
{
if(itemId==392){
Entity.spawnMob(x,y+1,z,32,"mob/zombie.png");
} else if(itemId==393){
Entity.spawnMob(x,y+1,z,33,"mob/creeper.png");
} else if(itemId==394){
Entity.spawnMob(x,y+1,z,34,"mob/skeleton.png");
} else if(itemId==395){
Entity.spawnMob(x,y+1,z,35,"mob/spider.png");
} else if(itemId==396){
Entity.spawnMob(x,y+1,z,36,"mob/pigzombie.png");
} else if(itemId==397){
explode(x,y,z,3);
Player.addItemInventory(397,-1)
}
else if(itemId==398){
getTile(x,y,z);
setTile(x,y,z,0) }
else if(itemId==399){
getTile(x,y,z);
setTile(x,y,z,0)
setTile(x-1,y,z,0)
setTile(x,y,z-1,0)
setTile(x-1,y,z-1,0)
setTile(x+1,y,z+1,0)
setTile(x+1,y,z,0)
setTile(x,y,z+1,0)
setTile(x-1,y,z+1,0)
setTile(x+1,y,z-1,0)
} else if(itemId==400){
getTile(x,y,z);
setTile(x,y,z,0)
setTile(x-1,y,z,0)
setTile(x,y,z-1,0)
setTile(x-1,y,z-1,0)
setTile(x+1,y,z+1,0)
setTile(x+1,y,z,0)
setTile(x,y,z+1,0)
setTile(x-1,y,z+1,0)
setTile(x+1,y,z-1,0)
setTile(x+2,y,z,0)
setTile(x+2,y,z-1,0)
setTile(x+2,y,z-2,0)
setTile(x+2,y,z+1,0)
setTile(x+2,y,z+2,0)
setTile(x-2,y,z,0)
setTile(x-2,y,z-1,0)
setTile(x-2,y,z+1,0)
setTile(x-2,y,z+2,0)
setTile(x-2,y,z-1,0)
setTile(x-2,y,z-2,0)
setTile(x,y,z-2,0)
setTile(x,y,z+2,0)
setTile(x+1,y,z-2,0)
setTile(x+1,y,z+2,0)
setTile(x-1,y,z-2,0)
setTile(x-1,y,z+2,0)
} else if
(itemId==402){
var player = getPlayerEnt();
getTile(x,y,z);
setPosition(player,x+0.5,y+2.75,z+0.5);
}
else if(itemId==403&&blockId==1){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(1,1);
} else if(itemId==403&&blockId==2){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(2,1);
} else if(itemId==403&&blockId==3){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(3,1);
} else if(itemId==403&&blockId==4){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(4,1);
} else if(itemId==403&&blockId==5){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(5,1);
} else if(itemId==403&&blockId==6){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(6,1);
} else if(itemId==403&&blockId==1){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(6,1);
} else if(itemId==403&&blockId==12){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(12,1);
} else if(itemId==403&&blockId==13){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(13,1);
} else if(itemId==403&&blockId==14){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(14,1);
} else if(itemId==403&&blockId==15){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(15,1);
} else if(itemId==403&&blockId==16){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(16,1);
} else if(itemId==403&&blockId==17){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(17,1);
} else if(itemId==403&&blockId==18){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(18,1);
} else if(itemId==403&&blockId==20){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(20,1);
} else if(itemId==403&&blockId==21){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(21,1);
} else if(itemId==403&&blockId==22){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(22,1);
} else if(itemId==403&&blockId==24){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(24,1);
} else if(itemId==403&&blockId==26){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(26,1);
} else if(itemId==403&&blockId==28){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(28,1);
} else if(itemId==403&&blockId==30){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(30,1);
} else if(itemId==403&&blockId==35){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(35,1);
} else if(itemId==403&&blockId==41){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(41,1);
} else if(itemId==403&&blockId==42){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(42,1);
} else if(itemId==403&&blockId==45){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(45,1);
} else if(itemId==403&&blockId==46){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(46,1);
} else if(itemId==403&&blockId==47){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(47,1);
} else if(itemId==403&&blockId==48){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(48,1);
} else if(itemId==403&&blockId==49){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(49,1);
} else if(itemId==403&&blockId==53){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(53,1);
} else if(itemId==403&&blockId==54){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(54,1);
} else if(itemId==403&&blockId==56){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(56,1);
} else if(itemId==403&&blockId==57){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(57,1);
} else if(itemId==403&&blockId==58){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(58,1);
} else if(itemId==403&&blockId==65){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(65,1);
} else if(itemId==403&&blockId==73){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(73,1);
} else if(itemId==403&&blockId==67){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(67,1);
} else if(itemId==403&&blockId==74){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(74,1);
} else if(itemId==403&&blockId==78){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(78,1);
} else if(itemId==403&&blockId==79){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(79,1);
} else if(itemId==403&&blockId==80){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(80,1);
} else if(itemId==403&&blockId==81){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(81,1);
} else if(itemId==403&&blockId==82){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(82,1);
} else if(itemId==403&&blockId==85){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(85,1);
} else if(itemId==403&&blockId==87){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(87,1);
} else if(itemId==403&&blockId==89){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(89,1);
} else if(itemId==403&&blockId==98){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(98,1);
} else if(itemId==403&&blockId==102){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(102,1);
} else if(itemId==403&&blockId==103){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(103,1);
} else if(itemId==403&&blockId==108){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(108,1);
} else if(itemId==403&&blockId==109){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(109,1);
} else if(itemId==403&&blockId==112){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(112,1);
} else if(itemId==403&&blockId==114){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(114,1);
} else if(itemId==403&&blockId==128){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(128,1);
} else if(itemId==403&&blockId==128){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(128,1);
} else if(itemId==403&&blockId==155){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(155,1);
} else if(itemId==403&&blockId==156){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(156,1);
} else if(itemId==403&&blockId==245){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(245,1);
} else if(itemId==403&&blockId==246){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(246,1);
} else if(itemId==403&&blockId==247){
getTile(x,y,z);
setTile(x,y,z,0)
addItemInventory(247,1);
}
else if(itemId==404&&blockId==1){
addItemInventory(1,1);
} else if(itemId==404&&blockId==2){
addItemInventory(2,1);
} else if(itemId==404&&blockId==3){
addItemInventory(3,1);
} else if(itemId==404&&blockId==4){
addItemInventory(4,1);
} else if(itemId==404&&blockId==5){
addItemInventory(5,1);
} else if(itemId==404&&blockId==6){
addItemInventory(6,1);
} else if(itemId==404&&blockId==1){
addItemInventory(6,1);
} else if(itemId==404&&blockId==12){
addItemInventory(12,1);
} else if(itemId==404&&blockId==13){
addItemInventory(13,1);
} else if(itemId==404&&blockId==14){
addItemInventory(14,1);
} else if(itemId==404&&blockId==15){
addItemInventory(15,1);
} else if(itemId==404&&blockId==16){
addItemInventory(16,1);
} else if(itemId==404&&blockId==17){
addItemInventory(17,1);
} else if(itemId==404&&blockId==18){
addItemInventory(18,1);
} else if(itemId==404&&blockId==20){
addItemInventory(20,1);
} else if(itemId==404&&blockId==21){
addItemInventory(21,1);
} else if(itemId==404&&blockId==22){
addItemInventory(22,1);
} else if(itemId==404&&blockId==24){
addItemInventory(24,1);
} else if(itemId==404&&blockId==26){
addItemInventory(26,1);
} else if(itemId==404&&blockId==28){
addItemInventory(28,1);
} else if(itemId==404&&blockId==30){
addItemInventory(30,1);
} else if(itemId==404&&blockId==35){
addItemInventory(35,1);
} else if(itemId==404&&blockId==41){
addItemInventory(41,1);
} else if(itemId==404&&blockId==42){
addItemInventory(42,1);
} else if(itemId==404&&blockId==45){
addItemInventory(45,1);
} else if(itemId==404&&blockId==46){
addItemInventory(46,1);
} else if(itemId==404&&blockId==47){
addItemInventory(47,1);
} else if(itemId==404&&blockId==48){
addItemInventory(48,1);
} else if(itemId==404&&blockId==49){
addItemInventory(49,1);
} else if(itemId==404&&blockId==53){
addItemInventory(53,1);
} else if(itemId==404&&blockId==54){
addItemInventory(54,1);
} else if(itemId==404&&blockId==56){
addItemInventory(56,1);
} else if(itemId==404&&blockId==57){
addItemInventory(57,1);
} else if(itemId==404&&blockId==58){
addItemInventory(58,1);
} else if(itemId==404&&blockId==65){
addItemInventory(65,1);
} else if(itemId==404&&blockId==73){
addItemInventory(73,1);
} else if(itemId==404&&blockId==67){
addItemInventory(67,1);
} else if(itemId==404&&blockId==74){
addItemInventory(74,1);
} else if(itemId==404&&blockId==78){
addItemInventory(78,1);
} else if(itemId==404&&blockId==79){
addItemInventory(79,1);
} else if(itemId==404&&blockId==80){
addItemInventory(80,1);
} else if(itemId==404&&blockId==81){
addItemInventory(81,1);
} else if(itemId==404&&blockId==82){
addItemInventory(82,1);
} else if(itemId==404&&blockId==85){
addItemInventory(85,1);
} else if(itemId==404&&blockId==87){
addItemInventory(87,1);
} else if(itemId==404&&blockId==89){
addItemInventory(89,1);
} else if(itemId==404&&blockId==98){
addItemInventory(98,1);
} else if(itemId==404&&blockId==102){
addItemInventory(102,1);
} else if(itemId==404&&blockId==103){
addItemInventory(103,1);
} else if(itemId==404&&blockId==108){
addItemInventory(108,1);
} else if(itemId==404&&blockId==109){
addItemInventory(109,1);
} else if(itemId==404&&blockId==112){
addItemInventory(112,1);
} else if(itemId==404&&blockId==114){
addItemInventory(114,1);
} else if(itemId==404&&blockId==128){
addItemInventory(128,1);
} else if(itemId==404&&blockId==128){
addItemInventory(128,1);
} else if(itemId==404&&blockId==155){
addItemInventory(155,1);
} else if(itemId==404&&blockId==156){
addItemInventory(156,1);
} else if(itemId==404&&blockId==245){
addItemInventory(245,1);
} else if(itemId==404&&blockId==246){
addItemInventory(246,1);
} else if(itemId==404&&blockId==247){
addItemInventory(247,1);
}}
Still didn't work :/ It says "Too deep recursion while parsing" same as always.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThat means your script is too long. Is there a way to shorten that script?
Maybe put the item IDs in an array and check when you run the command if the block ID is inside the array?
(Yeah, I should fix that one of these days)
I knew that the code was too long, but I used the same exact code before and it worked fine. I think it has to do with Blocklauncher 1.4.6. Well hope you can fix it soon. I've tried to shorten it multiple times, but still doesn't work as well. Any idea what the max lines of code Blocklauncher is able to read?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI haven't checked. I'll deal with it soon.
That has nothing to do with it. The code is apparently too long. If that was the problem, I think it would just show a different item.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThe main problem is that Rhino parses the script recursively i.e. it does a
void parse() {
//do stuff
if (stillStuffLeft) parse()
}
so some devices are set up with more stack memory, letting Rhino parse longer scripts.
I can force Rhino to allocate more memory, but that takes actual work.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumInstead of doing Actual Worktm, I just told it to use more RAM
Try your script with the latest BlockLauncher: http://tinyw.in/bl