User:Missionz3r0

From Mudlet
Revision as of 18:34, 18 February 2026 by Missionz3r0 (talk | contribs) (Remove padding from API heading)
Jump to navigation Jump to search

Current Projects/Issues

  • #1149 Public functions missing documentation in wiki
    • #1640 Wiki templates for easy versions
  • #7851 Bulkify db:add
  • #8864 Handle db:_migrate's assertions and transactions better

Basic Essentials

I intend to turn the following into composable templates. As they exist now is just to experiment with and get feedback on presentation and format.

echo

This function appends text at the end of the current line.

See also: moveCursor(), insertText(), cecho(), decho(), hecho()

Example: label

-- This example creates a transparent overlay message box to show a big warning message "You are under attack!" in the middle 
-- of the screen. Because the background color has a transparency level of 150 (0-255, with 0 being completely transparent 
-- and 255 opaque) the background text can still be read through.
local width, height = getMainWindowSize()
createLabel("messageBox",(width/2)-300,(height/2)-100,250,150,1)
resizeWindow("messageBox",500,70)
moveWindow("messageBox", (width/2)-300,(height/2)-100 )
setBackgroundColor("messageBox", 255, 204, 0, 200)
echo("messageBox", [[<p style="font-size:35px"><b><center><font color="red">You are under attack!</font></center></b></p>]])

Example: miniconsole

-- first, determine the size of your screen
local windowWidth, windowHeight = getMainWindowSize()

-- create the miniconsole
createMiniConsole("sys", windowWidth-650,0,650,300)
setBackgroundColor("sys",255,69,0,255)
setMiniConsoleFontSize("sys", 8)
-- wrap lines in window "sys" at 40 characters per line - somewhere halfway, as an example
setWindowWrap("sys", 40)

echo("sys","Hello world!\n")
cecho("sys", "<:OrangeRed>This is random spam with the same background\n")
cecho("sys", "<blue:OrangeRed>and this is with a blue foreground. ")
cecho("sys", "<bisque:BlueViolet>Lastly, this is with both a foreground and a background.\n")