Jump to content




Question easy monitor print

game help computer

7 replies to this topic

#1 gheotic

  • Members
  • 64 posts
  • LocationDenmark

Posted 22 July 2012 - 12:46 AM

Hello every on who is reading this =)

i have been working on a program for the last few days, but haven't got further at all, because it's i really thinks it looks complicated, i have coded before but that wasn't that complicated not at all. I have watched lots of videos and searched lot.
Now i kinda gave up trying doing this on my own. Its now necessary to make this i just want to know how to do it and learn more how to make my own programs in Computercraft =)

the program i want to make is:

i have a computer on the inside of my base in my friend's server, and a 2x2 monitor on facing outside. I want to be able to from the inside of my base print stuff on the monitor easy, without doing loads of commands, just 1 simple menu.
So i could print sentence like eg. I will be right back or Welcome to Gheotic's house.


my problems is kinda to make it check instantly if there is an input, and print it on the monitor at the same time on the computer.

I know this is very silly to ask if someone could do it but i have tried this for so long time but haven't got further.

i don't wanna command anyone to help me just do it if you feel like you want to, because i don't think i actually deserve help cause i haven't helped anyone by myself.

Picture here:
Attached Image: 2012-07-22_02.25.16.png


Thanks =)

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 22 July 2012 - 01:11 AM

You mean something like:

print("Please input a message:")
input = read()

local mon = nil

for _,s in pairs(rs.getSides()) do
    if peripheral.type(s) == "monitor" then
        mon = peripheral.wrap(s)
        break
    end
end

if mon then
    mon.clear()
    mon.setCursorPos(1,1)
    mon.write(input)
else
    print("No monitor attached!")
    sleep(1)
end

term.clear()
term.setCursorPos(1,1)
term.write(input)


#3 gheotic

  • Members
  • 64 posts
  • LocationDenmark

Posted 22 July 2012 - 10:29 PM

View PostLyqyd, on 22 July 2012 - 01:11 AM, said:

You mean something like:

print("Please input a message:")
input = read()

local mon = nil

for _,s in pairs(rs.getSides()) do
	if peripheral.type(s) == "monitor" then
		mon = peripheral.wrap(s)
		break
	end
end

if mon then
	mon.clear()
	mon.setCursorPos(1,1)
	mon.write(input)
else
	print("No monitor attached!")
	sleep(1)
end

term.clear()
term.setCursorPos(1,1)
term.write(input)


Thanks for the reply i really appreciate your time but i get the error monitortest:7: attempt to call nil

i have a no idea why?

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 22 July 2012 - 11:39 PM

My mistake. peripheral.type should actually be peripheral.getType.

#5 gheotic

  • Members
  • 64 posts
  • LocationDenmark

Posted 23 July 2012 - 11:57 AM

Thank you so much =)

#6 weareborg2913

  • Members
  • 10 posts

Posted 23 November 2012 - 05:04 PM

Hey is there anyway to set the text size?

#7 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 23 November 2012 - 05:14 PM

It'd be good to not resurrect such old topics. ;)/>

In this case, mon.setTextScale() just before the mon.write(input) should do what you want. mon.setTextScale takes anything between 0.5 and 5, in increments of 0.5, and it will only work for the monitor.

#8 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 23 November 2012 - 05:15 PM

View Postweareborg2913, on 23 November 2012 - 05:04 PM, said:

Hey is there anyway to set the text size?
You're not really supposed to bump months old threads. And use the search function: http://www.computerc...__fromsearch__1 ;)/>
Edit: Ninja Lyqyd beat me to it again -_-/>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users