Jump to content
UBot Underground

Can't use PHP containing variables in SET command


Recommended Posts

From the beginning, here's the goal. The program will take each entry in a list column and incorporate it into a little strip of PHP code. It loops so the same snippet of PHP code is created for each item in the table column, pretty straight forward.

 

Here's what I have...

 

a loop, runs according to number of table rows. Table is saved as a csv file.

 

So basically the only problem is, and the above might be irrelevant, everytime I save a 'set' node containing the PHP code along with the variables I dragged in from the toolbox into their appropriate places in the code, the format of the set node contents change and basically remove the variables I dragged in.

 

Here's what the code looks like, this is what's actually INSIDE the set node...

if($comparison(#{#mcCurrentItem}, \"=\", \"true\")) \{
   then \{
       if($comparison(#{#mcCurrentItem}Quantity, \">\", 1)) \{
           then \{
               set(#weTotalWeight, $add(#weTotalWeight, $multiply(#{#mcCurrentItem}Quantity, {#mcCurrentWeight})), \"Global\")
           \}
           else \{
               set(#weTotalWeight, $add(#weTotalWeight, {#mcCurrentWeight}), \"Global\")
           \}
       \}
   \}
   else \{
   \}
\}

 

Notice all instances of #mcCurrentWeight, basically what's happening is I'm dragging the variables into the set node, which shows as the blue button thing from dragging the variable over, however when you save it the blue button thing goes away and is shown as text only exactly as shown above, needless to say it's not working.

 

I don't know if it's a bug or what.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...