Jump to content




Help with printing read()


  • This topic is locked This topic is locked
6 replies to this topic

#1 ComputerCraftFan11

  • Members
  • 771 posts
  • LocationHawaii

Posted 22 April 2012 - 12: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()
)

#2 cant_delete_account

  • Members
  • 484 posts

Posted 22 April 2012 - 12: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)

#3 ComputerCraftFan11

  • Members
  • 771 posts
  • LocationHawaii

Posted 22 April 2012 - 12:42 AM

View Postthesbros, on 22 April 2012 - 12:37 AM, said:

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)

#4 OminousPenguin

  • Members
  • 93 posts

Posted 22 April 2012 - 01:22 AM

Just wanted to voice my disgust at your code.

#5 ComputerCraftFan11

  • Members
  • 771 posts
  • LocationHawaii

Posted 22 April 2012 - 01:23 AM

View PostOminousPenguin, on 22 April 2012 - 01:22 AM, said:

Just wanted to voice my disgust at your code.

Its beautiful, isn't it?

#6 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 23 April 2012 - 10: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.

#7 Advert

    Custom Title

  • Moderators
  • 459 posts
  • LocationLondon

Posted 23 April 2012 - 03:21 PM

Really?





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users