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

Banner

Started by MegaMech, 03 February 2013 - 03:51 PM
MegaMech #1
Posted 03 February 2013 - 04:51 PM
Not sure if anyone has made one of these before but here's my version!
I'm mostly posting it so I can find it later if I want to use it again. AND someone might find it a bit useful


I made it for a shop, it shows the name of your shop in this case "MegaMech's Shop" then it shows what your selling and your co-workers
It switches between these two, I wanted to have it all on one, but you can only have one scale() at a time. So it switches screens

Then another screen that pops up less is the "Featured" screen
It shows the featured item of the weak
ex. Enchanted books

Basically you put it in start up for when the chunk unloads and reloads the program continues running like normal.
Feel free to edit or use as you wish, just keep the puny little credit that I added in "–Created by MegaMech"

http://pastebin.com/07TiaHHc
Spoiler
function main()

  print("Running Banner")
  m = peripheral.wrap("back")
  m.clear()

end

main()

function banner()

  m.clear()
  m.setBackgroundColor(4096)
  m.setCursorPos(2,4)
  m.setTextScale(4)
  m.setTextColor(16)
  m.write("MegaMech's Shop")
  m.setCursorPos(2,6)
  m.write("Closed Forever")

end

function info()

  m.clear()
  m.setCursorPos(2,2)
  m.setTextScale(2)
  m.write("Selling:")
  m.setCursorPos(2,4)
  m.write("Charcoal")
  m.setCursorPos(2,5)
  m.write("RottenFlesh")
  m.setCursorPos(2,6)
  m.write("Cobblestone")
  m.setCursorPos(2,7)
  m.write("Dirt")
  m.setCursorPos(2,8)
  m.write("Enchanted Books")
  m.setCursorPos(2,9)
  m.write("[NEW]-Cactus")
  m.setCursorPos(2,10)
  m.write("[NEW]-Creosote Oil")
  --Shows shop Co-Workers and Helpers
  m.setCursorPos(21,2)
  m.write("Co-Workers:")
  m.setCursorPos(21,5)
  m.write("Matharama")
  m.setCursorPos(21,6)
  m.write("xzxproscopesxzx")

end

function Featured()

  m.clear()
  m.setTextScale(3)
  m.setCursorPos(6,2)
  m.write("FEATURED ITEMS")
  m.setCursorPos(7,3)
  m.write("OF THE WEEK:")
  m.setCursorPos(5,5)
  m.write("ENCHANTED BOOKS")
  m.setCursorPos(5,7)
  m.write("SADDLES")
  --m.setCursorPos(2,6)
  --m.write("")

end

function Splash()

  banner()
  sleep(3)
  info()
  sleep(5)
  banner()
  sleep(3)
  info()
  sleep(5)
  Featured()
  sleep(5)

end

while true do
  Splash()
end
armytricks #2
Posted 03 February 2013 - 10:12 PM
what size is the monitor
coryb2007 #3
Posted 14 February 2013 - 08:06 PM
That's pretty awesome, will help on my server with all the shops
BigSHinyToys #4
Posted 14 February 2013 - 08:52 PM
I made something similar to this for a server operator others here might find it interesting / useful
Spoiler

local name = "Food Stall..."
local products = "* Bread * Chicken Roast * Steak"

local mon = peripheral.wrap("back")
local function scroll(text)
local loop = text.."-"..text
for i = 1,#text do
  mon.clear()
  mon.setCursorPos(1,1)
  mon.write(string.sub(loop,i,#loop))
  sleep(1)
end
end
while true do
peripheral.call("back","setTextScale",5)
scroll(name)
scroll(name)
peripheral.call("back","setTextScale",1)
mon.clear()
mon.setCursorPos(1,1)
mon.write(products)
sleep(5)
end