This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
davidgumazon's profile picture

NEI Required? and Return Table (Function) Error

Started by davidgumazon, 23 June 2015 - 12:05 PM
davidgumazon #1
Posted 23 June 2015 - 02:05 PM
Hey Guys! i'm Confuse about this Things (cuz i'm not familiar this acronym)

is NEI is Really Required? to fix other recipe's mods? for ComputerCraft
i'm Confuse cuz Alot of People use this Acronym :// and i dont understand

please anyone answer my simple question…

and

if i do this Function it gives nil, im confuse i need this function

function returnTable(...) ... end --Load Function for..
example={"blabal","lololol","just example ;)/>"}
local param1,param2,param3=returnTable(example)
--example hav 3 table or more param for returnTable(...)
this my returnTable Code

function returnTable(_)
retset="return "
for i=1,#_ do
  retset=retset.._[i]..','
end
ls=loadstring(retset)
ls()
end
wieselkatze #2
Posted 23 June 2015 - 07:05 PM
So you basically want you table split up in separate values? The following code would do aswell:


local yourTable = {
	"value 1";
	"value 2";
	"value 3";
}

local val_1, val_2, val_3 = unpack( yourTable )

unpack() is a builtin lua function, you can find some information here - bottom half of the page.

I don't really know what you mean with 'Is NEI required to fix others' mods recipes' - NEI is just there to display all the registered recipes. Also it lets you do some tweaks, e.g. changing weather, time etc..
Edited on 23 June 2015 - 05:06 PM
HPWebcamAble #3
Posted 24 June 2015 - 12:51 AM
Hey Guys! i'm Confuse about this Things (cuz i'm not familiar this acronym)

is NEI is Really Required?

What made you think it was required?

You shouldn't need it, but it is by far the best mod for recipes, since it can automatically determine vanilla recipes, and plugins allow it to display modded machine recipes

It stands for Not Enough Items, which is a word play on the mod Too Many Items, which had the ability to only cheat in items (Don't think it can show recipes)
Bomb Bloke #4
Posted 24 June 2015 - 12:55 AM
wieselkatze is right, you should be using the unpack() function.

But as to why your function doesn't work, the "retset" string it constructs would end up looking like this:

return blabal,lololol,just example ;)/>,

Whereas you would want it to look like this:

return "blabal","lololol","just example ;)/>"

The last line, "ls()", should also've been written as "return ls()".
davidgumazon #5
Posted 24 June 2015 - 11:45 AM
So you basically want you table split up in separate values? The following code would do aswell:


local yourTable = {
	"value 1";
	"value 2";
	"value 3";
}

local val_1, val_2, val_3 = unpack( yourTable )

unpack() is a builtin lua function, you can find some information here - bottom half of the page.

I don't really know what you mean with 'Is NEI required to fix others' mods recipes' - NEI is just there to display all the registered recipes. Also it lets you do some tweaks, e.g. changing weather, time etc..

local val_1, val_2, val_3 = unpack( yourTable )
ur Code Returns Limited but i need Returns Infinitely it Returns How much Table is there
example : #var1 is 4, #var2 is 18 then i do

param1,param2,param3,param4=returnTable(var1)
param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10,param_11,param_12,param_13,param_14,param_15,param_16,param_17,param_18=returnTable(var2)
so the API i talk about is how much Table Stored in Variable it returns How Much Stored Tables there, ill try ur code later (cuz ill update my minecraft forge & mods)

Hey Guys! i'm Confuse about this Things (cuz i'm not familiar this acronym)

is NEI is Really Required?

What made you think it was required?

You shouldn't need it, but it is by far the best mod for recipes, since it can automatically determine vanilla recipes, and plugins allow it to display modded machine recipes

