Hello All. I am trying to wrap my head around Lua, and having some problems. Kodos and Sangar have both assisted me in IRC, but when I try to implement it ingame, I get errors.
I am Building Rules, Staff, Events, etc... Boards at our Spawn.
The Goal is to have a Static Screen on Top, Showing the word Rules,
While the Larger Screen below it scrolls our server Rules.
I can get either part to work alone, but adding the second monitor breaks everything.
I know I am just missing something in my Syntax, but I have tried to follow the examples, and am coming up short.
This file is set as my Autorun.lua for our Rules Monitor
I know the addresses for the 2 screens are correct.
for line 5 I have tried
local component.gpu.bind("d538b568")
but it throws errors also. The current code gives me a
/autorun.lua:5: unexpected symbol near '.'
the require("event") is just in there, so I can Break out of the while true loop, to edit Rules, etc.. I know that doing so throws an error, but No Player will ever be able to Click the Monitor, or have access to the Computer.
I am Loving this mod, and it's realism over the "other" mod,
but am finding the documentation to be very hard to learn from.
I look forward to properly learning to code with this mod,
and had figured that this "simple" script would be a good place to start.
local comp = require("component")
local event = require("event")
local gpu = comp.gpu
while true do
local comp.gpu.bind("d538b568")
gpu.setResolution(5, 1)
gpu.setBackground(0XFFFF00)
gpu.setForeground(0XFF0000)
print("RULES")
local comp.gpu.bind("c5d82d9c")
gpu.setResolution(30, 6)
gpu.setBackground(0XFF0000)
gpu.setForeground(0X00CC00)
print("")
print("No PVP in Survival Map")
print("We have an Anarchy World")
print("and Arenas for PVP")
print("")
os.sleep(3)
print("No Grief in Survival")
print("Raiding IS allowed in")
print("Areas NOT Claimed by a Town")
print("")
os.sleep(3)
print("Grief and PVP are")
print("Encouraged in the")
print("Anarchy Map")
print("")
os.sleep(3)
print("")
print("")
print("No Asking for Staff Positions")
print("")
os.sleep(3)
print("No Excessive Swearing")
print("ie: The Desire to Fornicate")
print("with Feces. Needs to only be")
print("Stated ONCE ")
os.sleep(3)
end
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hello All. I am trying to wrap my head around Lua, and having some problems.
Kodos and Sangar have both assisted me in IRC, but when I try to implement it ingame, I get errors.
I am Building Rules, Staff, Events, etc... Boards at our Spawn.
The Goal is to have a Static Screen on Top, Showing the word Rules,
While the Larger Screen below it scrolls our server Rules.
I can get either part to work alone, but adding the second monitor breaks everything.
I know I am just missing something in my Syntax, but I have tried to follow the examples, and am coming up short.
This file is set as my Autorun.lua for our Rules Monitor
I know the addresses for the 2 screens are correct.
for line 5 I have tried
but it throws errors also. The current code gives me a
/autorun.lua:5: unexpected symbol near '.'
the require("event") is just in there, so I can Break out of the while true loop, to edit Rules, etc..
I know that doing so throws an error, but No Player will ever be able to Click the Monitor, or have access to the Computer.
I am Loving this mod, and it's realism over the "other" mod,
but am finding the documentation to be very hard to learn from.
I look forward to properly learning to code with this mod,
and had figured that this "simple" script would be a good place to start.
Link to post
Share on other sites