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

Help with printing read()

Started by ComputerCraftFan11, 21 April 2012 - 11:22 PM
ComputerCraftFan11 #1
Posted 22 April 2012 - 01:22 AM
I made this derpy 4262 line minebook code, but on the minebook wall it glitches.
http://pastebin.com/TseDVUBU

On line 4235 it says:

function wall()
print("USER WALL!!!")
print("")
print("Notch - WELCOMEA TH MEOMABOOOK!!!")
local x,y = term.getSize()
while true do
  term.setCursorPos(1, y)
  input = read()
  term.setCursorPos(1, pos)
  write(username.. " - " ..input)
  pos = pos+1
end
end

When it prints username.. "-" input, the thing prints correctly, but it prints to things.

Say i typed "Hello", this is what the screen will look like:

------
Minebook
------
xXm0dzXx - Hello



Hello
It prints hello twice for some reason
(And yes, i made it 4262 lines on purpose, here is it compacted:

local messages = 3
print("MINEBOOKn---")
write("Username: ")
input = read()
term.clear()
term.setCursorPos(1,1)

function wall()
  print("MINEBOOKn---")
  write("Status: ")
  status = read()
  term.setCursorPos(1, messages)
  write(input.. "-" ..status)
  messages = messages+1
  term.setCursorPos(1,2)
end
wall()
)
cant_delete_account #2
Posted 22 April 2012 - 01:37 AM
I looked at your code, WHY THE HELL USE SO MUCH A()S AND REDNET.OPENS?? That's like half of your code, just rednet.open!
(thinking of it, why did you make it have so much lines? xD)
ComputerCraftFan11 #3
Posted 22 April 2012 - 01:42 AM
I looked at your code, WHY THE HELL USE SO MUCH A()S AND REDNET.OPENS?? That's like half of your code, just rednet.open!
(thinking of it, why did you make it have so much lines? xD)

Yea…. i posted a compact version at the bottom

(this doesnt even use rednet xP)
OminousPenguin #4
Posted 22 April 2012 - 02:22 AM
Just wanted to voice my disgust at your code.
ComputerCraftFan11 #5
Posted 22 April 2012 - 02:23 AM
Just wanted to voice my disgust at your code.

Its beautiful, isn't it?
Cloudy #6
Posted 23 April 2012 - 11:44 AM
More like stupid. Don't expect any help if you pad your code out with many rednet.open's and tell us the error is on line 4235. Clean it up, or don't bother asking for help.
Advert #7
Posted 23 April 2012 - 04:21 PM
Really?