It stands for Not Enough Items, which is a word play on the mod Too Many Items, which had the ability to only cheat in items (Don't think it can show recipes)
cuz after hear NEI on my bug Report in http://www.computercraft.info/forums2/index.php?/topic/22512-173-bug-alert-lol-cant-craft-xd/page__p__210799#entry210799 you can see Comments Scenes are …, @Dan200 says "…NEI recipe bug… fixed…" that's why made me think it was required -__-
and Thanks for the Acronym , i feel refresh about "NEI"
(o_o) wait NEI is 3, Not Enough Items is 3 Sentence, it means 6, NEI's acronym "Enough" col is 6, so it says ENOUGH, and NEI word was Weird and i heard this word from song *..Watch me NEI NEI..* 2 NEI in that song my costomers in my Cafe dont stop playing that song so i want to tell them "Enough", it means 0_0 i was Fool, … , #illumiPizza_Confirmed

wieselkatze is right, you should be using the unpack() function.

But as to why your function doesn't work, the "retset" string it constructs would end up looking like this:

return blabal,lololol,just example ;)/>/>,

Whereas you would want it to look like this:

return "blabal","lololol","just example ;)/>/>"

The last line, "ls()", should also've been written as "return ls()".
Thanks ;D ill Fix my Code Later (cuz ill update my Minecraft Forge & Mods)
KingofGamesYami #6
Posted 24 June 2015 - 03:22 PM
unpack is not limited. It returns the number of items in a table; if that's 200, you get 200 results.
davidgumazon #7
Posted 24 June 2015 - 04:14 PM
unpack is not limited. It returns the number of items in a table; if that's 200, you get 200 results.
i know ._. , i talking about —> local val_1,val_2,val_3 <— #Limited
hmm unpack might be useful for my API Project

3 Parameters, triangle has 3 sides, 3+3=6, 6/2=3, pizza has 3 sides and 3 hunger regen
*it can be i was fool again* #illumipizza_confirmed
wieselkatze #8
Posted 24 June 2015 - 05:14 PM
I don't know if you got it, but the names I used are just sample names for variables. It could aswell just be the following:


local a, b, c, d, e, f, g, h = unpack( yourTable )

or


local f1, g2, h3, i4, j5, k6, l7 = unpack( yourTable )

As the name says - they are variable. Just the same as your 'param1,param2,param3' etc.
Edited on 24 June 2015 - 03:15 PM
Bomb Bloke #9
Posted 25 June 2015 - 02:03 AM
cuz after hear NEI on my bug Report in http://www.computercraft.info/forums2/index.php?/topic/22512-173-bug-alert-lol-cant-craft-xd/page__p__210799#entry210799 you can see Comments Scenes are …, @Dan200 says "…NEI recipe bug… fixed…" that's why made me think it was required -__-

Apparently mods have to tell NEI what their recipes are, so NEI can show those recipes to players. Dan had made a mistake causing the Advanced Computer recipe to display an incorrect component. It only affected people who actually had NEI installed.
davidgumazon #10
Posted 27 June 2015 - 08:20 AM
I don't know if you got it, but the names I used are just sample names for variables. It could aswell just be the following:


local a, b, c, d, e, f, g, h = unpack( yourTable )

or


local f1, g2, h3, i4, j5, k6, l7 = unpack( yourTable )

As the name says - they are variable. Just the same as your 'param1,param2,param3' etc.
k, for me i use loadstring for infinitely results and i get ERROR cuz i didn't add local variable

cuz after hear NEI on my bug Report in http://www.computerc...799#entry210799 you can see Comments Scenes are …, @Dan200 says "…NEI recipe bug… fixed…" that's why made me think it was required -__-

Apparently mods have to tell NEI what their recipes are, so NEI can show those recipes to players. Dan had made a mistake causing the Advanced Computer recipe to display an incorrect component. It only affected people who actually had NEI installed.
i use CraftGuide Mod but before i report Recipe Bug in this forum, craftguide mod tells me advance computer's recipe normally when i tried to craft advance computer nothing happens then i double check craftguide it doesn't work again -_-/> so i report the bug, i hope @Dan200 fix that recipe bug

#imbadgrammur