Jump to content




Redstone Input triggering a printer?


  • You cannot reply to this topic
3 replies to this topic

#1 Tassyr

  • Members
  • 80 posts

Posted 29 March 2013 - 11:48 PM

So, long story short, title. I'm trying to figure how to do something- I have a computer system that outputs a redstone signal every time it's triggered. I suddenly realized I should be able to use this to make a logger- to tell when this system (a large door) was opened or closed.

Catch is... I'm stumbling. My plan was to have the printer tag each line with "X was activated on X time," Then go to the next line, until the page is full, then start another... I'm running into a brick wall, and I've completely scrapped my original idea. Is there a tutorial I should be looking at?

#2 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 30 March 2013 - 12:16 AM

You can do something like this:
while true do
    local ev = os.pullEvent("redstone");
    -- Do stuff(this will be run when the computer receives a redstone signal)
end


#3 Tassyr

  • Members
  • 80 posts

Posted 30 March 2013 - 12:22 AM

Erm, I got that part working- sorry, blame sleep dep for my vagueness. What I mean is how do I get the printer to not run off the end of the page as if drunk? And how do I get the printer to print happily? I can get the info to show on the SCREEN but not on the printer happily.

I can get it to print ONE line to a printer page, but I can't get this effect:
"Circuit was triggered at X"

"Circuit was triggered at X"

"Circuit was triggered at X"

"Circuit was triggered at X"

"Circuit was triggered at X"

*NEW PAGE*


"Circuit was triggered at X"

#4 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 30 March 2013 - 01:22 AM

Have a variable count how many times it has printed the text and then:

if times % 5 == 0 then
    printer.newPage()
end

Will just make the printer have a new page every 5 times





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users