Posted 21 December 2013 - 03:57 PM
Heyo there,
I've recently found the awesome email client/server by NitrogenFingers and got myself a copy and modified it to my needs (Of course by keeping his name in it).
Now I've extended the range of wireless modems from 50 to 10000000 (Simply so it'll work over most of the server) and to make this easy for users to use, I wanted to create a GUI installer.
I've used Lua to code basic things and a login system (Thanks to the person who helped me there!) but for whatever reason, when I attempt to use functions myself, I always get an error: Attempt to call nil.
Here's the code so far:
As soon as I execute the program I get:
I'm a Java and C# developer, I've written my own installers, programs and libs in both languages, plus VB.Net but Lua is still confusing me. :(/>
Thanks for your help.
I've recently found the awesome email client/server by NitrogenFingers and got myself a copy and modified it to my needs (Of course by keeping his name in it).
Now I've extended the range of wireless modems from 50 to 10000000 (Simply so it'll work over most of the server) and to make this easy for users to use, I wanted to create a GUI installer.
I've used Lua to code basic things and a login system (Thanks to the person who helped me there!) but for whatever reason, when I attempt to use functions myself, I always get an error: Attempt to call nil.
Here's the code so far:
-- CreepyBeast Tekkit Email Client Installer
-- Vars
selection = 0
-- End vars
print("Welcome to the CreepyBeast Tekkit Email Client Installer")
print("This installer will set following up for you:")
print("1. Email Client and Rednet port setup.")
print("2. Redstone output when computer is running.")
print("3. Boot settings")
print("")
print("Hit ENTER to continue with setup...")
read()
drawInterface()
-- Draw Interface --
function drawInterface()
term.clear()
term.setCursorPos(1, 1)
printHeader()
printCentered(4, "SELECT INSTALLATION TYPE:")
printCentered(6, "BASIC INSTALLER (Recommended)")
printCentered(8, "ADVANCED INSTALLER")
end
function printHeader()
term.clear()
term.setCursorPos(1, 1)
print("CREEPYBEAST TEKKIT EMAIL CLIENT INSTALLATION")
printRight(1, "v0.1")
end
function printRight(height, value)
local xpos = w - string.len(value)
term.setCursorPos(xpos, height)
term.write(value)
end
function printCentered(height, value)
local xpos = w/2 - string.len(value)/2
term.setCursorPos(xpos, height)
term.write(value)
end
-- I nicked the printRight and printCentered functions from the email client
As soon as I execute the program I get:
I'm a Java and C# developer, I've written my own installers, programs and libs in both languages, plus VB.Net but Lua is still confusing me. :(/>
Thanks for your help.