Jump to content




How to print this on a a monitor


9 replies to this topic

#1 Blade_Black

  • New Members
  • 4 posts

Posted 28 August 2012 - 02:05 PM

On my server i wanted to try to make a virus just for fun and i wanted to display it on a big monitor but i didnt figured out how.

Code:

a = 0
term.clear()
while true do
if a == 100 then
term.clear()
a = 0
end
term.setCursorPos(15.9)
print("Virus Detected...Auto-Destruct Enabled")
x = math.random(1,16)
y = math.random(1,50)
term.setCursorPos(y,x)
print("0")
sleep(.000000000000000000000000000000000000000000000000)
a = a + 1
end


Thx For your time
-Blade_Black

#2 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 28 August 2012 - 02:27 PM

mon = pheripheral.wrap("side") --Change side to what side monitor is on
a = 0
term.clear()
while true do
if a == 100 then
term.clear()
a = 0
end
term.setCursorPos(15.9)
mon.write("Virus Detected...Auto-Destruct Enabled")
x = math.random(1,16)
y = math.random(1,50)
term.setCursorPos(y,x)
mon.write("0")
sleep(.000000000000000000000000000000000000000000000000)
a = a + 1
end


#3 Blade_Black

  • New Members
  • 4 posts

Posted 28 August 2012 - 03:25 PM

It gives me a error:

startup:1: attempt to index ? (a nil value)

#4 ThinkInvisible

  • Members
  • 24 posts

Posted 28 August 2012 - 03:30 PM

peripheral, not pheripheral.

#5 Blade_Black

  • New Members
  • 4 posts

Posted 28 August 2012 - 03:34 PM

One more thing... The program should spam wiht 0 in different zones but it doesnt even shows the full text (Virus detected)

#6 Dirkus7

  • Members
  • 148 posts
  • Locationthe Netherlands

Posted 28 August 2012 - 03:48 PM

Shouldn't it be mon.setCursorPos(x,y) instead of term.setCursorPos(x,y)?

#7 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 28 August 2012 - 03:55 PM

View PostDirkus7, on 28 August 2012 - 03:48 PM, said:

Shouldn't it be mon.setCursorPos(x,y) instead of term.setCursorPos(x,y)?
It should. I over looked it.

View PostThinkInvisible, on 28 August 2012 - 03:30 PM, said:

peripheral, not pheripheral.
Ops. my bad. Thanks

#8 Blade_Black

  • New Members
  • 4 posts

Posted 28 August 2012 - 03:55 PM

It didnt worked
it gives me another error:

startup:1: attempt to index ? (a nil value)

can you post the whole code?

#9 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 28 August 2012 - 04:07 PM

mon = peripheral.wrap("side") --make the first line this. REpleace the exisisting one. Change side to what side monitor is on.


#10 cant_delete_account

  • Members
  • 484 posts

Posted 28 August 2012 - 05:43 PM

Just use:
local mon = peripheral.wrap("side") -- change side to side of monitor
term.redirect(mon)
local a = 0
term.clear()
while true do
if a == 100 then
term.clear()
a = 0
end
term.setCursorPos(15.9)
print("Virus Detected...Auto-Destruct Enabled")
x = math.random(1,16)
y = math.random(1,50)
term.setCursorPos(y,x)
print("0")
sleep(.000000000000000000000000000000000000000000000000)
a = a + 1
end
term.restore()






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users