diff --git a/cache/src/main/java/net/runelite/cache/script/Instruction.java b/cache/src/main/java/net/runelite/cache/script/Instruction.java new file mode 100644 index 0000000000..8eb8a2bb3f --- /dev/null +++ b/cache/src/main/java/net/runelite/cache/script/Instruction.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.cache.script; + +public class Instruction +{ + private final int opcode; + private String name; + private int intStackPops; + private int stringStackPops; + private int intStackPushes; + private int stringStackPushes; + + public Instruction(int opcode) + { + this.opcode = opcode; + } + + public int getOpcode() + { + return opcode; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public int getIntStackPops() + { + return intStackPops; + } + + public void setIntStackPops(int intStackPops) + { + this.intStackPops = intStackPops; + } + + public int getStringStackPops() + { + return stringStackPops; + } + + public void setStringStackPops(int stringStackPops) + { + this.stringStackPops = stringStackPops; + } + + public int getIntStackPushes() + { + return intStackPushes; + } + + public void setIntStackPushes(int intStackPushes) + { + this.intStackPushes = intStackPushes; + } + + public int getStringStackPushes() + { + return stringStackPushes; + } + + public void setStringStackPushes(int stringStackPushes) + { + this.stringStackPushes = stringStackPushes; + } +} diff --git a/cache/src/main/java/net/runelite/cache/script/Instructions.java b/cache/src/main/java/net/runelite/cache/script/Instructions.java new file mode 100644 index 0000000000..80c59f9d63 --- /dev/null +++ b/cache/src/main/java/net/runelite/cache/script/Instructions.java @@ -0,0 +1,326 @@ +/* + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.cache.script; + +import java.util.HashMap; +import java.util.Map; + +public class Instructions +{ + private static Map instructions = new HashMap<>(); + + public static void init() + { + add(Opcodes.LOAD_INT, 0, 1); + add(Opcodes.GET_SETTINGS, 0, 1); + add(Opcodes.PUT_SETTINGS, 0, 1); + add(Opcodes.LOAD_STRING, 0, 0, 0, 1); + add(Opcodes.JUMP, 0, 0); + add(Opcodes.IF_ICMPNE, 2, 0); + add(Opcodes.IF_ICMPEQ, 2, 0); + add(Opcodes.IF_ICMPLT, 2, 0); + add(Opcodes.IF_ICMPGT, 2, 0); + add(Opcodes.RETURN, 0, 0); + add(25, 0, 1); + add(27, 1, 0); + add(Opcodes.IF_ICMPLE, 2, 0); + add(Opcodes.IF_ICMPGE, 2, 0); + add(33, 0, 1); + add(34, 1, 0); + add(35, 0, 0, 0, 1); + add(36, 0, 0, 1, 0); + // 37 - pops strings eq to int operand, pushes 1 string + add(Opcodes.POP_INT, 1, 0); + add(Opcodes.POP_STRING, 0, 0, 1, 0); + // 40 seems to interact with other scripts, variable pops/pushes + add(42, 0, 1); + add(43, 1, 0); + add(44, 1, 0); + add(45, 1, 1); + add(46, 2, 0); + add(47, 0, 0, 0, 1); + add(48, 0, 0, 1, 0); + add(100, 3, 0); + add(101, 0, 0); + add(102, 1, 0); + add(200, 2, 1); + add(201, 1, 1); + // 2000-2100 are the same as 1000-1100, but + // pop an additional int which is used to get the current widget + add(1000, 4, 0); + add(1001, 4, 0); + add(Opcodes.WIDGET_PUT_HIDDEN, 1, 0); + add(1005, 1, 0); + add(1006, 1, 0); + // 2100-2200 and 1100-1200 do the same thing + add(Opcodes.WIDGET_PUT_SCROLL, 2, 0); + add(Opcodes.WIDGET_PUT_TEXTCOLOR, 1, 0); + add(1102, 1, 0); + add(Opcodes.WIDGET_PUT_OPACITY, 1, 0); + add(1104, 1, 0); + add(Opcodes.WIDGET_PUT_TEXTUREID, 1, 0); + add(1106, 1, 0); + add(1107, 1, 0); + add(Opcodes.WIDGET_PUT_MODELID_1, 1, 0); + add(1109, 6, 0); + add(1110, 1, 0); + add(1111, 1, 0); + add(1112, 0, 0, 1, 0); + add(Opcodes.WIDGET_PUT_FONTID, 1, 0); + add(1114, 3, 0); + add(1115, 1, 0); + add(Opcodes.WIDGET_PUT_BORDERTHICKNESS, 1, 0); + add(1117, 1, 0); + add(Opcodes.WIDGET_PUT_FLIPPEDVERTICALLY, 1, 0); + add(Opcodes.WIDGET_PUT_FLIPPEDHORIZONALLY, 1, 0); + add(Opcodes.WIDGET_PUT_SCROLLWIDTHHEIGHT, 2, 0); + add(1121, 0, 0); + add(1122, 1, 0); + add(1123, 1, 0); + add(1124, 1, 0); + add(1125, 1, 0); + // and 1200-1300 and 2200-2300 + add(Opcodes.WIDGET_PUT_MODELID_2, 1, 0); + add(Opcodes.WIDGET_PUT_MODELID_3, 0, 0); + add(1200, 2, 0); + add(1205, 2, 0); + add(1212, 2, 0); + // and 1300-1400 and 2300-2400 + add(1300, 1, 0, 1, 0); + add(1301, 2, 0); + add(1302, 1, 0); + add(1303, 1, 0); + add(1304, 1, 0); + add(Opcodes.WIDGET_PUT_NAME, 0, 0, 1, 0); + add(1306, 0, 0, 1, 0); + add(Opcodes.WIDGET_PUT_ACTIONS_NULL, 0, 0); + // and 1400-1500 and 2400-2500 + // and 1500-1600 and 2500-2600 + add(Opcodes.WIDGET_GET_RELATIVEX, 0, 1); + add(Opcodes.WIDGET_GET_RELATIVEY, 0, 1); + add(Opcodes.WIDGET_GET_WIDTH, 0, 1); + add(Opcodes.WIDGET_GET_HEIGHT, 0, 1); + add(Opcodes.WIDGET_GET_HIDDEN, 0, 1); + add(Opcodes.WIDGET_GET_PARENTID, 0, 1); + // and 1600-1700 and 2600-2700 + add(Opcodes.WIDGET_GET_SCROLLX, 0, 1); + add(Opcodes.WIDGET_GET_SCROLLY, 0, 1); + add(Opcodes.WIDGET_GET_TEXT, 0, 0, 0, 1); + add(Opcodes.WIDGET_GET_SCROLLWIDTH, 0, 1); + add(Opcodes.WIDGET_GET_SCROLLHEIGHT, 0, 1); + add(1605, 0, 1); + add(Opcodes.WIDGET_GET_ROTATIONX, 0, 1); + add(Opcodes.WIDGET_GET_ROTATIONY, 0, 1); + add(Opcodes.WIDGET_GET_ROTATIONZ, 0, 1); + add(Opcodes.WIDGET_GET_OPACITY, 0, 1); + add(1610, 0, 1); + add(Opcodes.WIDGET_GET_TEXTCOLOR, 0, 1); + add(1612, 0, 1); + add(1613, 0, 1); + // 1700 + add(Opcodes.WIDGET_GET_ITEMID, 0, 1); + add(Opcodes.WIDGET_GET_STACKSIZE, 0, 1); + add(1702, 0, 1); + add(1800, 0, 1); + add(1801, 1, 0, 0, 1); + add(Opcodes.WIDGET_GET_NAME, 0, 0, 0, 1); + // and 1900-2000 and 2900-3000 + add(1927, 0, 0); + // 2000-2100 + add(2000, 5, 0); + add(2001, 5, 0); + add(Opcodes.WIDGET_PUT_HIDDEN_WIDGET, 2, 0); + add(2005, 2, 0); + add(2006, 2, 0); + // 2100-2200 + add(Opcodes.WIDGET_PUT_SCROLL_WIDGET, 3, 0); + add(Opcodes.WIDGET_PUT_TEXTCOLOR_WIDGET, 2, 0); + add(2102, 2, 0); + add(Opcodes.WIDGET_PUT_OPACITY_WIDGET, 2, 0); + add(2104, 2, 0); + add(Opcodes.WIDGET_PUT_TEXTUREID_WIDGET, 2, 0); + add(2106, 2, 0); + add(2107, 2, 0); + add(Opcodes.WIDGET_PUT_MODELID_1_WIDGET, 2, 0); + add(2109, 7, 0); + add(2110, 2, 0); + add(2111, 2, 0); + add(2112, 1, 0, 1, 0); + add(Opcodes.WIDGET_PUT_FONTID_WIDGET, 2, 0); + add(2114, 4, 0); + add(2115, 2, 0); + add(Opcodes.WIDGET_PUT_BORDERTHICKNESS_WIDGET, 2, 0); + add(2117, 2, 0); + add(Opcodes.WIDGET_PUT_FLIPPEDVERTICALLY_WIDGET, 2, 0); + add(Opcodes.WIDGET_PUT_FLIPPEDHORIZONALLY_WIDGET, 2, 0); + add(Opcodes.WIDGET_PUT_SCROLLWIDTHHEIGHT_WIDGET, 3, 0); + add(2121, 1, 0); + add(2122, 2, 0); + add(2123, 2, 0); + add(2124, 2, 0); + add(2125, 2, 0); + // 2200-2300 + add(Opcodes.WIDGET_PUT_MODELID_2_WIDGET, 2, 0); + add(Opcodes.WIDGET_PUT_MODELID_3_WIDGET, 1, 0); + add(2200, 3, 0); + add(2205, 3, 0); + add(2212, 3, 0); + // 2300-2400 + add(2300, 2, 0, 1, 0); + add(2301, 3, 0); + add(2302, 2, 0); + add(2303, 2, 0); + add(2304, 2, 0); + add(Opcodes.WIDGET_PUT_NAME_WIDGET, 1, 0, 1, 0); + add(2306, 1, 0, 1, 0); + add(Opcodes.WIDGET_PUT_ACTIONS_NULL_WIDGET, 1, 0); + // 2400-2500 + // 2500-2600 + add(Opcodes.WIDGET_GET_RELATIVEX_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_RELATIVEY_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_WIDTH_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_HEIGHT_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_HIDDEN_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_PARENTID_WIDGET, 1, 1); + // 2600-2700 + add(Opcodes.WIDGET_GET_SCROLLX_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_SCROLLY_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_TEXT_WIDGET, 1, 0, 0, 1); + add(Opcodes.WIDGET_GET_SCROLLWIDTH_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_SCROLLHEIGHT_WIDGET, 1, 1); + add(2605, 1, 1); + add(Opcodes.WIDGET_GET_ROTATIONX_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_ROTATIONY_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_ROTATIONZ_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_OPACITY_WIDGET, 1, 1); + add(2610, 1, 1); + add(Opcodes.WIDGET_GET_TEXTCOLOR_WIDGET, 1, 1); + add(2612, 1, 1); + add(2613, 1, 1); + // 2700-2800 + add(Opcodes.WIDGET_GET_ITEMID_WIDGET, 1, 1); + add(Opcodes.WIDGET_GET_STACKSIZE_WIDGET, 1, 1); + add(2702, 1, 1); + add(2706, 0, 1); + // 2800-2900 + add(2800, 1, 1); + add(2801, 2, 0, 0, 1); + add(Opcodes.WIDGET_GET_NAME_WIDGET, 1, 0, 0, 1); + // 2900-3000 + add(2927, 1, 0); + // 3000-3200 + add(Opcodes.SEND_GAME_MESSAGE, 0, 0, 1, 0); + add(3101, 2, 0); + add(3103, 0, 0); + add(3104, 0, 0, 1, 0); + add(3105, 0, 0, 1, 0); + add(3106, 0, 0, 1, 0); + add(3107, 1, 0, 1, 0); + add(3108, 3, 0); + add(3109, 2, 0); + add(3110, 1, 0); + add(3111, 0, 1); + add(3112, 1, 0); + add(3113, 1, 0, 1, 0); + add(3115, 1, 0); + add(3116, 1, 0, 2, 0); + add(3117, 1, 0); + // 3200-3300 + add(3200, 3, 0); + add(3201, 1, 0); + add(3202, 2, 0); + // 3300-3400 + add(Opcodes.GET_GAMECYCLE, 0, 1); + add(3301, 2, 0); + add(3302, 2, 1); + add(3303, 2, 1); + add(3304, 1, 1); + add(Opcodes.GET_BOOSTEDSKILLLEVELS, 1, 1); + add(Opcodes.GET_REALSKILLLEVELS, 1, 1); + add(Opcodes.GET_SKILLEXPERIENCES, 1, 1); + add(Opcodes.GET_COORDINATES, 0, 1); + add(Opcodes.DIVIDE_BY_16384, 1, 1); + add(Opcodes.RIGHT_SHIFT_28, 1, 1); + add(Opcodes.AND_16384, 1, 1); + add(Opcodes.GET_ISMEMBERS, 0, 1); + add(3313, 2, 1); + add(3314, 2, 1); + add(3315, 2, 1); + add(3316, 0, 1); + add(3317, 0, 1); + add(Opcodes.GET_WORLD, 0, 1); + add(Opcodes.GET_ENERGY, 0, 1); + add(Opcodes.GET_WEIGHT, 0, 1); + add(3323, 0, 1); + add(Opcodes.GET_FLAGS, 0, 1); + // 3400-3500 + add(3400, 2, 0, 0, 1); + // 3408 is variable + // 3500-3700 + add(Opcodes.GET_FRIENDCOUNT, 0, 1); + add(Opcodes.GET_FRIEND, 1, 0, 0, 2); + add(Opcodes.GET_FRIEND_WORLD, 1, 1); + add(Opcodes.GET_FRIEND_RANK, 1, 1); + add(3604, 1, 0, 1, 0); + add(Opcodes.ADD_FRIEND, 0, 0, 1, 0); + add(Opcodes.REMOVE_FRIEND, 0, 0, 1, 0); + add(Opcodes.ADD_IGNORE, 0, 0, 1, 0); + add(Opcodes.REMOVE_IGNORE, 0, 0, 1, 0); + add(3609, 0, 1, 1, 0); + add(3611, 0, 0, 0, 1); + add(Opcodes.GET_CLANCHATCOUNT, 0, 1); + add(Opcodes.GET_CLAN_MEMBER_NAME, 1, 0, 0, 1); + add(Opcodes.GET_CLAN_MEMBER_WORLD, 1, 1); + add(Opcodes.GET_CLAN_MEMBER_RANK, 1, 1); + add(3616, 0, 1); + add(3617, 0, 0, 1, 0); + add(3618, 0, 1); + add(3619, 0, 0, 1, 0); + add(3620, 0, 0); + add(Opcodes.GET_IGNORECOUNT, 0, 1); + add(Opcodes.GET_IGNORE, 1, 0, 0, 2); + add(3623, 0, 1, 1, 0); + add(Opcodes.CLANMEMBER_ISME, 1, 1); + add(Opcodes.GET_CLANCHATOWNER, 0, 0, 0, 1); + // 3700-4000 + } + + private static void add(int opcode, int ipops, int ipushes, int spops, int spushes) + { + Instruction i = new Instruction(opcode); + i.setIntStackPops(ipops); + i.setIntStackPushes(ipushes); + i.setStringStackPops(spops); + i.setStringStackPushes(spushes); + + assert instructions.containsKey(opcode) == false; + instructions.put(opcode, i); + } + + private static void add(int opcode, int ipops, int ipushes) + { + add(opcode, ipops, ipushes, 0, 0); + } +} diff --git a/cache/src/main/java/net/runelite/cache/script/Opcodes.java b/cache/src/main/java/net/runelite/cache/script/Opcodes.java new file mode 100644 index 0000000000..87a78d0128 --- /dev/null +++ b/cache/src/main/java/net/runelite/cache/script/Opcodes.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.cache.script; + +public class Opcodes +{ + public static final int LOAD_INT = 0; + public static final int GET_SETTINGS = 1; + public static final int PUT_SETTINGS = 2; + public static final int LOAD_STRING = 3; + public static final int JUMP = 6; + public static final int IF_ICMPNE = 7; + public static final int IF_ICMPEQ = 8; + public static final int IF_ICMPLT = 9; + public static final int IF_ICMPGT = 10; + public static final int RETURN = 21; + public static final int IF_ICMPLE = 31; + public static final int IF_ICMPGE = 32; + public static final int POP_INT = 38; + public static final int POP_STRING = 39; + //public static final int INVOKE = 40; + public static final int WIDGET_PUT_HIDDEN = 1003; + public static final int WIDGET_PUT_SCROLL = 1100; + public static final int WIDGET_PUT_TEXTCOLOR = 1101; + public static final int WIDGET_PUT_OPACITY = 1103; + public static final int WIDGET_PUT_TEXTUREID = 1105; + public static final int WIDGET_PUT_MODELID_1 = 1108; + public static final int WIDGET_PUT_FONTID = 1113; + public static final int WIDGET_PUT_BORDERTHICKNESS = 1116; + public static final int WIDGET_PUT_FLIPPEDVERTICALLY = 1118; + public static final int WIDGET_PUT_FLIPPEDHORIZONALLY = 1119; + public static final int WIDGET_PUT_SCROLLWIDTHHEIGHT = 1120; + public static final int WIDGET_PUT_MODELID_2 = 1201; + public static final int WIDGET_PUT_MODELID_3 = 1202; + public static final int WIDGET_PUT_NAME = 1305; + public static final int WIDGET_PUT_ACTIONS_NULL = 1307; + public static final int WIDGET_GET_RELATIVEX = 1500; + public static final int WIDGET_GET_RELATIVEY = 1501; + public static final int WIDGET_GET_WIDTH = 1502; + public static final int WIDGET_GET_HEIGHT = 1503; + public static final int WIDGET_GET_HIDDEN = 1504; + public static final int WIDGET_GET_PARENTID = 1505; + public static final int WIDGET_GET_SCROLLX = 1600; + public static final int WIDGET_GET_SCROLLY = 1601; + public static final int WIDGET_GET_TEXT = 1602; + public static final int WIDGET_GET_SCROLLWIDTH = 1603; + public static final int WIDGET_GET_SCROLLHEIGHT = 1604; + public static final int WIDGET_GET_ROTATIONX = 1606; + public static final int WIDGET_GET_ROTATIONY = 1607; + public static final int WIDGET_GET_ROTATIONZ = 1608; + public static final int WIDGET_GET_OPACITY = 1609; + public static final int WIDGET_GET_TEXTCOLOR = 1611; + public static final int WIDGET_GET_ITEMID = 1700; + public static final int WIDGET_GET_STACKSIZE = 1701; + public static final int WIDGET_GET_NAME = 1802; + public static final int WIDGET_PUT_HIDDEN_WIDGET = WIDGET_PUT_HIDDEN + 1000; + public static final int WIDGET_PUT_SCROLL_WIDGET = WIDGET_PUT_SCROLL + 1000; + public static final int WIDGET_PUT_TEXTCOLOR_WIDGET = WIDGET_PUT_TEXTCOLOR + 1000; + public static final int WIDGET_PUT_OPACITY_WIDGET = WIDGET_PUT_OPACITY + 1000; + public static final int WIDGET_PUT_TEXTUREID_WIDGET = WIDGET_PUT_TEXTUREID + 1000; + public static final int WIDGET_PUT_MODELID_1_WIDGET = WIDGET_PUT_MODELID_1 + 1000; + public static final int WIDGET_PUT_FONTID_WIDGET = WIDGET_PUT_FONTID + 1000; + public static final int WIDGET_PUT_BORDERTHICKNESS_WIDGET = WIDGET_PUT_BORDERTHICKNESS + 1000; + public static final int WIDGET_PUT_FLIPPEDVERTICALLY_WIDGET = WIDGET_PUT_FLIPPEDVERTICALLY + 1000; + public static final int WIDGET_PUT_FLIPPEDHORIZONALLY_WIDGET = WIDGET_PUT_FLIPPEDHORIZONALLY + 1000; + public static final int WIDGET_PUT_SCROLLWIDTHHEIGHT_WIDGET = WIDGET_PUT_SCROLLWIDTHHEIGHT + 1000; + public static final int WIDGET_PUT_MODELID_2_WIDGET = WIDGET_PUT_MODELID_2 + 1000; + public static final int WIDGET_PUT_MODELID_3_WIDGET = WIDGET_PUT_MODELID_3 + 1000; + public static final int WIDGET_PUT_NAME_WIDGET = WIDGET_PUT_NAME + 1000; + public static final int WIDGET_PUT_ACTIONS_NULL_WIDGET = WIDGET_PUT_ACTIONS_NULL + 1000; + public static final int WIDGET_GET_RELATIVEX_WIDGET = WIDGET_GET_RELATIVEX + 1000; + public static final int WIDGET_GET_RELATIVEY_WIDGET = WIDGET_GET_RELATIVEY + 1000; + public static final int WIDGET_GET_WIDTH_WIDGET = WIDGET_GET_WIDTH + 1000; + public static final int WIDGET_GET_HEIGHT_WIDGET = WIDGET_GET_HEIGHT + 1000; + public static final int WIDGET_GET_HIDDEN_WIDGET = WIDGET_GET_HIDDEN + 1000; + public static final int WIDGET_GET_PARENTID_WIDGET = WIDGET_GET_PARENTID + 1000; + public static final int WIDGET_GET_SCROLLX_WIDGET = WIDGET_GET_SCROLLX + 1000; + public static final int WIDGET_GET_SCROLLY_WIDGET = WIDGET_GET_SCROLLY + 1000; + public static final int WIDGET_GET_TEXT_WIDGET = WIDGET_GET_TEXT + 1000; + public static final int WIDGET_GET_SCROLLWIDTH_WIDGET = WIDGET_GET_SCROLLWIDTH + 1000; + public static final int WIDGET_GET_SCROLLHEIGHT_WIDGET = WIDGET_GET_SCROLLHEIGHT + 1000; + public static final int WIDGET_GET_ROTATIONX_WIDGET = WIDGET_GET_ROTATIONX + 1000; + public static final int WIDGET_GET_ROTATIONY_WIDGET = WIDGET_GET_ROTATIONY + 1000; + public static final int WIDGET_GET_ROTATIONZ_WIDGET = WIDGET_GET_ROTATIONZ + 1000; + public static final int WIDGET_GET_OPACITY_WIDGET = WIDGET_GET_OPACITY + 1000; + public static final int WIDGET_GET_TEXTCOLOR_WIDGET = WIDGET_GET_TEXTCOLOR + 1000; + public static final int WIDGET_GET_ITEMID_WIDGET = WIDGET_GET_ITEMID + 1000; + public static final int WIDGET_GET_STACKSIZE_WIDGET = WIDGET_GET_STACKSIZE + 1000; + public static final int WIDGET_GET_NAME_WIDGET = WIDGET_GET_NAME + 1000; + public static final int SEND_GAME_MESSAGE = 3100; + public static final int GET_GAMECYCLE = 3300; + public static final int GET_BOOSTEDSKILLLEVELS = 3305; + public static final int GET_REALSKILLLEVELS = 3306; + public static final int GET_SKILLEXPERIENCES = 3307; + public static final int GET_COORDINATES = 3308; + public static final int DIVIDE_BY_16384 = 3309; + public static final int RIGHT_SHIFT_28 = 3310; + public static final int AND_16384 = 3311; + public static final int GET_ISMEMBERS = 3312; + public static final int GET_WORLD = 3318; + public static final int GET_ENERGY = 3321; + public static final int GET_WEIGHT = 3322; + public static final int GET_FLAGS = 3324; + public static final int GET_FRIENDCOUNT = 3600; + public static final int GET_FRIEND = 3601; + public static final int GET_FRIEND_WORLD = 3602; + public static final int GET_FRIEND_RANK = 3603; + public static final int ADD_FRIEND = 3605; + public static final int REMOVE_FRIEND = 3606; + public static final int ADD_IGNORE = 3607; + public static final int REMOVE_IGNORE = 3608; + public static final int GET_CLANCHATCOUNT = 3612; + public static final int GET_CLAN_MEMBER_NAME = 3613; + public static final int GET_CLAN_MEMBER_WORLD = 3614; + public static final int GET_CLAN_MEMBER_RANK = 3615; + public static final int GET_IGNORECOUNT = 3621; + public static final int GET_IGNORE = 3622; + public static final int CLANMEMBER_ISME = 3624; + public static final int GET_CLANCHATOWNER = 3625; +} diff --git a/cache/src/test/java/net/runelite/cache/script/InstructionsTest.java b/cache/src/test/java/net/runelite/cache/script/InstructionsTest.java new file mode 100644 index 0000000000..9f7df6e888 --- /dev/null +++ b/cache/src/test/java/net/runelite/cache/script/InstructionsTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.cache.script; + +import org.junit.Test; + +public class InstructionsTest +{ + @Test + public void testInit() + { + Instructions.init(); + } + +}