Script Issues

Need help with your script? Want to know how to do something? Want to post an example? Post it here!

Script Issues

Postby Acouya » Tue Nov 03, 2015 11:38 am

I have been trying to learn this mod's code for a little while now by trying to modify the reinforced watering can's recipe to not need a soul shard and use a normal watering can instead of a bowl, but I have been having issues that I don't understand while I have been. I feel like some of these are really obvious but I am too noob to figure them out.

My script is
: [Select all] [/] [] ()
// Script Intro
print("Soul Fragment Removed")
// Variables
// var Bedrockium = <ExtraUtilities:bedrockiumingot>
// var ReinforcedWateringCan = <ExtraUtilities:wateringcan:3>
// Removing recipes
recipes.remove(<ExtraUtilities:wateringcan:3>);
// Adding recipes
recipes.addShaped(<ExtraUtilities:wateringcan:3>),[[ExtraUtilities:bedrockiumingot, null, null],
 [ExtraUtilities:bedrockiumingot, <ExtraUtilities:wateringcan>, ExtraUtilities:bedrockiumingot],
 [null, ExtraUtilities:bedrockiumingot, null]];
GeSHi © Codebox Plus


And my most recent error has been
ERROR: error parsing scripts.zs:7 -- : expected
Acouya
 
Posts: 1
Joined: Tue Nov 03, 2015 11:32 am

Re: Script Issues

Postby ZeroLevels » Wed Nov 04, 2015 8:27 pm

First of all, you need to end almost every line with a semicolon, unless you spaced something out over several lines, such as your recipe at the end. The semicolon tells the script that it's done executing that method/function. If you don't include them, the script just continues on to the next line thinking it's still part of the first one.

Next, several of the items you're specifying in your recipe aren't surrounded by angle brackets, which they always need to be unless you're using a variable that you've defined elsewhere (which itself will still need you to use the angle brackets). As in, "minecraft:bucket" won't work. It has to be "<minecraft:bucket>". You did it right in your variables, but didn't use your variables later. I assume this is because you don't know why your script was failing and you were trying to find the problem.

Lastly, You closed the parenthesis in your recipe too soon (right after specifying the output of your recipe). You're supposed to put the closing parenthesis after the last closing bracket.

Try this version of the script:
: [Select all] [/] [] ()
// Script Intro
   print("Soul Fragment Removed");
// Variables
   var Bedrockium = <ExtraUtilities:bedrockiumingot>;
   var ReinforcedWateringCan = <ExtraUtilities:wateringcan:3>;
// Removing recipes
   recipes.remove(ReinforcedWateringCan);
// Adding recipes
   recipes.addShaped(ReinforcedWateringCan,[
      [Bedrockium, null, null],
      [Bedrockium, <ExtraUtilities:wateringcan>, Bedrockium],
      [null, Bedrockium, null]
   ]);
GeSHi © Codebox Plus
Having trouble developing your scripts? Get NEI Integration by tonius111. Once installed, enable these 3 configuration settings:
  • B:"Fluid Registry"=true
  • B:"Ore Dictionary"=true
  • B:"Internal Name"=true
User avatar
ZeroLevels
 
Posts: 78
Joined: Thu Mar 12, 2015 10:59 pm

Re: Script Issues

Postby untetracke » Wed Sep 16, 2020 6:44 am

i love this blog
I have been trying the codes that are placed on it to learn and understand these codes to use them in games. You should use is college-paper.org discount to understand the logic of programs or codes.
untetracke
 
Posts: 1
Joined: Wed Sep 16, 2020 6:41 am


Return to Scripting Help

Who is online

Users browsing this forum: No registered users and 10 guests

cron