- 1 Talk
-
Sea.IO
Contents |
This article is a part of the documentation of the Sea function library
A child of Sea, Sea.IO is a collection of functions for printing output in World of Warcraft.
The Sea.IO library is organized in a simple format, there a three basic output types: print, banner and error.
Modifiers
Edit
- d - the first parameter of the function is a debug key that will be checked before printing. (e.g. dprint("MY_KEY", "Hi!"); will only print the message if getglobal("MY_KEY") is true. )
- f - will make the next parameter the frame you want to contain the print message. (e.g. printf (ChatFrame2, "Hi!"); will print "Hi!" in the combat window. )
- c - the next parameter is a table with 'r', 'g' and 'b' values to specify the color of the printed text.
- All of these can be used together:
dprintfc ("MY_KEY", ChatFrame3, {r=1.0,g=.5,b=.2}, "Hello", " ", "Welcome to my colorful world!" );
Functions
Edit
Banner
Edit
Prints a message to a large banner. Banners do not have a frame option.
Usage
Sea.IO.banner("Message", " ", "Some Message");
-- banner ( ... ) -- -- Arguments -- () arg -- arg - the values to be printed -- -- Returns -- (nil)
Bannerc
Edit
Banners in the specified color.
Usage
MyColor = { r = 1.0, g=0.2, b=0.0 };
Sea.IO.bannerc(MyColor, "Message", " ", "Some Message");
Dbanner
Edit
Banners if the debug key is true.
Usage
MY_DEBUG_KEY = true; MyKey = "MY_DEBUG_KEY"; Sea.IO.dbannerc(MyKey, "Message", " ", "Some Message");
Dbannerc
Edit
Banners with the specified color if the debug key is true.
Usage
MY_DEBUG_KEY = true;
MyKey = "MY_DEBUG_KEY";
MyColor = { r = 1.0, g=0.2, b=0.0 };
Sea.IO.dbannerc(MyKey, MyColor, "Message", " ", "Some Message");
Produces:
"Message Some Message" in red-orange.
Error
Edit
Prints to the default error pipe.
Usage
Sea.IO.error("Error:", " ", "Some Error Message");
-- error (...) -- -- prints just like Sea.IO.print, except as an error -- -- Arguments: -- () arg -- arg - contains all error output
Errorc
Edit
Prints an error message in the specified color.
Usage
MyColor = { r = 1.0, g=0.2, b=0.0 };
Sea.IO.derrorfc(MyColor, "Message", " ", "Some Message");
Errorf
Edit
Prints an error message to the specified frame.
Usage
Sea.IO.errorf( ChatFrame1, "Message", " ", "Some Message");
Errorfc
Edit
Prints an error message to the specified frame in the specified color.
Usage
MyColor = { r = 1.0, g=0.2, b=0.0 };
Sea.IO.errorfc(ChatFrame1, MyColor, "Message", " ", "Some Message");
Derror
Edit
Errors if the debug key is true.
Usage
MY_DEBUG_KEY = true; MyKey = "MY_DEBUG_KEY"; Sea.IO.derror(MyKey, "Message", " ", "Some Message");
Derrorc
Edit
Errors if the debug key is true in the specified color.
Usage
MY_DEBUG_KEY = true;
MyKey = "MY_DEBUG_KEY";
MyColor = { r = 1.0, g=0.2, b=0.0 };
Sea.IO.derrorc(MyKey, MyColor, "Message", " ", "Some Message");
Derrorf
Edit
Errors if the debug key is true in the specified frame.
Usage
MY_DEBUG_KEY = true; MyKey = "MY_DEBUG_KEY"; Sea.IO.derrorfc(MyKey, ChatFrame1, "Message", " ", "Some Message");
Derrorfc
Edit
Errors if the debug key is true in the specified frame in the specified color.
Usage
MY_DEBUG_KEY = true;
MyKey = "MY_DEBUG_KEY";
MyColor = { r = 1.0, g=0.2, b=0.0 };
Sea.IO.derrorfc(MyKey, ChatFrame1, MyColor, "Message", " ", "Some Message");
Print
Edit
Prints to the default chat box.
-- print ( ... ) -- -- Arguments -- () arg -- arg - the values to be printed -- -- Returns -- (nil)
Printc
Edit
Prints a message in the specified color.
Usage
MyColor = { r = 1.0, g=0.2, b=0.0 };
Sea.IO.printc(MyColor, "Message", " ", "Some Message");
Printf
Edit
Prints to the specified frame.
Usage
Sea.IO.printf(ChatFrame1, "Message", " ", "Some Message");
Printfc
Edit
Prints a message to the specified frame in the specified color.
Usage
MyColor = { r = 1.0, g=0.2, b=0.0 };
Sea.IO.printfc(ChatFrame1, MyColor, "Message", " ", "Some Message");
Dprint
Edit
Prints if the debug key is true.
Usage
MY_DEBUG_KEY = true; MyKey = "MY_DEBUG_KEY"; Sea.IO.dprintfc(MyKey, "Message", " ", "Some Message");
Dprintc
Edit
Prints if the debug key is true in the color specified.
Usage
MY_DEBUG_KEY = true;
MyKey = "MY_DEBUG_KEY";
MyColor = { r = 1.0, g=0.2, b=0.0 };
Sea.IO.dprintc(MyKey, MyColor, "Message", " ", "Some Message");
Dprintf
Edit
Prints to the specified frame if the debug key is true.
Usage
MY_DEBUG_KEY = true; MyKey = "MY_DEBUG_KEY"; Sea.IO.dprintf(MyKey, ChatFrame1, "Message", ": ", "Some Message");
Dprintfc
Edit
Prints to the specified frame in the specified color if the debug key is true.
Usage
MY_DEBUG_KEY = true;
MyKey = "MY_DEBUG_KEY";
MyColor = { r = 1.0, g=0.2, b=0.0 };
Sea.IO.dprintfc(MyKey, ChatFrame1, MyColor, "Message", " ", "Some Message");
printComma
Edit
Prints the arguments separated by commas.
Usage
Sea.IO.printComma ("A", "B", "C");
A,B,C
printTable
Edit
Prints the contents of an entire table, marking function pointers and nils. Beware that the pre-release version (as of Dec 1, 2004) seems to have some issues with tables that self-refer. For instance, Sea.IO.printTable(Sea) causes WoW to hang.
Example
MyTable = {
a = function () return 1+1 end;
[1] = 3;
[2] = 5;
["A"] = "Hello";
["B"] = nil;
[4] = { 1,2,4,5, n=4};
};
Sea.IO.printTable(MyTable);
Root := {
a = { { FunctionPtr* } },
[1] = 3,
[2] = 4,
[4] = {
n = 4,
[1] = 1,
[2] = 2,
[3] = 4,
[4] = 5
}
["A"] = "Hello",
["B"] = nil
}