Posted 29 May 2014 - 09:41 AM
This is a small API I've made for some programs I've made. Link for downloading: http://www.mediafire.com/view/o1lidv6y2ocxlia/awgToolsApi . I call it the Aweirdgamer Tools API after my username.
Here are the functions and their descriptions.
setColors : Sets the colors
revertColors : Revert colors to default
clear : Clears the screen and resets the cursor position
keyDetector : Detects real-time key strokes and returns the number of the key pressed
within : Returns a check for a number is within a certain amount of a number.
printerPrint : This very crude function, partly stolen from program edit, prints something with a provided title and contents.
continuePrompt : Waits for either a click, touch, or enter (based upon parameter) and then continues
#1 : Keyboard
#2 : Mouse
#3 : Touch
tokenParse : Takes tokens of a string, makes a table out of them, and returns it
determineAngle : Determines angle from coordinates with a provided origin, with 0 degrees as vertically upwards
Indirect Source: http://www.ozgrid.com/forum/showthread.php?t=61947
readAllOfFile : Returns a table of the contents of a filename
writeAllToFile : Writes a table's contents not serialized to a filename
YNtoBool : Converts a captial Y or not to a boolean equivalent
assureLength : Assures a string value to a specific number of characters adding an cut off symbol if needed
stringCharReplace : Replaces chars in a string with another char. If the char value to replace is more than one character, this doesn't work.
stringTrim : Trims the string of surrounding spaces
Source: http://lua-users.org/wiki/StringTrim
leadingDigitize : Makes a number into a string with a number of places with unfilled places as zeroes. Places include for negatives and decimal points.
Let me know if I should explain something more in depth or do something for this. I'm somewhat new to sharing code I've made.
Here are the functions and their descriptions.
setColors : Sets the colors
revertColors : Revert colors to default
clear : Clears the screen and resets the cursor position
keyDetector : Detects real-time key strokes and returns the number of the key pressed
within : Returns a check for a number is within a certain amount of a number.
printerPrint : This very crude function, partly stolen from program edit, prints something with a provided title and contents.
continuePrompt : Waits for either a click, touch, or enter (based upon parameter) and then continues
#1 : Keyboard
#2 : Mouse
#3 : Touch
tokenParse : Takes tokens of a string, makes a table out of them, and returns it
determineAngle : Determines angle from coordinates with a provided origin, with 0 degrees as vertically upwards
Indirect Source: http://www.ozgrid.com/forum/showthread.php?t=61947
readAllOfFile : Returns a table of the contents of a filename
writeAllToFile : Writes a table's contents not serialized to a filename
YNtoBool : Converts a captial Y or not to a boolean equivalent
assureLength : Assures a string value to a specific number of characters adding an cut off symbol if needed
stringCharReplace : Replaces chars in a string with another char. If the char value to replace is more than one character, this doesn't work.
stringTrim : Trims the string of surrounding spaces
Source: http://lua-users.org/wiki/StringTrim
leadingDigitize : Makes a number into a string with a number of places with unfilled places as zeroes. Places include for negatives and decimal points.
Let me know if I should explain something more in depth or do something for this. I'm somewhat new to sharing code I've made.