Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local site = (...);
- site.bg = 0xE;
- site.fg = 0x6;
- local format = _G.string.format;
- local tostring = _G.tostring;
- local ipairs = _G.ipairs;
- local EMPTY_STRING = '';
- local WHITESPACE = ' ';
- local STYLE_HEADER = {
- center = true;
- foregroundColor = 0xE;
- backgroundColor = 0x6;
- };
- local STYLE_BOLD = {
- foregroundColor = 0x1;
- };
- local function min(a, b)
- if a >= b then return a; else return b; end
- end
- local function candidate(uid, name, lang, role)
- return {
- ['uid'] = tostring(uid);
- ['name'] = tostring(name);
- ['lang'] = tostring(lang);
- ['role'] = tostring(role);
- };
- end
- local function printCandidate(cand, style)
- site:text(" UID........: "..cand.uid, style);
- site:text(" NAME.......: "..cand.name, style);
- site:text(" LANGUAGE(S): "..cand.lang, style);
- site:text(" ROLE(S)....: "..cand.role, style);
- end
- local personnel = {
- candidate('256-2869', "ViniCastilho", "PT, EN", "IT, DRIVER");
- candidate('319-3338', "noche", "TR, EN, RU, DE", "IT, MANAGER");
- candidate('256-2679', "olv", "RU, EN", "IT, DRIVER");
- };
- local personnelCount = #personnel;
- function site:draw()
- do --> HEADER
- local padding = WHITESPACE:rep(22);
- site:text(format("%sWELCOME TO hire.us%s", padding, padding), STYLE_HEADER);
- end
- site:text(EMPTY_STRING);
- site:text(" This page is dedicated to advertising players by including");
- site:text(" a brief description of them. Three candidates are shown at");
- site:text(" a time. Reload the page to get a new set.");
- site:text(format(" There are %i record(s) in total.", #personnel), STYLE_BOLD);
- site:text(EMPTY_STRING);
- do --> CANDIDATES
- ---- No `math.random` function yet, I'm going insane...
- for i = 1, 3 do
- printCandidate(personnel[i]);
- site:text(EMPTY_STRING);
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement