Introduction
Shismo Scripter is a plugin which reads and executes code based on both Shismo’s and RuneLite’s inbuilt APIs. You can create your own completely customisable automated scripts written in JavaScript with Java bindings.
How do I use this documentation?
To your left, there is a table of contents and search bar that will take you to a specific section.
Once you have found what you want, have a read on what the functions do and view the code examples in the dark area to the right.
Guides
Getting Started
First, enable the Shismo Scripter plugin and navigate to the white pencil icon on the right. Once this panel is open, there are multiple options to choose from.
Functions
Query:
boolean isBankOpen = utils.bank.isOpen();
if(utils.bank.isOpen()){
//Do stuff
}
WorldPoint playerLocation = utils.player.getWorldLocation();
utils.walk.walkTo(playerLocation);
Command:
utils.bank.openBank();
Event:
utils.bank.addLog("Waiting up to 10 seconds for Mr Hans to spawn.");
if(utils.event.npcSpawned(NpcID.HANS, 10000)) {
utils.bank.addLog("Mr Hans spawned in under 10 seconds.");
} else {
utils.bank.addLog("Mr Hans did not spawn in under 10 seconds.");
}
utils.bank.addLog("Waiting forever until Mr Hans spawns.");
utils.event.npcSpawned(NpcID.HANS);
utils.bank.addLog("This will only run if Mr Hans spawns, otherwise it will never run.");
Shismo Scripter has three main types of functions:
Queries: Returns a value of some type when called.
Commands: Executes an action with no return value.
Events: Waits for an event to occur and pauses script execution. Can also return a boolean if a timeout is specified.
Code Editor
The inbuilt code editor comes with auto code completion. This is accessible via pressing ctrl + space
, or by ending a package name with a .
eg utils.
Bindings
Client
You have access to all common classes in net.runelite.api
like WorldPoint
, Client
etc.
You can find out more via the official RuneLite documentation.
Examples:
new WorldPoint(420, 69, 0);
client.getEnergy();
ItemID.KNIFE();
NpcID.HANS();
ObjectID.ALTAR();
ItemID
Enum class for in game ItemIDs.
NpcID
Enum class for in game NpcIDs.
ObjectID
Enum class for in game ObjectIDs.
Utils
Examples:
utils.bank.
utils.debug.
utils.event.
utils.inventory.
utils.npc.
utils.object.
utils.player.
utils.prayer.
utils.walk.
utils.widget.
A set of common utilities that link to our very own Shismo Utils. Look the the right!
Bank Queries
isOpen()
Overloads:
utils.bank.isOpen();
Returns:
boolean
Examples:
if (utils.bank.isOpen()) {
//Perform actions while the bank is open
}
Checks if the bank interface is currently open.
Bank Commands
openBank()
Overloads:
utils.bank.openBank();
Examples:
if(!utils.bank.isOpen()) {
utils.bank.openBank();
}
Opens the bank interface for the player.
closeBank()
Overloads:
utils.bank.closeBank();
Examples:
if(!utils.bank.isOpen()) {
utils.bank.closeBank();
}
Closes the bank interface for the player.
depositXOfItem()
Overloads:
utils.bank.depositXOfItem(int itemid, int quantity);
Examples:
utils.bank.depositXOfItem(1234, 10);
utils.bank.depositXOfItem(ItemID.KNIFE, 5);
Deposits a specified quantity of an item, identified by its item ID.
depositAllOfItems()
Overloads:
// The `...` means you can add as many params as you want
utils.bank.depositAllOfItems(int itemids...);
Examples:
utils.bank.depositAllOfItems(123, 456, 789);
utils.bank.depositAllOfItems(ItemID.CHARCOAL, ItemID.PAPYRUS, ItemID.ROPE, ItemID.CHAIR);
Deposits all items matching the provided item IDs.
withdrawXOfItem()
Overloads:
utils.bank.withdrawXOfItem(int itemid, int quantity);
Examples:
utils.bank.withdrawXOfItem(123, 2);
utils.bank.withdrawXOfItem(ItemID.KNIFE, 2);
Deposits all items matching the provided item IDs.
Debug Commands
sendLog()
Overloads:
utils.debug.sendLog(Object message);
Examples:
utils.debug.sendLog("Opening the bank.");
utils.bank.openBank();
if(utils.bank.isOpen()){
utils.debug.sendLog("The bank is open.");
}
Sends a debug message to the Scripter Logger.
sendRedGameMessage()
Overloads:
utils.debug.sendRedGameMessage(Object message, String scriptName);
Examples:
utils.debug.sendRedGameMessage("Opening the bank.", "Bank Opener");
utils.bank.openBank();
if(utils.bank.isOpen()){
utils.debug.sendRedGameMessage("The bank is open.", "Bank Opener");
}
Sends a red debug message to the in game chat.
sendGreenGameMessage()
Overloads:
utils.debug.sendGreenGameMessage(Object message, String scriptName);
Examples:
utils.debug.sendGreenGameMessage("Opening the bank.", "Bank Opener");
utils.bank.openBank();
if(utils.bank.isOpen()){
utils.debug.sendGreenGameMessage("The bank is open.", "Bank Opener");
}
Sends a red debug message to the in game chat.
updateOverlayState()
Overloads:
utils.debug.updateOverlayState(Object message);
Examples:
utils.updateOverlayState(getState());
function getState(){
if(!utils.bank.isOpen()){
return BANKING;
}
return DOING_NOTHING;
}
var State = {
DOING_NOTHING: "DOING_NOTHING",
BANKING: "BANKING"
}
Updates the overlay with your state.
Events
npcSpawned()
Overloads:
utils.event.npcSpawned(int id, int timeoutMillis);
Returns:
boolean
Examples:
if(utils.event.npcSpawned(NpcID.HANS, 10)){
utils.debug.sendLog("Hans spawned within 10 seconds");
} else {
utils.debug.sendLog("Hans did not spawn within 10 seconds");
}
Returns a boolean indicating if the NPC with the specified ID spawned within the given timeout.
gameTick()
Overloads:
utils.event.gameTick();
Returns:
boolean
Examples:
utils.debug.sendLog("Time from here:");
utils.event.gameTick();
utils.debug.sendLog("To here is most likely around 600ms~");
Returns a boolean indicating if the gametick happens within 1000ms.
sleep()
Overloads:
utils.event.sleep(int minMilli, int maxMilli);
Examples:
utils.debug.sendLog("Time from here:");
utils.event.sleep(1000, 1500);
utils.debug.sendLog("To here is between 1000 - 1500ms");
Sleeps for a duration between min and max milliseconds.
Inventory Queries
containsAll()
Overloads:
utils.inventory.containsAll(int... itemIds);
Returns:
boolean
Examples:
if (utils.inventory.containsAll(ItemID.KNIFE, ItemID.LOGS)) {
//Perform actions when inventory contains all of the specified items
}
Checks if the inventory contains all of the specified items.
containsAny()
Overloads:
utils.inventory.containsAny(int... itemIds);
Returns:
boolean
Examples:
if (utils.inventory.containsAny(ItemID.KNIFE, ItemID.LOGS)) {
//Perform actions when inventory contains any of the specified items
}
Checks if the inventory contains any of the specified items.
containsAmount()
Overloads:
utils.inventory.containsAmount(int itemId, int amount, boolean exactAmount);
Returns:
boolean
Examples:
if (utils.inventory.containsAmount(ItemID.LOGS, 2, false)) {
//Perform actions when inventory contains 2 or more logs
}
if (utils.inventory.containsAmount(ItemID.LOGS, 2, true)) {
//Perform actions when inventory contains exactly 2 logs
}
Checks if the inventory contains an exact amount or more of a specified item.
isFull()
Overloads:
utils.inventory.isFull();
Returns:
boolean
Examples:
if (utils.inventory.isFull()) {
//Perform actions when the inventory is full
}
Checks if the inventory is full.
isEmpty()
Overloads:
utils.inventory.isEmpty();
Returns:
boolean
Examples:
if (utils.inventory.isEmpty()) {
//Perform actions when the inventory is empty
}
Checks if the inventory is empty.
Inventory Commands
interactItem()
Overloads:
utils.inventory.interactItem(int itemId, String action);
utils.inventory.interactItem(String name, boolean exactName, String action);
Examples:
utils.inventory.interactItem(ItemID.SPADE, "Dig");
utils.inventory.interactItem("Spade", true, "Dig");
Interacts with an item via the specified menu option.
itemOnItem()
Overloads:
utils.inventory.itemOnItem(int itemId, int targetItemId);
Examples:
utils.inventory.itemOnItem(ItemID.KNIFE, ItemID.LOGS);
Uses an item on the target item.
itemOnNpc()
Overloads:
utils.inventory.itemOnNpc(int itemId, int targetNpcId);
Examples:
utils.inventory.itemOnNpc(ItemID.GRIMY_SNAPDRAGON, NpcID.LEPRECHAUN);
Uses an item on the target npc.
itemOnObject()
Overloads:
utils.inventory.itemOnObject(int itemId, int targetObjectId);
Examples:
utils.inventory.itemOnObject(ItemID.BRONZE_KEY, ObjectID.GATE);
Uses an item on the target object.
Errors
TBA