-
-
Notifications
You must be signed in to change notification settings - Fork 33
JsMacros Functions
the JsMacros functions are:
Example: jsmacros.getProfile()
returns the main instance of the xyz.wagyourtail.jsmacros.profile.Profile class.
Example: jsmacros.getConfig()
returns the main instance of the xyz.wagyourtail.jsmacros.config.ConfigManager class.
Example: jsmacros.getRunningThreads()
returns a Map<RawMacro, ArrayList<RunScript$thread>>
.
- pre-1.1.2
Thread
instead ofRunScript$thread
RunScript$thread looks like
class thread {
t, //Thread
m, //RawMacro
startTime, //Long
}
Example: jsmacros.mcVersion()
returns a string of the Minecraft Version.
Example: jsmacros.runScript("./test.js", (err) => {console.log(err);});
runs a script file completely independent of the current script. callback not neccecairy, but could be useful.
Example: jsmacros.runScript(extension, scriptstring, callback);
runs a script completely independent of the current script. callback not neccecairy, but could be useful.
Example: jsmacros.getGameOptions()
returns an OptionsHelper
Example: jsmacros.open("http://github.com")
opens a URI externally. (file://
will have it open with default for filetype)
Example: jsmacros.getFPS()
returns a string that includes the FPS (as well as some other related things).
Example: jsmacros.on(eventName, callbackFn)
this will trigger the callback function on the event. returns an IEventListener
(you should hold onto this to remove your event listener)
Example: jsmacros.once(eventName, callbackFn)
this will trigger the callback function on the next call to the event. returns an IEventListener
Example: jsmacros.off(eventName, eventListener)
removes an active listener. returns true if listener was present.
Example: jsmacros.connect(ip, port)
connect to a server.
Example: jsmacros.disconnect()
disconnects from a server.
Example: jsmacros.waitTick(ticks)
-
ticks
is1.2.6+
Waits for the next minecraft tick. For when you need to just wait to the next tick, not a fixed length of time.