User Tools

Site Tools



mashlib

This is an old revision of the document!


A collection of useful commands that are going to be necessary to run my future addons.

Support

If you need support with this library or just wanna chat, join my discord server! :D

Structure

MashLib = {
    Helpers, -- Helpful stuff
    System, -- FFXIV related stuff (servers, regions, etc)
    Powershell, -- Powershell related functions
    Character, -- Character related stuff
    API, -- API Requests
    Crafting, -- Crafting related stuff
    Gathering, -- Gathering related stuff
    Misc, -- Temporary values
    Battle, -- Battle related stuff
    Hacks -- Useful hacks
}

API

Helpers

--[[
    Logs string to console and file
    @param {string} log
    @param {string} type = 'string' or 'block'
]]
MashLib.Helpers.Log(log, type)
 
--[[
    Get current time
    @param {type} type = 'epoch', 'formatted' or 'formatted_no_spec'
    @return {string}
]]
MashLib.Helpers.GetTime(type)
 
--[[
    Returns the time since the param
    @param {string} time
    @return {int}
]]
MashLib.Helpers.TimeSince(time)
 
--[[
    Get a keyboard's key info
    @param {string} key
    @returns {table}
]]
MashLib.Helpers.GetKeyInfo(key)
 
--[[
    Get a map's name
    @param {int} id
    @param {string} mode - 'default' or 'to_log'
    @returns {string}
]]
MashLib.Helpers.GetMapName(id, mode)
 
--[[
    Return current map coordinates
    @param {bool} float
    @returns {int}
]]
MashLib.Helpers.ToFixed(float)
 
--[[
    Return the size of the table
    @param {table} tbl
    @returns {int}
]]
MashLib.Helpers.SizeOf(tbl)
 
--[[
    Return the size of the table
    @param {string} expansion -- shb or sb
    @returns {int}
]]
MashLib.Helpers.GetMapsByExpansion(expansion)
 
--[[
    Turns seconds into milliseconds
    @param {int} time
    @returns {int}
]]
MashLib.Helpers.HandleCoolDowns(time)
 
--[[
    Get the highest value from table
    @param {table} tbl
    @returns {int}
]]
MashLib.Helpers.GetMax(tbl)
 
--[[
    Get the lowest value from table
    @param {table} tbl
    @returns {int}
]]
MashLib.Helpers.GetMin(tbl)

System

--[[
    Get most common keys from the keyboard.
    @returns {Table}
]]
MashLib.System.GetCommonKeys()
 
--[[
    Get a Server by it's ID
    @param {int} id
    @returns {table}
]]
MashLib.System.GetServer(id)
 
--[[
    Get a Region by it's ID
    @param {int} id
    @returns {string}
]]
MashLib.System.GetRegion(id)
 
--[[
    Get a Job's name by it's ID
    @param {int} id
    @returns {string}
]]
MashLib.System.GetJob(id)
 
--[[
    Get a Job's ID by it's name
    @param {string} name
    @returns {int}
]]
MashLib.System.GetJobId(name)
 
--[[
    Get the job list by all or by dominion
    @param {string} dominion - 'battle', 'h-l', 'any'
    @returns {int}
]]
MashLib.System.GetJobList(dominion)
 
--[[
    Check if the character is logged in or not
    @returns {boolean}
]]
MashLib.System.CheckLogin()
 
--[[
    Get current map's ID by name
    @param {string} name
    @param {string} continent
    @return {int}
]]
MashLib.System.GetMap(continent, name)
 
--[[
    Get player info
    @return {table}
]]
MashLib.System.GetUserInfo()

Powershell

--[[
    Execute a powershell file (.ps1)
    @param {string} path
]]
MashLib.Powershell.ExecuteFile(path)
 
--[[
    Downloads a file
    @param {string} url
    @param {string} path on system
]]
MashLib.Powershell.DownloadFile(url, path)
 
--[[
    Opens a url in your browser
    @param {string} url
]]
MashLib.Powershell.OpenLink(url)

Character

--[[
    Get the list of buffs on your character
    @return {table}
]]
MashLib.Character.GetBuffList()
 
--[[
    Moves character to coords
    @param {table} coords
]]
MashLib.Character.MoveTo(coords)
 
--[[
    Return current map coordinates
    @param {bool} exact
    @returns {table}
]]
MashLib.Character.GetMapCoords(exact)
 
--[[
    Teleports the player to the map with corresponding id
    @param {int} mapid
]]
MashLib.Character.TeleportTo(mapid)
 
--[[
    Switch between Standard (0) and Legacy (1) move modes
    @param {int} id
]]
MashLib.Character.SetMoveModeTo(id)
 
--[[
    Return an inventory item info by id
    @param {int} id
    @returns {table}
        ResultObject
            .category
            .uicategory
            .searchcategory
            .name
            .max
            .level
            .requiredlevel
            .canequip
            .equipslot
            .class
            .price
            .rarity
            .isunique
            .desynthvalue
            .replairclassjob
            .repairitem
            .iscollectable
            .isuntradeable
            .isbinding
]]
MashLib.Character.Inventory.GetItemDetails(id)

API

--[[
    Get an API endpoint's info by name
    @param {string} name
    @return {table}
]]
MashLib.API.GetEndpoint(name)

Crafting

--[[
    Get a craft condition by name
    @param {string} name
    @return {table}
]]
MashLib.Crafting.GetCondition(name)

Gathering

Battle

--[[
    Get an encounter info by ID
    @param {int} id
    @return {table}
]]
MashLib.Battle.GetEncounter(id)
 
--[[
    Get encounter list
    @return {table}
]]
MashLib.Battle.GetEncounterList()
 
--[[
    Get last skill casted's id
    @return {int} id
]]
MashLib.Battle.GetLastCastID()
 
--[[
    Get skill ID by Name
    @param {int} job
    @param {string} name
    @return {int} id
]]
MashLib.Battle.GetSkillId(job, name)
 
--[[
    Get skill Name by ID
    @param {int} job
    @param {id} id
    @return {int} id
]]
MashLib.Battle.GetSkillNameByID(job, id)
 
--[[
    Get a list of skills on a specific job
    @param {int} job
    @return {table}
]]
MashLib.Battle.GetSkillListByJobID(job)
 
--[[
    Get a list of skills with specified cooldowns on a specific job
    @param {int} job
    @param {boolean} to_combo
    @return {table}
]]
MashLib.Battle.GetSkillListWithCDByJobID(job, to_combo)
 
--[[
    NIN - Hold TCJ on key down
    @param {strng} key
]]
MashLib.Battle.NIN.HoldTCJ(key)

Hacks

--[[
    Set character's speed
    @param {int} fly
    @param {int} walk
    @param {int} mount
]]
MashLib.Hacks.SpeedHacks.Set(fly, walk, mount)
 
--[[
    Reset character's speed
]]
MashLib.Hacks.SpeedHacks.Reset()
mashlib.1612480522.txt.gz · Last modified: 2021/02/04 23:15 by masshirodev