User:Egingell/UserFuncs

User Functions
-- Returns a list of values in whatever order you specify in order and only those you specify in order. -- Mostly useful for functions that return multiple values. -- This function is horribly inefficient, I just wanted to see if it could be done. ret1, ret2, ... retN = GetReturnValues(order, functionCall) -- &#91;talk&#93; User:Egingell/Blank | [Hide] GetReturnValues | [Show GetReturnValues Page] Talk:GetReturnValues | [Show GetReturnValues Talk Page]

-- Return how many times needle is contained in haystack. ret = CountChars(haystack, needle) -- &#91;talk&#93; User:Egingell/Blank | [Hide] CountChars | [Show CountChars Page] Talk:CountChars | [Show CountChars Talk Page]

-- Imp strsub. Returns a string starting from start to length characters from start (identical to the PHP function of the same name). ret = substr(string, start [, length]) -- &#91;talk&#93; User:Egingell/Blank | [Hide] substr | [Show substr Page] Talk:substr | [Show substr Talk Page]

-- Split a string into groups of "length" each ending with "endChars" (identical to the PHP function of the same name). ret = ChunkSplit(string [, length [, endChars]]) -- &#91;talk&#93; User:Egingell/Blank | [Hide] ChunkSplit | [Show ChunkSplit Page] Talk:ChunkSplit | [Show ChunkSplit Talk Page]

-- Return the exact position the cursor is at based on scale. x, y = GetCursorScaledPosition -- &#91;talk&#93; User:Egingell/Blank | [Hide] GetCursorScaledPosition | [Show GetCursorScaledPosition Page] Talk:GetCursorScaledPosition | [Show GetCursorScaledPosition Talk Page]

-- Unregister an event from all applicable frames. nil = UnregisterEventFromAllFrames(string) -- &#91;talk&#93; User:Egingell/Blank | [Hide] UnregisterEventFromAllFrames | [Show UnregisterEventFromAllFrames Page] Talk:UnregisterEventFromAllFrames | [Show UnregisterEventFromAllFrames Talk Page]

-- Tell the API to stop listen for events (...) nil = Frame:UnregisterEvents(frame, string, ...) -- &#91;talk&#93; User:Egingell/Blank | [Hide] Frame:UnregisterEvents | [Show Frame:UnregisterEvents Page] Talk:Frame:UnregisterEvents | [Show Frame:UnregisterEvents Talk Page]

-- Tell the API to listen for events (...) nil = Frame:RegisterEvents(frame, string, ...) -- &#91;talk&#93; User:Egingell/Blank | [Hide] Frame:RegisterEvents | [Show Frame:RegisterEvents Page] Talk:Frame:RegisterEvents | [Show Frame:RegisterEvents Talk Page]

-- Register a slash command (add all commands at the end). nil = SlashCmdList_AddSlashCommand(name, func, ...) -- &#91;talk&#93; User:Egingell/Blank | [Hide] SlashCmdList AddSlashCommand | [Show SlashCmdList AddSlashCommand Page] Talk:SlashCmdList_AddSlashCommand | [Show SlashCmdList AddSlashCommand Talk Page]

-- Add a message to the chat frame when you gain or lose money. -- PLAYER_MONEY Event -- &#91;talk&#93; User:Egingell/Blank | [Hide] User:Egingell/PLAYER_MONEY| [Show PLAYER_MONEY Page] User_talk:Egingell/PLAYER_MONEY | [Show PLAYER_MONEY Talk Page]

-- Make a simple context menu. -- Context Menu Maker -- &#91;talk&#93; User:Egingell/Blank | [Hide] Context Menu Maker| [Show Context Menu Maker Page] Talk:Context Menu Maker| [Show Context Menu Maker Talk Page]

-- round input to n places number = round(input, n) -- &#91;talk&#93; User:Egingell/Blank | [Hide] round | [Show round Page] Talk:round | [Show round Talk Page]

-- Returns the function called when using. slashFunction = GetSlashFunc(cmd) -- &#91;talk&#93; User:Egingell/Blank | [Hide] GetSlashFunc | [Show GetSlashFunc Page] Talk:GetSlashFunc | [Show GetSlashFunc Talk Page]