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

Computercraft/minecraft Bug

Started by RoD, 26 July 2013 - 06:39 PM
RoD #1
Posted 26 July 2013 - 08:39 PM
So i was trying to test a code in my cc emulator(wich is kinda glitchy yet) and i tryed to make a simple pull event code and it won't work…Well i supoused that the problem was in the emulator but then i got in minecraft and i typed the program and it got the same error:
slc:12: attempt to call nil
I know this error for a long time and i know how to fix it(most times) but then i copy the tutorial code form the wiki just for testing:
Spoiler

function clear()
   term.clear()
   term.setCursorPos (1,1)
end
while true do
   clear()
   print ("Press E to do something.")
   local event, param1 = os.pullEvent ("char") -- limit os.pullEvent to the char event
   if param1 == "e" then -- if the returned value was 'e'
	   clear()
	   write ("Name: ")
	   local name = read()
	   print (name)
	   break
   else
	   clear()
	   print ("Wrong button!")
	   sleep (1.5) -- I don't like a whole 2 seconds but 1 second is too short
   end
end
and i got the same error (so i supouse that is not code error)
then i tryed exit the world…i did, but when i join the world again its all laggy and minecraft crashes…
So idk whats happening..I have some pc's in the world but not to many ( 25 ) and the only mods i have beside computercraft is forge(obvious :P/>) and optifine.
I created another world and minecraft crashed again…The crash report:
Spoiler—- Minecraft Crash Report —-
// Ooh. Shiny.

Time: 27-07-2013 1:37
Description: Exception in server tick loop

java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.createEntry(Unknown Source)
at java.util.HashMap.addEntry(Unknown Source)
at java.util.HashMap.put(Unknown Source)
at net.minecraft.nbt.NBTTagCompound.func_74768_a(SourceFile:61)
at net.minecraft.world.chunk.storage.AnvilChunkLoader.func_75820_a(AnvilChunkLoader.java:340)
at net.minecraft.world.chunk.storage.AnvilChunkLoader.func_75816_a(AnvilChunkLoader.java:127)
at net.minecraft.world.gen.ChunkProviderServer.func_73242_b(ChunkProviderServer.java:232)
at net.minecraft.world.gen.ChunkProviderServer.func_73151_a(ChunkProviderServer.java:284)
at net.minecraft.world.WorldServer.func_73044_a(WorldServer.java:906)
at net.minecraft.server.MinecraftServer.func_71267_a(MinecraftServer.java:346)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:122)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:470)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573)


A detailed walkthrough of the error, its code path and all known details is as follows:
—————————————————————————————

– System Details –
Details:
Minecraft Version: 1.5.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_25, Oracle Corporation
Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 59891712 bytes (57 MB) / 477233152 bytes (455 MB) up to 477233152 bytes (455 MB)
JVM Flags: 2 total; -Xms512m -Xmx512m
AABB Pool Size: 2291 (128296 bytes; 0 MB) allocated, 2291 (128296 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 63
FML: MCP v7.51 FML v5.2.23.736 Minecraft Forge 7.8.0.736 5 mods loaded, 5 mods active
mcp{7.51} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
FML{5.2.23.736} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
Forge{7.8.0.736} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
ComputerCraft{1.53} [ComputerCraft] (ComputerCraft-Mod-1.5.2.zip) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
CCTurtle{1.53} [ComputerCraft Turtles] (ComputerCraft-Mod-1.5.2.zip) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 2980 (166880 bytes; 0 MB) allocated, 2980 (166880 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['Rodmastercraft'/54317, l='Novo Mundo', x=29,50, y=75,00, z=-138,50]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
after the crash i started minecraft again, and entered that new world(a little laggy) but the error was gone…
Sorry for my bad english XD
Lyqyd #2
Posted 28 July 2013 - 12:17 AM
Moved to Ask a Pro.

Please provide the original code you used that gave you an error on line twelve.
Apfeldstrudel #3
Posted 28 July 2013 - 03:43 AM
Out of RAM? I would guess…
RoD #4
Posted 28 July 2013 - 08:06 AM
Moved to Ask a Pro.

Please provide the original code you used that gave you an error on line twelve.
Thats the strange part…The code that i found on the wiki was giving the error too O.o in other worlds it work but in that world i got the error
Tiin57 #5
Posted 28 July 2013 - 10:36 AM
You shouldn't run Minecraft with less that 1GB of RAM, and no less than 1.5 when modded.
Lyqyd #6
Posted 28 July 2013 - 01:27 PM
Moved to Ask a Pro.

Please provide the original code you used that gave you an error on line twelve.
Thats the strange part…The code that i found on the wiki was giving the error too O.o in other worlds it work but in that world i got the error

Then provide the error message that you were getting with that code! It's useless to try to figure out what's going on if you don't give us code and an error message that match each other.
ratchetgame98 #7
Posted 29 July 2013 - 05:11 AM
You shouldn't run Minecraft with less that 1GB of RAM, and no less than 1.5 when modded.
It says as system requirements that you need at least 2GB of RAM apparently, but somehow I've managed to run vanilla minecraft with 800MB before. Now I have 1918MB, minecraft works a bit better, but loading minecraft, with mods, is very slow
RoD #8
Posted 29 July 2013 - 05:33 AM
Moved to Ask a Pro.

Please provide the original code you used that gave you an error on line twelve.
Thats the strange part…The code that i found on the wiki was giving the error too O.o in other worlds it work but in that world i got the error

Then provide the error message that you were getting with that code! It's useless to try to figure out what's going on if you don't give us code and an error message that match each other.
The error was the same for the both codes:
slc:12: attempt to call nil

Ok, so i increased the minecraft memmory to 2G and the error was still there, and when i edit my program like :"edit slc" this error came up:
edit:386:attenpt to call nil

the code apears in the screen but then it returns to the console.
i noticed that the cc emulator was giving the same error so maybe java(?)
i increased the minecraft memory to 4G but the error was there XD
So in a new world it works…i think the world might have a program that is making a conflict or something in there that's doing this…
Lyqyd #9
Posted 29 July 2013 - 10:29 AM
Please paste your startup file for the affected computers, as well as anything you run before receiving the error.
RoD #10
Posted 29 July 2013 - 01:57 PM
Please paste your startup file for the affected computers, as well as anything you run before receiving the error.
I ran this codes before this happen:
Spoiler

while true do
event, disk, n, dist = os.pullEvent()
if event == "rednet_message" then
print(n)
else
end
if disk.isPresent("left") then
print("lol")
sleep(1)
disc = fs.open("disk/.numb", "r")
num = disc.readAll()
numb = fs.open(".n", "r")
filen = numb.readAll()
if num == filen then
tim = os.time()
write(tim..num)
else
end
end
end
SpoilerThis one might be the error because i was working on it when the error start happening:

rednet.open("top")
if disk.isPresent("right") == false then
print("Please insert a disk in the drive")
return
end
function writed()
local datao = fs.open(".data","w")
datao.write(data)
datao.close()
end
local file = fs.open(".data", "r" )
if file then
l = file.readAll()
end
if l == "" or fs.exists(".data") == false then
write("No data, please enter manually the number:")
data = read()
writed()
return
end
n=l+1
write("Password:")
pass = read("*")
if pass == "data123" then
local disc = fs.open("disk/.numb","w")
disc.write(n)
disc.close()
local numb = fs.open(".data","w")
numb.write(n)
numb.close()
else
print("Incorrect password")
return
end
rednet.send(24, n)
Spoilerand i have a file created by that program, the ".data" file:

4.0
Thats the codes i was working on (an the code from the wiki for testing )