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

Mystcraft Portal

Started by DjTranceFire, 05 May 2015 - 07:40 PM
DjTranceFire #1
Posted 05 May 2015 - 09:40 PM
Hey there.
after updating my modpack i ran into a problem with my Mystcraft/ComputerCraft setup.
For a long time i used these scripts to control my mystcraft portal with computercraft:
Portal: http://pastebin.com/Nc4rFkKh
Touchpoint: http://pastebin.com/PuPB8cj8

I already used google and found this post.

Seems like its working for the guy who opened the thread but i cant fix the problem.
After starting the portal code i only get

portal:82: attempt to index ? (a nil value)
Its obvious that mystcraft changed the way how books are named or something.
I tried to rename the books in an anvil but its still not working.
I also tried to change line 82 like in the thread i posted above but thats not working.

I realy hope someone here can help me to fix this problem.
Cant move in my world without my mystcraft portal! :(/>


Sorry for my bad english, i hope its not to hard to understand.
Lupus590 #2
Posted 05 May 2015 - 10:08 PM
This means that you've tried to access a key of a table that doesn't exist. If you're not working directly with tables, check the API call at the line number the error specifies (like `turtle.forward()` and such) to be sure that you haven't misspelled the name of the API. If for instance, you had `trutle.forward()` or `Turtle.forward()`, those would both result in this error. - http://www.computercraft.info/forums2/index.php?/topic/14531-read-this-post-before-asking-questions/#common_errors

I believe that it's your stackInfo table that is causing this error
there a some scripts which will print the contents of a table, these may help you with debugging
this is a good start for debugging

--#t = table to print
for k,v in pairs(t) do
  print(k..": "..v)
end
Lyqyd #3
Posted 05 May 2015 - 10:29 PM
Unrelated to the rest of the issues the script has that may prevent it from working, that version of the Touchpoint API is outdated, and the pastebin ID listed for it in the script is not the official one. It won't affect that script, as far as I can tell, but you won't be able to use anything added since that version of it was copied and re-pasted from the main paste.
Bomb Bloke #4
Posted 06 May 2015 - 01:32 AM
If memory serves, Direwolf wanted a "book name" key available when using OpenPeripherals to query information about MystCraft books in chests. The OpenPeripheral guys obliged, but I think they later took that feature out again.

Try changing line 82 to:

names[#names + 1] = {name = stackInfo[a]["display_name"],slot = a}