Hi, All! I'm brand new here, and I'm a complete beginner with Lua, so please bear with me.
My son and I are building an airport, and I, ever the overachiever, decided I want to make it fancy. I am attempting to make screens that display flight information, similar to what you would see in an airport. Here's an example of how I would like for it to appear:
Arrivals -- ALL text would be white
Airline Flight Arriving From Gate Status -- This line, the background would be dark blue
Delta 1427 Nashville, TN B8 On Time -- This line, the background would be blue
Southwest 632 Phoenix, AZ A5 Delayed -- This line, the background would be light blue
I have the basic program written, and it works. But it's so plain...it needs some flair!
Unfortunately, the only way I can figure out how to add color to it is to change the foreground/background colors in the gpu. And that doesn't change line by line, just the whole thing... and it resets if the system is rebooted .
So, Here I am...Please help me make our Airport awesome!
The code is basically like this, only the arrays are much bigger: (And I apoligize for redundancy and/or noob mistakes in the code...As I said, I'm brand new to Lua. Suggestions are welcome.
math.randomseed(os.time())
Airline = {"Delta ", "American Airlines", "Southwest "}
Flight = math.random(100,2000)
Arrival = {"Nashville, TN ", "Chicago, IL ", "Phoenix, AZ ", "Dallas, TX "}
Gate = {"A", "B"}
Number = math.random(1,8)
Time = math.random(0100,2400)
Status = {" On Time", "Delayed ", "Cancelled"}
print(" Arrivals ")
print(" ")
print(" Airline Flight Arriving From Gate Time Status")
print(" ")
print(" " .. Airline[math.random(1,#Airline)] .. " " .. Flight .. " " .. Arrival[math.random(1,#Arrival)].. " " .. Gate[math.random(1,#Gate)] .. Number .. " " .. Time .. " " .. Status[math.random(1,#Status)].. " ")
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.
Hi, All! I'm brand new here, and I'm a complete beginner with Lua, so please bear with me.
My son and I are building an airport, and I, ever the overachiever, decided I want to make it fancy. I am attempting to make screens that display flight information, similar to what you would see in an airport. Here's an example of how I would like for it to appear:
I have the basic program written, and it works. But it's so plain...it needs some flair!
Unfortunately, the only way I can figure out how to add color to it is to change the foreground/background colors in the gpu. And that doesn't change line by line, just the whole thing... and it resets if the system is rebooted .
So, Here I am...Please help me make our Airport awesome!
The code is basically like this, only the arrays are much bigger: (And I apoligize for redundancy and/or noob mistakes in the code...As I said, I'm brand new to Lua. Suggestions are welcome.
Link to post
Share on other sites