setBorderColor (0, 0, 0) moonlightUI = moonlightUI or {} moonlightUI.lefttext = 400 moonlightUI.righttext = 460 moonlightUI.toptext = 0 moonlightUI.bottomtext = 5 moonlightUI.fontsize = 8 setBorderTop (moonlightUI.toptext) setBorderLeft (moonlightUI.lefttext) setBorderRight (moonlightUI.righttext) setBorderBottom (moonlightUI.bottomtext) moonlightUI.leftside = Geyser.Container:new ({ name = "leftside", x = 0, y = 0, width = moonlightUI.lefttext, height = "100%" }) moonlightUI.rightside = Geyser.Container:new ({ name = "rightside", x = "-" .. moonlightUI.righttext, y = 0, width = moonlightUI.righttext, height = "100%" }) moonlightUI.leftsidelabel = Geyser.Label:new({ name = "leftsidelabel", x = 0, y = 0, width = "100%", height = "100%", }, moonlightUI.leftside) moonlightUI.leftsidelabel:setColor(0,0,0,255) --moonlightUI.leftsidelabel:setBackgroundImage([[C:\Programs\Mudlet\GUI\leftside.png]]) moonlightUI.rightsidelabel = Geyser.Label:new({ name = "rightsidelabel", x = 0, y = 0, width = "100%", height = "100%", }, moonlightUI.rightside) moonlightUI.rightsidelabel:setColor(0,0,0,255) --moonlightUI.rightsidelabel:setBackgroundImage([[C:\Programs\Mudlet\GUI\rightside.png]]) moonlightUI.leftsidebar = Geyser.VBox:new ({ name = "leftsidebar", x = 15, y = 15, width = "-15", height = "-15", }, moonlightUI.leftside) moonlightUI.rightsidebar = Geyser.VBox:new({ name = "rightsidebar", x = 15, y = 15, width = "-15", height = "-15", }, moonlightUI.rightside) -- ========================= -- Left Side -- ========================= -- =========== -- Title Bar -- =========== moonlightUI.titlebarbox = Geyser.Container:new ({ name = "titlebarbox", height = 40, v_policy = Geyser.Fixed, }, moonlightUI.leftsidebar) moonlightUI.titlebar = Geyser.MiniConsole:new ({ name = "titlebar", x = 0, y = 10, width = "-0", height = "-10", }, moonlightUI.titlebarbox) moonlightUI.titlebar:setBufferSize (100, 100) fontwidth, fontheight = calcFontSize (moonlightUI.fontsize) moonlightUI.titlebar:setWrap (math.floor (moonlightUI.titlebar.get_width ()/fontwidth)) moonlightUI.titlebar:setColor ("black") setMiniConsoleFontSize ("titlebar", moonlightUI.fontsize + 2) -- ========== -- Info Box -- ========== moonlightUI.infobox = Geyser.Container:new ({ name = "infobox", }, moonlightUI.leftsidebar) moonlightUI.infobuttons = Geyser.HBox:new ({ name = "infobuttons", x = 0, y = 0, width = "-0", height = "25", }, moonlightUI.infobox) moonlightUI.infolist = {} moonlightUI.createinfobutton = function (infoname) local infoboxname = "InfoBox" .. infoname moonlightUI.infolist[#moonlightUI.infolist+1] = infoboxname local infobuttonname = "InfoButton" .. infoname moonlightUI[infobuttonname] = Geyser.Label:new ({ name = infobuttonname, fgColor = "white", message = [[
]] .. infoname .. [[
]] }, moonlightUI.infobuttons) moonlightUI[infobuttonname]:setClickCallback ("moonlightUI." .. infobuttonname .. "_press") moonlightUI[infobuttonname .. "_press"] = function () moonlightUI.infopress (infoboxname) end -- func end -- func moonlightUI.infopress = function (infoboxname) -- first, hide them all for k, v in ipairs (moonlightUI.infolist) do moonlightUI[v]:hide () moonlightUI.infobuttonactive (v, false) end -- func moonlightUI[infoboxname]:show () moonlightUI.infobuttonactive (infoboxname, true) end -- func moonlightUI.infobuttonactive = function (infoboxname, b) local infobuttonname = "InfoButton" .. string.sub (infoboxname, 8) if b then moonlightUI[infobuttonname]:setColor (0,50,100) else moonlightUI[infobuttonname]:setColor (0,25,50) end -- if end -- func -- ================== -- InfoBox Currency -- ================== moonlightUI.InfoBoxCurrency = Geyser.MiniConsole:new ({ name = "InfoBoxCurrency", x = 0, y = "25", width = "-0", height = "-0", }, moonlightUI.infobox) moonlightUI.InfoBoxCurrency:setBufferSize (100, 100) fontwidth, fontheight = calcFontSize (moonlightUI.fontsize) moonlightUI.InfoBoxCurrency:setWrap (math.floor (moonlightUI.InfoBoxCurrency.get_width ()/fontwidth)) moonlightUI.InfoBoxCurrency:setColor ("black") setMiniConsoleFontSize ("InfoBoxCurrency", moonlightUI.fontsize) moonlightUI.createinfobutton ("Currency") -- ============== -- InfoBox Rift -- ============== moonlightUI.InfoBoxRift = Geyser.MiniConsole:new ({ name = "InfoBoxRift", x = 0, y = "25", width = "-0", height = "-0", }, moonlightUI.infobox) moonlightUI.InfoBoxRift:setBufferSize (100, 100) fontwidth, fontheight = calcFontSize (moonlightUI.fontsize) moonlightUI.InfoBoxRift:setWrap (math.floor (moonlightUI.InfoBoxRift.get_width ()/fontwidth)) moonlightUI.InfoBoxRift:setColor ("black") setMiniConsoleFontSize ("InfoBoxRift", moonlightUI.fontsize) moonlightUI.createinfobutton ("Rift") -- ============== -- InfoBox Room -- ============== moonlightUI.InfoBoxRoom = Geyser.MiniConsole:new ({ name = "InfoBoxRoom", x = 0, y = "25", width = "-0", height = "-0", }, moonlightUI.infobox) moonlightUI.InfoBoxRoom:setBufferSize (100, 100) fontwidth, fontheight = calcFontSize (moonlightUI.fontsize) moonlightUI.InfoBoxRoom:setWrap (math.floor (moonlightUI.InfoBoxRoom.get_width ()/fontwidth)) moonlightUI.InfoBoxRoom:setColor ("black") setMiniConsoleFontSize ("InfoBoxRoom", moonlightUI.fontsize) moonlightUI.createinfobutton ("Room") -- initialize the info boxes for k, v in ipairs (moonlightUI.infolist) do moonlightUI[v]:hide () moonlightUI.infobuttonactive (v, false) end -- for moonlightUI[moonlightUI.infolist[1]]:show () moonlightUI.infobuttonactive (moonlightUI.infolist[1], true) -- ======== -- Spacer -- ======== moonlightUI.leftspacer2 = Geyser.Container:new ({ name = "leftspacer2", height = 30, v_policy = Geyser.Fixed, }, moonlightUI.leftsidebar) -- ============= -- Status Bars -- ============= moonlightUI.statusbox = Geyser.Container:new ({ name = "statusbox", height = 75, v_policy = Geyser.Fixed, }, moonlightUI.leftsidebar) -- ================== -- Gauges Container -- ================== moonlightUI.gauges = Geyser.Container:new ({ name = "gauges", x = 0, y = 0, width = "100%", height = "100%", }, moonlightUI.statusbox) moonlightUI.gaugeback = Geyser.Label:new({ name = "gaugeback", x = 0, y = 0, width = "100%", height = "100%", }, moonlightUI.statusbox) moonlightUI.gaugeback:setColor(0,0,0,255) moonlightUI.hplabel = Geyser.Label:new({ name = "hplabel", x = 0, y = 0, width = 25, height = 15, fgColor = "white", message = [[
HP:
]] }, moonlightUI.statusbox) moonlightUI.hplabel:setColor(0,0,0,0) moonlightUI.mplabel = Geyser.Label:new({ name = "mplabel", x = 0, y = 15, width = 25, height = 15, fgColor = "white", message = [[
MP:
]] }, moonlightUI.statusbox) moonlightUI.mplabel:setColor(0,0,0,0) moonlightUI.edlabel = Geyser.Label:new({ name = "edlabel", x = 0, y = 30, width = 25, height = 15, fgColor = "white", message = [[
ED:
]] }, moonlightUI.statusbox) moonlightUI.edlabel:setColor(0,0,0,0) moonlightUI.wplabel = Geyser.Label:new({ name = "wplabel", x = 0, y = 45, width = 25, height = 15, fgColor = "white", message = [[
WP:
]] }, moonlightUI.statusbox) moonlightUI.wplabel:setColor(0,0,0,0) moonlightUI.xplabel = Geyser.Label:new({ name = "xplabel", x = 0, y = 60, width = 25, height = 15, fgColor = "white", message = [[
XP:
]] }, moonlightUI.statusbox) moonlightUI.xplabel:setColor(0,0,0,0) -- here's your health bar moonlightUI.hpbar = Geyser.Gauge:new ({name="hpbar",x=30,y=3,width="-45",height=9},moonlightUI.gauges) moonlightUI.hpbar.front:setStyleSheet ([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF0000, stop: 0.2 #FF0000, stop: 0.8 #660000, stop: 1 #990000);]]) moonlightUI.hpbar.back:setStyleSheet ([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AA0000, stop: 0.2 #AA0000, stop: 0.9 #440000, stop: 1 #660000);]]) -- here's your mana bar moonlightUI.mpbar = Geyser.Gauge:new ({name="mpbar",x=30,y=18,width="-45",height=9},moonlightUI.gauges) moonlightUI.mpbar.front:setStyleSheet ([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4C4CFF, stop: 0.2 #4C4CFF, stop: 0.8 #1E1E66, stop: 1 #2D2D99);]]) moonlightUI.mpbar.back:setStyleSheet ([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #3131AA, stop: 0.2 #333399, stop: 0.8 #131344, stop: 1 #1D1D66);]]) -- here's your endurance bar moonlightUI.edbar = Geyser.Gauge:new ({name="edbar",x=30,y=33,width="-45",height=9},moonlightUI.gauges) moonlightUI.edbar.front:setStyleSheet ([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FFFF38, stop: 0.2 #FFFF38, stop: 0.9 #666616, stop: 1 #999921);]]) moonlightUI.edbar.back:setStyleSheet ([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AAAA25, stop: 0.2 #777700, stop: 0.9 #44440F, stop: 1 #666616);]]) -- here's youre willpower bar moonlightUI.wpbar = Geyser.Gauge:new ({name="wpbar",x=30,y=48,width="-45",height=9},moonlightUI.gauges) moonlightUI.wpbar.front:setStyleSheet ([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF00FF, stop: 0.2 #FF00FF, stop: 0.9 #660066, stop: 1 #990099);]]) moonlightUI.wpbar.back:setStyleSheet ([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AA00AA, stop: 0.2 #AA00AA, stop: 0.9 #440044, stop: 1 #660066);]]) -- and here's your xp bar moonlightUI.xpbar = Geyser.Gauge:new ({name="xpbar",x=30, y=63,width="-45", height=9}, moonlightUI.gauges) moonlightUI.xpbar.front:setStyleSheet ([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #C8C8C8, stop: 0.2 #C8C8C8, stop: 0.9 #515151, stop: 1 #7A7A7A);]]) moonlightUI.xpbar.back:setStyleSheet ([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #898989, stop: 0.2 #898989, stop: 0.9 #383838, stop: 1 #515151);]]) moonlightUI.hpdisplay = Geyser.Label:new({ name = "hpdisplay", x = "-37", y = 0, width = 37, height = 15, fgColor = "white", message = [[50%]] }, moonlightUI.statusbox) moonlightUI.hpdisplay:setColor(0,0,0,0) moonlightUI.mpdisplay = Geyser.Label:new({ name = "mpdisplay", x = "-37", y = 15, width = 37, height = 15, fgColor = "white", message = [[50%]] }, moonlightUI.statusbox) moonlightUI.mpdisplay:setColor(0,0,0,0) moonlightUI.eddisplay = Geyser.Label:new({ name = "eddisplay", x = "-37", y = 30, width = 37, height = 15, fgColor = "white", message = [[50%]] }, moonlightUI.statusbox) moonlightUI.eddisplay:setColor(0,0,0,0) moonlightUI.wpdisplay = Geyser.Label:new({ name = "wpdisplay", x = "-37", y = 45, width = 37, height = 15, fgColor = "white", message = [[50%]] }, moonlightUI.statusbox) moonlightUI.wpdisplay:setColor(0,0,0,0) moonlightUI.xpdisplay = Geyser.Label:new({ name = "xpdisplay", x = "-37", y = 60, width = 37, height = 15, fgColor = "white", message = [[0.0%]] }, moonlightUI.statusbox) moonlightUI.xpdisplay:setColor(0,0,0,0) -- ============================ -- Right Side -- ============================ -- ======== -- Mapper -- ======== moonlightUI.mapper = Geyser.Mapper:new ({ name = "mapper", height = 300, v_policy = Geyser.Fixed, }, moonlightUI.rightsidebar) -- ======== -- Spacer -- ======== moonlightUI.rightspacer1 = Geyser.Container:new ({ name = "rightspacer1", height = 15, v_policy = Geyser.Fixed, }, moonlightUI.rightsidebar) -- ================ -- Chat Container -- ================ moonlightUI.chatcontainer = Geyser.Container:new ({ name = "chatcontainer", width = "-0", v_policy = Geyser.Dynamic, }, moonlightUI.rightsidebar) moonlightUI.chatbuttons = Geyser.HBox:new ({ name = "chatbuttons", x = 0, y = 0, width = "-0", height = "25", }, moonlightUI.chatcontainer) moonlightUI.chatlist = {} moonlightUI.createchat = function (chatname) local chatboxname = "ChatBox" .. chatname moonlightUI.chatlist[#moonlightUI.chatlist+1] = chatboxname moonlightUI[chatboxname] = Geyser.MiniConsole:new ({ name = chatboxname, x = 0, y = 25, width = "-0", height = "-0", }, moonlightUI.chatcontainer) moonlightUI[chatboxname]:setBufferSize (500000, 100) local fontwidth, fontheight = calcFontSize (moonlightUI.fontsize) moonlightUI[chatboxname]:setWrap (math.floor (moonlightUI.chatcontainer.get_width ()/fontwidth)) moonlightUI[chatboxname]:setColor ("black") setMiniConsoleFontSize (chatboxname, moonlightUI.fontsize) local chatbuttonname = "ChatButton" .. chatname moonlightUI[chatbuttonname] = Geyser.Label:new ({ name = chatbuttonname, fgColor = "white", message = [[
]] .. chatname .. [[
]] }, moonlightUI.chatbuttons) moonlightUI[chatbuttonname]:setClickCallback ("moonlightUI." .. chatbuttonname .. "_press") moonlightUI[chatbuttonname .. "_press"] = function () moonlightUI.chatpress (chatboxname) end -- func end -- func moonlightUI.chatpress = function (chatname) for k, v in ipairs (moonlightUI.chatlist) do moonlightUI[v]:hide () moonlightUI.chatbuttonactive (v, false) end -- func moonlightUI[chatname]:show () moonlightUI.chatbuttonactive (chatname, true) end -- func moonlightUI.chatbuttonactive = function (chatname, b) local x = "ChatButton" .. string.sub (chatname, 8) if b then moonlightUI[x]:setColor (0,50,100) else moonlightUI[x]:setColor (0,25,50) end -- if end -- func moonlightUI.sendChat = function (chatwindow, fcolor, bcolor) if chatwindow ~= "All" then moonlightUI["ChatBox" .. chatwindow]:echo ("\n") end selectCurrentLine () local fcolor = fcolor or "nochange" local bcolor = bcolor or "nochange" local _br,_bg,_bb = getBgColor () local _fr,_fg,_fb = getFgColor () if fcolor ~= "nochange" then setFgColor(fcolor[1],fcolor[2],fcolor[3]) end if bcolor ~= "nochange" then setBgColor(bcolor[1],bcolor[2],bcolor[3]) end copy () setBgColor(_br,_bg,_bb) setFgColor(_fr,_fg,_fb) appendBuffer ("ChatBox" .. chatwindow) if chatwindow ~= "All" then appendBuffer ("ChatBoxAll") end resetFormat () end -- func moonlightUI.createchat ("All") moonlightUI.createchat ("Order") moonlightUI.createchat ("House") moonlightUI.createchat ("City") moonlightUI.createchat ("Tells") moonlightUI.createchat ("Party") for k, v in ipairs (moonlightUI.chatlist) do moonlightUI[v]:hide () moonlightUI.chatbuttonactive (v, false) end -- for moonlightUI[moonlightUI.chatlist[1]]:show () moonlightUI.chatbuttonactive (moonlightUI.chatlist[1], true) -- Below to send chat -- moonlightUI.sendChat ("Order") -- moonlightUI.sendChat ("Order", {255,255,255}) -- moonlightUI.sendChat ("Order", {255,255,255}, {0,0,0}) -- moonlightUI.sendChat ("Order", "nochange", {0,0,0}) -- To alter chat --[[ selectString("(this is a very long clan name)", 1) setBgColor(getBgColor()) setFgColor(getFgColor()) replace("(shortclanname)") resetFormat () --]] -- to set bars - this initalizes, them, -- call it later with the first number the % of the stat moonlightUI.hpbar:setValue (50, 100) moonlightUI.mpbar:setValue (50, 100) moonlightUI.edbar:setValue (50, 100) moonlightUI.wpbar:setValue (50, 100) moonlightUI.xpbar:setValue (50, 100) -- to update the text, send the same number you do for the bars, in the below format -- [[ moonlightUI.hpdisplay:echo (string.format("%.0f", 50) .. "%") moonlightUI.mpdisplay:echo (string.format("%.0f", 50) .. "%") moonlightUI.wpdisplay:echo (string.format("%.0f", 50) .. "%") moonlightUI.eddisplay:echo (string.format("%.0f", 50) .. "%") moonlightUI.xpdisplay:echo (string.format("%.1f", 50) .. "%") --]]