In game documentation for computercraft peripherals (special open peripheral support)

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

casilleroatr

New Member
Jul 29, 2019
1,360
0
0
Try using generic for loops

they follow this format (assuming the name of the table is exampleTable
Code:
for k,v in pairs(exampleTable) do
  print(i)
  print(v)
end

A table contains several pieces of information (values) in what is known as keys. These are called key value pairs. The k and v in the generic for loop are variables (like in the more familiar numeric for loop) and the loop iterates though every key value pair, printing the name of the key, followed by the contents of the value.

Values can be any type of Lua variable. If it is a string, boolean or number it will print it out straightforwardly. If it is a function or a table you will get something like function:324r2034709 or table:98209344. This is not a bug or a problem. You can have nested generic for loops inside existing generic for loops to work through the nested tables until you have produced something that is human readable (or at least understandable) e.g.

Code:
for k,v in pairs(exampleTable) do
  if type(v) == "table" then
    for l,w in pairs(v) do
      --random code
    end
   else
     print(v)
   end
end

You can nest the loops as many times as is necessary just change the names of the k and v bit each time.

For more information look here

http://lua-users.org/wiki/TablesTutorial

If you still have problems then you will have to show your code. Everything you need to work through the tables can probably be found in that link but if there are any other problems we might be able to spot them in your code. Try using the generic for loop stuff first though.
 

colonelhomer815

New Member
Jul 29, 2019
20
0
0
One of the features of the program is supposed to allow users to view the amounts of different items in their AE system. This is done by entering the following chat commands whilst wearing terminal glasses linked to a bridge connected to the computer by peripheral cables:
$$addmon
$$the id of the item they wish to monitor
$$ the dv of the item they wish to monitor

The code seemed to work until I tried monitoring a second item at the same time causing an error I had earlier fixed to appear:
Smartglass:82: Parameter 'id' has null value, but is not marked as nullable

Would anyone be able to take a look at my code and help fix my problem?

Thanks in advance.
 

casilleroatr

New Member
Jul 29, 2019
1,360
0
0
One of the features of the program is supposed to allow users to view the amounts of different items in their AE system. This is done by entering the following chat commands whilst wearing terminal glasses linked to a bridge connected to the computer by peripheral cables:
$$addmon
$$the id of the item they wish to monitor
$$ the dv of the item they wish to monitor

The code seemed to work until I tried monitoring a second item at the same time causing an error I had earlier fixed to appear:
Smartglass:82: Parameter 'id' has null value, but is not marked as nullable

Would anyone be able to take a look at my code and help fix my problem?

Thanks in advance.
You should start a new thread to ask that question. Mod discussion will be fine, so will general chat too to be honest. I don't know anything about smartglasses and not everyone follows this thread so you are only limiting yourself by the amount of responses you might get by asking here.
 

df12341

New Member
Jul 29, 2019
1
0
0
A bit late, but if you could update this it would be awesome, running CC 1.65 on DW20 1.7.10 pack, Doesnt detect anything, not vanilla chests, or anything else I tested. If not I understand cause its an old thread. Thanks in advanced