diff --git a/cache/src/main/java/net/runelite/cache/script/Instructions.java b/cache/src/main/java/net/runelite/cache/script/Instructions.java index 7146c8a74d..3c7adc31ff 100644 --- a/cache/src/main/java/net/runelite/cache/script/Instructions.java +++ b/cache/src/main/java/net/runelite/cache/script/Instructions.java @@ -28,9 +28,8 @@ package net.runelite.cache.script; import java.util.HashMap; import java.util.Map; -import static net.runelite.cache.script.Opcodes.*; -public class Instructions +public class Instructions implements Opcodes { private final Map instructions = new HashMap<>(); private final Map instructionsByName = new HashMap<>(); diff --git a/cache/src/main/java/net/runelite/cache/script/Opcodes.java b/cache/src/main/java/net/runelite/cache/script/Opcodes.java index bb5df7ed1f..5db3b0b495 100644 --- a/cache/src/main/java/net/runelite/cache/script/Opcodes.java +++ b/cache/src/main/java/net/runelite/cache/script/Opcodes.java @@ -26,543 +26,543 @@ */ package net.runelite.cache.script; -public class Opcodes +public interface Opcodes { - public static final int ICONST = 0; - public static final int GET_VARP = 1; - public static final int SET_VARP = 2; - public static final int SCONST = 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 GET_VARBIT = 25; - public static final int SET_VARBIT = 27; - public static final int IF_ICMPLE = 31; - public static final int IF_ICMPGE = 32; - public static final int ILOAD = 33; - public static final int ISTORE = 34; - public static final int SLOAD = 35; - public static final int SSTORE = 36; - public static final int JOIN_STRING = 37; - public static final int POP_INT = 38; - public static final int POP_STRING = 39; - public static final int INVOKE = 40; - public static final int GET_VARC_INT = 42; - public static final int SET_VARC_INT = 43; - public static final int DEFINE_ARRAY = 44; - public static final int GET_ARRAY_INT = 45; - public static final int SET_ARRAY_INT = 46; - public static final int GET_VARC_STRING_OLD = 47; - public static final int SET_VARC_STRING_OLD = 48; - public static final int GET_VARC_STRING = 49; - public static final int SET_VARC_STRING = 50; - public static final int SWITCH = 60; - public static final int GET_VARCLANSETTING = 74;; - public static final int GET_VARCLAN = 76;; - public static final int CC_CREATE = 100; - public static final int CC_DELETE = 101; - public static final int CC_DELETEALL = 102; - public static final int CC_FIND = 200; - public static final int IF_FIND = 201; - public static final int CC_SETPOSITION = 1000; - public static final int CC_SETSIZE = 1001; - public static final int CC_SETHIDE = 1003; - public static final int CC_SETNOCLICKTHROUGH = 1005; - public static final int CC_SETNOSCROLLTHROUGH = 1006; - public static final int CC_SETSCROLLPOS = 1100; - public static final int CC_SETCOLOUR = 1101; - public static final int CC_SETFILL = 1102; - public static final int CC_SETTRANS = 1103; - public static final int CC_SETLINEWID = 1104; - public static final int CC_SETGRAPHIC = 1105; - public static final int CC_SET2DANGLE = 1106; - public static final int CC_SETTILING = 1107; - public static final int CC_SETMODEL = 1108; - public static final int CC_SETMODELANGLE = 1109; - public static final int CC_SETMODELANIM = 1110; - public static final int CC_SETMODELORTHOG = 1111; - public static final int CC_SETTEXT = 1112; - public static final int CC_SETTEXTFONT = 1113; - public static final int CC_SETTEXTALIGN = 1114; - public static final int CC_SETTEXTSHADOW = 1115; - public static final int CC_SETOUTLINE = 1116; - public static final int CC_SETGRAPHICSHADOW = 1117; - public static final int CC_SETVFLIP = 1118; - public static final int CC_SETHFLIP = 1119; - public static final int CC_SETSCROLLSIZE = 1120; - public static final int CC_RESUME_PAUSEBUTTON = 1121; - public static final int CC_SETFILLCOLOUR = 1123; - public static final int CC_SETLINEDIRECTION = 1126; - public static final int CC_SETMODELTRANSPARENT = 1127; - public static final int CC_SETOBJECT = 1200; - public static final int CC_SETNPCHEAD = 1201; - public static final int CC_SETPLAYERHEAD_SELF = 1202; - public static final int CC_SETOBJECT_NONUM = 1205; - public static final int CC_SETOBJECT_ALWAYS_NUM = 1212; - public static final int CC_SETOP = 1300; - public static final int CC_SETDRAGGABLE = 1301; - public static final int CC_SETDRAGGABLEBEHAVIOR = 1302; - public static final int CC_SETDRAGDEADZONE = 1303; - public static final int CC_SETDRAGDEADTIME = 1304; - public static final int CC_SETOPBASE = 1305; - public static final int CC_SETTARGETVERB = 1306; - public static final int CC_CLEAROPS = 1307; - public static final int CC_SETOPKEY = 1350; - public static final int CC_SETOPTKEY = 1351; - public static final int CC_SETOPKEYRATE = 1352; - public static final int CC_SETOPTKEYRATE = 1353; - public static final int CC_SETOPKEYIGNOREHELD = 1354; - public static final int CC_SETOPTKEYIGNOREHELD = 1355; - public static final int CC_SETONCLICK = 1400; - public static final int CC_SETONHOLD = 1401; - public static final int CC_SETONRELEASE = 1402; - public static final int CC_SETONMOUSEOVER = 1403; - public static final int CC_SETONMOUSELEAVE = 1404; - public static final int CC_SETONDRAG = 1405; - public static final int CC_SETONTARGETLEAVE = 1406; - public static final int CC_SETONVARTRANSMIT = 1407; - public static final int CC_SETONTIMER = 1408; - public static final int CC_SETONOP = 1409; - public static final int CC_SETONDRAGCOMPLETE = 1410; - public static final int CC_SETONCLICKREPEAT = 1411; - public static final int CC_SETONMOUSEREPEAT = 1412; - public static final int CC_SETONINVTRANSMIT = 1414; - public static final int CC_SETONSTATTRANSMIT = 1415; - public static final int CC_SETONTARGETENTER = 1416; - public static final int CC_SETONSCROLLWHEEL = 1417; - public static final int CC_SETONCHATTRANSMIT = 1418; - public static final int CC_SETONKEY = 1419; - public static final int CC_SETONFRIENDTRANSMIT = 1420; - public static final int CC_SETONCLANTRANSMIT = 1421; - public static final int CC_SETONMISCTRANSMIT = 1422; - public static final int CC_SETONDIALOGABORT = 1423; - public static final int CC_SETONSUBCHANGE = 1424; - public static final int CC_SETONSTOCKTRANSMIT = 1425; - public static final int CC_SETONRESIZE = 1427; - public static final int CC_SETONCLANSETTINGSTRANSMIT = 1428;; - public static final int CC_SETONCLANCHANNELTRANSMIT = 1429;; - public static final int CC_GETX = 1500; - public static final int CC_GETY = 1501; - public static final int CC_GETWIDTH = 1502; - public static final int CC_GETHEIGHT = 1503; - public static final int CC_GETHIDE = 1504; - public static final int CC_GETLAYER = 1505; - public static final int CC_GETSCROLLX = 1600; - public static final int CC_GETSCROLLY = 1601; - public static final int CC_GETTEXT = 1602; - public static final int CC_GETSCROLLWIDTH = 1603; - public static final int CC_GETSCROLLHEIGHT = 1604; - public static final int CC_GETMODELZOOM = 1605; - public static final int CC_GETMODELANGLE_X = 1606; - public static final int CC_GETMODELANGLE_Z = 1607; - public static final int CC_GETMODELANGLE_Y = 1608; - public static final int CC_GETTRANS = 1609; - public static final int CC_GETCOLOUR = 1611; - public static final int CC_GETFILLCOLOUR = 1612; - public static final int CC_GETMODELTRANSPARENT = 1614; - public static final int CC_GETINVOBJECT = 1700; - public static final int CC_GETINVCOUNT = 1701; - public static final int CC_GETID = 1702; - public static final int CC_GETTARGETMASK = 1800; - public static final int CC_GETOP = 1801; - public static final int CC_GETOPBASE = 1802; - public static final int CC_CALLONRESIZE = 1927; - public static final int CC_TRIGGEROP = 1928; - public static final int IF_SETPOSITION = 2000; - public static final int IF_SETSIZE = 2001; - public static final int IF_SETHIDE = 2003; - public static final int IF_SETNOCLICKTHROUGH = 2005; - public static final int IF_SETNOSCROLLTHROUGH = 2006; - public static final int IF_SETSCROLLPOS = 2100; - public static final int IF_SETCOLOUR = 2101; - public static final int IF_SETFILL = 2102; - public static final int IF_SETTRANS = 2103; - public static final int IF_SETLINEWID = 2104; - public static final int IF_SETGRAPHIC = 2105; - public static final int IF_SET2DANGLE = 2106; - public static final int IF_SETTILING = 2107; - public static final int IF_SETMODEL = 2108; - public static final int IF_SETMODELANGLE = 2109; - public static final int IF_SETMODELANIM = 2110; - public static final int IF_SETMODELORTHOG = 2111; - public static final int IF_SETTEXT = 2112; - public static final int IF_SETTEXTFONT = 2113; - public static final int IF_SETTEXTALIGN = 2114; - public static final int IF_SETTEXTSHADOW = 2115; - public static final int IF_SETOUTLINE = 2116; - public static final int IF_SETGRAPHICSHADOW = 2117; - public static final int IF_SETVFLIP = 2118; - public static final int IF_SETHFLIP = 2119; - public static final int IF_SETSCROLLSIZE = 2120; - public static final int IF_RESUME_PAUSEBUTTON = 2121; - public static final int IF_SETFILLCOLOUR = 2123; - public static final int IF_SETLINEDIRECTION = 2126; - public static final int IF_SETMODELTRANSPARENT = 2127; - public static final int IF_SETOBJECT = 2200; - public static final int IF_SETNPCHEAD = 2201; - public static final int IF_SETPLAYERHEAD_SELF = 2202; - public static final int IF_SETOBJECT_NONUM = 2205; - public static final int IF_SETOBJECT_ALWAYS_NUM = 2212; - public static final int IF_SETOP = 2300; - public static final int IF_SETDRAGGABLE = 2301; - public static final int IF_SETDRAGGABLEBEHAVIOR = 2302; - public static final int IF_SETDRAGDEADZONE = 2303; - public static final int IF_SETDRAGDEADTIME = 2304; - public static final int IF_SETOPBASE = 2305; - public static final int IF_SETTARGETVERB = 2306; - public static final int IF_CLEAROPS = 2307; - public static final int IF_SETOPKEY = 2350; - public static final int IF_SETOPTKEY = 2351; - public static final int IF_SETOPKEYRATE = 2352; - public static final int IF_SETOPTKEYRATE = 2353; - public static final int IF_SETOPKEYIGNOREHELD = 2354; - public static final int IF_SETOPTKEYIGNOREHELD = 2355; - public static final int IF_SETONCLICK = 2400; - public static final int IF_SETONHOLD = 2401; - public static final int IF_SETONRELEASE = 2402; - public static final int IF_SETONMOUSEOVER = 2403; - public static final int IF_SETONMOUSELEAVE = 2404; - public static final int IF_SETONDRAG = 2405; - public static final int IF_SETONTARGETLEAVE = 2406; - public static final int IF_SETONVARTRANSMIT = 2407; - public static final int IF_SETONTIMER = 2408; - public static final int IF_SETONOP = 2409; - public static final int IF_SETONDRAGCOMPLETE = 2410; - public static final int IF_SETONCLICKREPEAT = 2411; - public static final int IF_SETONMOUSEREPEAT = 2412; - public static final int IF_SETONINVTRANSMIT = 2414; - public static final int IF_SETONSTATTRANSMIT = 2415; - public static final int IF_SETONTARGETENTER = 2416; - public static final int IF_SETONSCROLLWHEEL = 2417; - public static final int IF_SETONCHATTRANSMIT = 2418; - public static final int IF_SETONKEY = 2419; - public static final int IF_SETONFRIENDTRANSMIT = 2420; - public static final int IF_SETONCLANTRANSMIT = 2421; - public static final int IF_SETONMISCTRANSMIT = 2422; - public static final int IF_SETONDIALOGABORT = 2423; - public static final int IF_SETONSUBCHANGE = 2424; - public static final int IF_SETONSTOCKTRANSMIT = 2425; - public static final int IF_SETONRESIZE = 2427; - public static final int IF_SETONCLANSETTINGSTRANSMIT = 2428;; - public static final int IF_SETONCLANCHANNELTRANSMIT = 2429;; - public static final int IF_GETX = 2500; - public static final int IF_GETY = 2501; - public static final int IF_GETWIDTH = 2502; - public static final int IF_GETHEIGHT = 2503; - public static final int IF_GETHIDE = 2504; - public static final int IF_GETLAYER = 2505; - public static final int IF_GETSCROLLX = 2600; - public static final int IF_GETSCROLLY = 2601; - public static final int IF_GETTEXT = 2602; - public static final int IF_GETSCROLLWIDTH = 2603; - public static final int IF_GETSCROLLHEIGHT = 2604; - public static final int IF_GETMODELZOOM = 2605; - public static final int IF_GETMODELANGLE_X = 2606; - public static final int IF_GETMODELANGLE_Z = 2607; - public static final int IF_GETMODELANGLE_Y = 2608; - public static final int IF_GETTRANS = 2609; - public static final int IF_GETCOLOUR = 2611; - public static final int IF_GETFILLCOLOUR = 2612; - public static final int IF_GETMODELTRANSPARENT = 2614; - public static final int IF_GETINVOBJECT = 2700; - public static final int IF_GETINVCOUNT = 2701; - public static final int IF_HASSUB = 2702; - public static final int IF_GETTOP = 2706; - public static final int IF_GETTARGETMASK = 2800; - public static final int IF_GETOP = 2801; - public static final int IF_GETOPBASE = 2802; - public static final int IF_CALLONRESIZE = 2927; - public static final int IF_TRIGGEROP = 2928; - public static final int MES = 3100; - public static final int ANIM = 3101; - public static final int IF_CLOSE = 3103; - public static final int RESUME_COUNTDIALOG = 3104; - public static final int RESUME_NAMEDIALOG = 3105; - public static final int RESUME_STRINGDIALOG = 3106; - public static final int OPPLAYER = 3107; - public static final int IF_DRAGPICKUP = 3108; - public static final int CC_DRAGPICKUP = 3109; - public static final int MOUSECAM = 3110; - public static final int GETREMOVEROOFS = 3111; - public static final int SETREMOVEROOFS = 3112; - public static final int OPENURL = 3113; - public static final int RESUME_OBJDIALOG = 3115; - public static final int BUG_REPORT = 3116; - public static final int SETSHIFTCLICKDROP = 3117; - public static final int SETSHOWMOUSEOVERTEXT = 3118; - public static final int RENDERSELF = 3119; - public static final int SETSHOWMOUSECROSS = 3125; - public static final int SETSHOWLOADINGMESSAGES = 3126; - public static final int SETTAPTODROP = 3127; - public static final int GETTAPTODROP = 3128; - public static final int GETCANVASSIZE = 3132; - public static final int MOBILE_SETFPS = 3133; - public static final int MOBILE_OPENSTORE = 3134; - public static final int MOBILE_OPENSTORECATEGORY = 3135; - public static final int SETHIDEUSERNAME = 3141; - public static final int GETHIDEUSERNAME = 3142; - public static final int SETREMEMBERUSERNAME = 3143; - public static final int GETREMEMBERUSERNAME = 3144; - public static final int SHOW_IOS_REVIEW = 3145; - public static final int SOUND_SYNTH = 3200; - public static final int SOUND_SONG = 3201; - public static final int SOUND_JINGLE = 3202; - public static final int CLIENTCLOCK = 3300; - public static final int INV_GETOBJ = 3301; - public static final int INV_GETNUM = 3302; - public static final int INV_TOTAL = 3303; - public static final int INV_SIZE = 3304; - public static final int STAT = 3305; - public static final int STAT_BASE = 3306; - public static final int STAT_XP = 3307; - public static final int COORD = 3308; - public static final int COORDX = 3309; - public static final int COORDZ = 3310; - public static final int COORDY = 3311; - public static final int MAP_MEMBERS = 3312; - public static final int INVOTHER_GETOBJ = 3313; - public static final int INVOTHER_GETNUM = 3314; - public static final int INVOTHER_TOTAL = 3315; - public static final int STAFFMODLEVEL = 3316; - public static final int REBOOTTIMER = 3317; - public static final int MAP_WORLD = 3318; - public static final int RUNENERGY_VISIBLE = 3321; - public static final int RUNWEIGHT_VISIBLE = 3322; - public static final int PLAYERMOD = 3323; - public static final int WORLDFLAGS = 3324; - public static final int MOVECOORD = 3325; - public static final int ENUM_STRING = 3400; - public static final int ENUM = 3408; - public static final int ENUM_GETOUTPUTCOUNT = 3411; - public static final int FRIEND_COUNT = 3600; - public static final int FRIEND_GETNAME = 3601; - public static final int FRIEND_GETWORLD = 3602; - public static final int FRIEND_GETRANK = 3603; - public static final int FRIEND_SETRANK = 3604; - public static final int FRIEND_ADD = 3605; - public static final int FRIEND_DEL = 3606; - public static final int IGNORE_ADD = 3607; - public static final int IGNORE_DEL = 3608; - public static final int FRIEND_TEST = 3609; - public static final int CLAN_GETCHATDISPLAYNAME = 3611; - public static final int CLAN_GETCHATCOUNT = 3612; - public static final int CLAN_GETCHATUSERNAME = 3613; - public static final int CLAN_GETCHATUSERWORLD = 3614; - public static final int CLAN_GETCHATUSERRANK = 3615; - public static final int CLAN_GETCHATMINKICK = 3616; - public static final int CLAN_KICKUSER = 3617; - public static final int CLAN_GETCHATRANK = 3618; - public static final int CLAN_JOINCHAT = 3619; - public static final int CLAN_LEAVECHAT = 3620; - public static final int IGNORE_COUNT = 3621; - public static final int IGNORE_GETNAME = 3622; - public static final int IGNORE_TEST = 3623; - public static final int CLAN_ISSELF = 3624; - public static final int CLAN_GETCHATOWNERNAME = 3625; - public static final int CLAN_ISFRIEND = 3626; - public static final int CLAN_ISIGNORE = 3627; - public static final int ACTIVECLANSETTINGS_FIND_LISTENED = 3800; - public static final int ACTIVECLANSETTINGS_FIND_AFFINED = 3801; - public static final int ACTIVECLANSETTINGS_GETCLANNAME = 3802; - public static final int ACTIVECLANSETTINGS_GETALLOWUNAFFINED = 3803; - public static final int ACTIVECLANSETTINGS_GETRANKTALK = 3804; - public static final int ACTIVECLANSETTINGS_GETRANKKICK = 3805; - public static final int ACTIVECLANSETTINGS_GETRANKLOOTSHARE = 3806; - public static final int ACTIVECLANSETTINGS_GETCOINSHARE = 3807; - public static final int ACTIVECLANSETTINGS_GETAFFINEDCOUNT = 3809; - public static final int ACTIVECLANSETTINGS_GETAFFINEDDISPLAYNAME = 3810; - public static final int ACTIVECLANSETTINGS_GETAFFINEDRANK = 3811; - public static final int ACTIVECLANSETTINGS_GETBANNEDCOUNT = 3812; - public static final int ACTIVECLANSETTINGS_GETBANNEDDISPLAYNAME = 3813; - public static final int ACTIVECLANSETTINGS_GETAFFINEDEXTRAINFO = 3814; - public static final int ACTIVECLANSETTINGS_GETCURRENTOWNER_SLOT = 3815; - public static final int ACTIVECLANSETTINGS_GETREPLACEMENTOWNER_SLOT = 3816; - public static final int ACTIVECLANSETTINGS_GETAFFINEDSLOT = 3817; - public static final int ACTIVECLANSETTINGS_GETSORTEDAFFINEDSLOT = 3818; - public static final int AFFINEDCLANSETTINGS_ADDBANNED_FROMCHANNEL = 3819; - public static final int ACTIVECLANSETTINGS_GETAFFINEDJOINRUNEDAY = 3820; - public static final int AFFINEDCLANSETTINGS_SETMUTED_FROMCHANNEL = 3821; - public static final int ACTIVECLANSETTINGS_GETAFFINEDMUTED = 3822; - public static final int ACTIVECLANCHANNEL_FIND_LISTENED = 3850; - public static final int ACTIVECLANCHANNEL_FIND_AFFINED = 3851; - public static final int ACTIVECLANCHANNEL_GETCLANNAME = 3852; - public static final int ACTIVECLANCHANNEL_GETRANKKICK = 3853; - public static final int ACTIVECLANCHANNEL_GETRANKTALK = 3854; - public static final int ACTIVECLANCHANNEL_GETUSERCOUNT = 3855; - public static final int ACTIVECLANCHANNEL_GETUSERDISPLAYNAME = 3856; - public static final int ACTIVECLANCHANNEL_GETUSERRANK = 3857; - public static final int ACTIVECLANCHANNEL_GETUSERWORLD = 3858; - public static final int ACTIVECLANCHANNEL_KICKUSER = 3859; - public static final int ACTIVECLANCHANNEL_GETUSERSLOT = 3860; - public static final int ACTIVECLANCHANNEL_GETSORTEDUSERSLOT = 3861; - public static final int CLANPROFILE_FIND = 3890; - public static final int STOCKMARKET_GETOFFERTYPE = 3903; - public static final int STOCKMARKET_GETOFFERITEM = 3904; - public static final int STOCKMARKET_GETOFFERPRICE = 3905; - public static final int STOCKMARKET_GETOFFERCOUNT = 3906; - public static final int STOCKMARKET_GETOFFERCOMPLETEDCOUNT = 3907; - public static final int STOCKMARKET_GETOFFERCOMPLETEDGOLD = 3908; - public static final int STOCKMARKET_ISOFFEREMPTY = 3910; - public static final int STOCKMARKET_ISOFFERSTABLE = 3911; - public static final int STOCKMARKET_ISOFFERFINISHED = 3912; - public static final int STOCKMARKET_ISOFFERADDING = 3913; - public static final int TRADINGPOST_SORTBY_NAME = 3914; - public static final int TRADINGPOST_SORTBY_PRICE = 3915; - public static final int TRADINGPOST_SORTFILTERBY_WORLD = 3916; - public static final int TRADINGPOST_SORTBY_AGE = 3917; - public static final int TRADINGPOST_SORTBY_COUNT = 3918; - public static final int TRADINGPOST_GETTOTALOFFERS = 3919; - public static final int TRADINGPOST_GETOFFERWORLD = 3920; - public static final int TRADINGPOST_GETOFFERNAME = 3921; - public static final int TRADINGPOST_GETOFFERPREVIOUSNAME = 3922; - public static final int TRADINGPOST_GETOFFERAGE = 3923; - public static final int TRADINGPOST_GETOFFERCOUNT = 3924; - public static final int TRADINGPOST_GETOFFERPRICE = 3925; - public static final int TRADINGPOST_GETOFFERITEM = 3926; - public static final int ADD = 4000; - public static final int SUB = 4001; - public static final int MULTIPLY = 4002; - public static final int DIV = 4003; - public static final int RANDOM = 4004; - public static final int RANDOMINC = 4005; - public static final int INTERPOLATE = 4006; - public static final int ADDPERCENT = 4007; - public static final int SETBIT = 4008; - public static final int CLEARBIT = 4009; - public static final int TESTBIT = 4010; - public static final int MOD = 4011; - public static final int POW = 4012; - public static final int INVPOW = 4013; - public static final int AND = 4014; - public static final int OR = 4015; - public static final int SCALE = 4018; - public static final int BITCOUNT = 4025; - public static final int TOGGLEBIT = 4026; - public static final int SETBIT_RANGE = 4027; - public static final int CLEARBIT_RANGE = 4028; - public static final int GETBIT_RANGE = 4029; - public static final int APPEND_NUM = 4100; - public static final int APPEND = 4101; - public static final int APPEND_SIGNNUM = 4102; - public static final int LOWERCASE = 4103; - public static final int FROMDATE = 4104; - public static final int TEXT_GENDER = 4105; - public static final int TOSTRING = 4106; - public static final int COMPARE = 4107; - public static final int PARAHEIGHT = 4108; - public static final int PARAWIDTH = 4109; - public static final int TEXT_SWITCH = 4110; - public static final int ESCAPE = 4111; - public static final int APPEND_CHAR = 4112; - public static final int CHAR_ISPRINTABLE = 4113; - public static final int CHAR_ISALPHANUMERIC = 4114; - public static final int CHAR_ISALPHA = 4115; - public static final int CHAR_ISNUMERIC = 4116; - public static final int STRING_LENGTH = 4117; - public static final int SUBSTRING = 4118; - public static final int REMOVETAGS = 4119; - public static final int STRING_INDEXOF_CHAR = 4120; - public static final int STRING_INDEXOF_STRING = 4121; - public static final int OC_NAME = 4200; - public static final int OC_OP = 4201; - public static final int OC_IOP = 4202; - public static final int OC_COST = 4203; - public static final int OC_STACKABLE = 4204; - public static final int OC_CERT = 4205; - public static final int OC_UNCERT = 4206; - public static final int OC_MEMBERS = 4207; - public static final int OC_PLACEHOLDER = 4208; - public static final int OC_UNPLACEHOLDER = 4209; - public static final int OC_FIND = 4210; - public static final int OC_FINDNEXT = 4211; - public static final int OC_FINDRESET = 4212; - public static final int CHAT_GETFILTER_PUBLIC = 5000; - public static final int CHAT_SETFILTER = 5001; - public static final int CHAT_SENDABUSEREPORT = 5002; - public static final int CHAT_GETHISTORY_BYTYPEANDLINE = 5003; - public static final int CHAT_GETHISTORY_BYUID = 5004; - public static final int CHAT_GETFILTER_PRIVATE = 5005; - public static final int CHAT_SENDPUBLIC = 5008; - public static final int CHAT_SENDPRIVATE = 5009; - public static final int CHAT_SENDCLAN = 5010; - public static final int CHAT_PLAYERNAME = 5015; - public static final int CHAT_GETFILTER_TRADE = 5016; - public static final int CHAT_GETHISTORYLENGTH = 5017; - public static final int CHAT_GETNEXTUID = 5018; - public static final int CHAT_GETPREVUID = 5019; - public static final int DOCHEAT = 5020; - public static final int CHAT_SETMESSAGEFILTER = 5021; - public static final int CHAT_GETMESSAGEFILTER = 5022; - public static final int WRITECONSOLE = 5023; - public static final int GETWINDOWMODE = 5306; - public static final int SETWINDOWMODE = 5307; - public static final int GETDEFAULTWINDOWMODE = 5308; - public static final int SETDEFAULTWINDOWMODE = 5309; - public static final int CAM_FORCEANGLE = 5504; - public static final int CAM_GETANGLE_XA = 5505; - public static final int CAM_GETANGLE_YA = 5506; - public static final int CAM_SETFOLLOWHEIGHT = 5530; - public static final int CAM_GETFOLLOWHEIGHT = 5531; - public static final int LOGOUT = 5630; - public static final int VIEWPORT_SETFOV = 6200; - public static final int VIEWPORT_SETZOOM = 6201; - public static final int VIEWPORT_CLAMPFOV = 6202; - public static final int VIEWPORT_GETEFFECTIVESIZE = 6203; - public static final int VIEWPORT_GETZOOM = 6204; - public static final int VIEWPORT_GETFOV = 6205; - public static final int WORLDLIST_FETCH = 6500; - public static final int WORLDLIST_START = 6501; - public static final int WORLDLIST_NEXT = 6502; - public static final int WORLDLIST_SPECIFIC = 6506; - public static final int WORLDLIST_SORT = 6507; - public static final int SETFOLLOWEROPSLOWPRIORITY = 6512; - public static final int NC_PARAM = 6513; - public static final int LC_PARAM = 6514; - public static final int OC_PARAM = 6515; - public static final int STRUCT_PARAM = 6516; - public static final int ON_MOBILE = 6518; - public static final int CLIENTTYPE = 6519; - public static final int MOBILE_KEYBOARDHIDE = 6521; - public static final int MOBILE_BATTERYLEVEL = 6524; - public static final int MOBILE_BATTERYCHARGING = 6525; - public static final int MOBILE_WIFIAVAILABLE = 6526; - public static final int WORLDMAP_GETMAPNAME = 6601; - public static final int WORLDMAP_SETMAP = 6602; - public static final int WORLDMAP_GETZOOM = 6603; - public static final int WORLDMAP_SETZOOM = 6604; - public static final int WORLDMAP_ISLOADED = 6605; - public static final int WORLDMAP_JUMPTODISPLAYCOORD = 6606; - public static final int WORLDMAP_JUMPTODISPLAYCOORD_INSTANT = 6607; - public static final int WORLDMAP_JUMPTOSOURCECOORD = 6608; - public static final int WORLDMAP_JUMPTOSOURCECOORD_INSTANT = 6609; - public static final int WORLDMAP_GETDISPLAYPOSITION = 6610; - public static final int WORLDMAP_GETCONFIGORIGIN = 6611; - public static final int WORLDMAP_GETCONFIGSIZE = 6612; - public static final int WORLDMAP_GETCONFIGBOUNDS = 6613; - public static final int WORLDMAP_GETCONFIGZOOM = 6614; - public static final int WORLDMAP_GETCURRENTMAP = 6616; - public static final int WORLDMAP_GETDISPLAYCOORD = 6617; - public static final int WORLDMAP_COORDINMAP = 6621; - public static final int WORLDMAP_GETSIZE = 6622; - public static final int WORLDMAP_PERPETUALFLASH = 6628; - public static final int WORLDMAP_FLASHELEMENT = 6629; - public static final int WORLDMAP_FLASHELEMENTCATEGORY = 6630; - public static final int WORLDMAP_STOPCURRENTFLASHES = 6631; - public static final int WORLDMAP_DISABLEELEMENTS = 6632; - public static final int WORLDMAP_DISABLEELEMENT = 6633; - public static final int WORLDMAP_DISABLEELEMENTCATEGORY = 6634; - public static final int WORLDMAP_GETDISABLEELEMENTS = 6635; - public static final int WORLDMAP_GETDISABLEELEMENT = 6636; - public static final int WORLDMAP_GETDISABLEELEMENTCATEGORY = 6637; - public static final int WORLDMAP_LISTELEMENT_START = 6639; - public static final int WORLDMAP_LISTELEMENT_NEXT = 6640; - public static final int MEC_TEXT = 6693; - public static final int MEC_TEXTSIZE = 6694; - public static final int MEC_CATEGORY = 6695; - public static final int MEC_SPRITE = 6696; - public static final int WORLDMAP_ELEMENT = 6697; - public static final int WORLDMAP_ELEMENTCOORD = 6699; + int ICONST = 0; + int GET_VARP = 1; + int SET_VARP = 2; + int SCONST = 3; + int JUMP = 6; + int IF_ICMPNE = 7; + int IF_ICMPEQ = 8; + int IF_ICMPLT = 9; + int IF_ICMPGT = 10; + int RETURN = 21; + int GET_VARBIT = 25; + int SET_VARBIT = 27; + int IF_ICMPLE = 31; + int IF_ICMPGE = 32; + int ILOAD = 33; + int ISTORE = 34; + int SLOAD = 35; + int SSTORE = 36; + int JOIN_STRING = 37; + int POP_INT = 38; + int POP_STRING = 39; + int INVOKE = 40; + int GET_VARC_INT = 42; + int SET_VARC_INT = 43; + int DEFINE_ARRAY = 44; + int GET_ARRAY_INT = 45; + int SET_ARRAY_INT = 46; + int GET_VARC_STRING_OLD = 47; + int SET_VARC_STRING_OLD = 48; + int GET_VARC_STRING = 49; + int SET_VARC_STRING = 50; + int SWITCH = 60; + int GET_VARCLANSETTING = 74;; + int GET_VARCLAN = 76;; + int CC_CREATE = 100; + int CC_DELETE = 101; + int CC_DELETEALL = 102; + int CC_FIND = 200; + int IF_FIND = 201; + int CC_SETPOSITION = 1000; + int CC_SETSIZE = 1001; + int CC_SETHIDE = 1003; + int CC_SETNOCLICKTHROUGH = 1005; + int CC_SETNOSCROLLTHROUGH = 1006; + int CC_SETSCROLLPOS = 1100; + int CC_SETCOLOUR = 1101; + int CC_SETFILL = 1102; + int CC_SETTRANS = 1103; + int CC_SETLINEWID = 1104; + int CC_SETGRAPHIC = 1105; + int CC_SET2DANGLE = 1106; + int CC_SETTILING = 1107; + int CC_SETMODEL = 1108; + int CC_SETMODELANGLE = 1109; + int CC_SETMODELANIM = 1110; + int CC_SETMODELORTHOG = 1111; + int CC_SETTEXT = 1112; + int CC_SETTEXTFONT = 1113; + int CC_SETTEXTALIGN = 1114; + int CC_SETTEXTSHADOW = 1115; + int CC_SETOUTLINE = 1116; + int CC_SETGRAPHICSHADOW = 1117; + int CC_SETVFLIP = 1118; + int CC_SETHFLIP = 1119; + int CC_SETSCROLLSIZE = 1120; + int CC_RESUME_PAUSEBUTTON = 1121; + int CC_SETFILLCOLOUR = 1123; + int CC_SETLINEDIRECTION = 1126; + int CC_SETMODELTRANSPARENT = 1127; + int CC_SETOBJECT = 1200; + int CC_SETNPCHEAD = 1201; + int CC_SETPLAYERHEAD_SELF = 1202; + int CC_SETOBJECT_NONUM = 1205; + int CC_SETOBJECT_ALWAYS_NUM = 1212; + int CC_SETOP = 1300; + int CC_SETDRAGGABLE = 1301; + int CC_SETDRAGGABLEBEHAVIOR = 1302; + int CC_SETDRAGDEADZONE = 1303; + int CC_SETDRAGDEADTIME = 1304; + int CC_SETOPBASE = 1305; + int CC_SETTARGETVERB = 1306; + int CC_CLEAROPS = 1307; + int CC_SETOPKEY = 1350; + int CC_SETOPTKEY = 1351; + int CC_SETOPKEYRATE = 1352; + int CC_SETOPTKEYRATE = 1353; + int CC_SETOPKEYIGNOREHELD = 1354; + int CC_SETOPTKEYIGNOREHELD = 1355; + int CC_SETONCLICK = 1400; + int CC_SETONHOLD = 1401; + int CC_SETONRELEASE = 1402; + int CC_SETONMOUSEOVER = 1403; + int CC_SETONMOUSELEAVE = 1404; + int CC_SETONDRAG = 1405; + int CC_SETONTARGETLEAVE = 1406; + int CC_SETONVARTRANSMIT = 1407; + int CC_SETONTIMER = 1408; + int CC_SETONOP = 1409; + int CC_SETONDRAGCOMPLETE = 1410; + int CC_SETONCLICKREPEAT = 1411; + int CC_SETONMOUSEREPEAT = 1412; + int CC_SETONINVTRANSMIT = 1414; + int CC_SETONSTATTRANSMIT = 1415; + int CC_SETONTARGETENTER = 1416; + int CC_SETONSCROLLWHEEL = 1417; + int CC_SETONCHATTRANSMIT = 1418; + int CC_SETONKEY = 1419; + int CC_SETONFRIENDTRANSMIT = 1420; + int CC_SETONCLANTRANSMIT = 1421; + int CC_SETONMISCTRANSMIT = 1422; + int CC_SETONDIALOGABORT = 1423; + int CC_SETONSUBCHANGE = 1424; + int CC_SETONSTOCKTRANSMIT = 1425; + int CC_SETONRESIZE = 1427; + int CC_SETONCLANSETTINGSTRANSMIT = 1428;; + int CC_SETONCLANCHANNELTRANSMIT = 1429;; + int CC_GETX = 1500; + int CC_GETY = 1501; + int CC_GETWIDTH = 1502; + int CC_GETHEIGHT = 1503; + int CC_GETHIDE = 1504; + int CC_GETLAYER = 1505; + int CC_GETSCROLLX = 1600; + int CC_GETSCROLLY = 1601; + int CC_GETTEXT = 1602; + int CC_GETSCROLLWIDTH = 1603; + int CC_GETSCROLLHEIGHT = 1604; + int CC_GETMODELZOOM = 1605; + int CC_GETMODELANGLE_X = 1606; + int CC_GETMODELANGLE_Z = 1607; + int CC_GETMODELANGLE_Y = 1608; + int CC_GETTRANS = 1609; + int CC_GETCOLOUR = 1611; + int CC_GETFILLCOLOUR = 1612; + int CC_GETMODELTRANSPARENT = 1614; + int CC_GETINVOBJECT = 1700; + int CC_GETINVCOUNT = 1701; + int CC_GETID = 1702; + int CC_GETTARGETMASK = 1800; + int CC_GETOP = 1801; + int CC_GETOPBASE = 1802; + int CC_CALLONRESIZE = 1927; + int CC_TRIGGEROP = 1928; + int IF_SETPOSITION = 2000; + int IF_SETSIZE = 2001; + int IF_SETHIDE = 2003; + int IF_SETNOCLICKTHROUGH = 2005; + int IF_SETNOSCROLLTHROUGH = 2006; + int IF_SETSCROLLPOS = 2100; + int IF_SETCOLOUR = 2101; + int IF_SETFILL = 2102; + int IF_SETTRANS = 2103; + int IF_SETLINEWID = 2104; + int IF_SETGRAPHIC = 2105; + int IF_SET2DANGLE = 2106; + int IF_SETTILING = 2107; + int IF_SETMODEL = 2108; + int IF_SETMODELANGLE = 2109; + int IF_SETMODELANIM = 2110; + int IF_SETMODELORTHOG = 2111; + int IF_SETTEXT = 2112; + int IF_SETTEXTFONT = 2113; + int IF_SETTEXTALIGN = 2114; + int IF_SETTEXTSHADOW = 2115; + int IF_SETOUTLINE = 2116; + int IF_SETGRAPHICSHADOW = 2117; + int IF_SETVFLIP = 2118; + int IF_SETHFLIP = 2119; + int IF_SETSCROLLSIZE = 2120; + int IF_RESUME_PAUSEBUTTON = 2121; + int IF_SETFILLCOLOUR = 2123; + int IF_SETLINEDIRECTION = 2126; + int IF_SETMODELTRANSPARENT = 2127; + int IF_SETOBJECT = 2200; + int IF_SETNPCHEAD = 2201; + int IF_SETPLAYERHEAD_SELF = 2202; + int IF_SETOBJECT_NONUM = 2205; + int IF_SETOBJECT_ALWAYS_NUM = 2212; + int IF_SETOP = 2300; + int IF_SETDRAGGABLE = 2301; + int IF_SETDRAGGABLEBEHAVIOR = 2302; + int IF_SETDRAGDEADZONE = 2303; + int IF_SETDRAGDEADTIME = 2304; + int IF_SETOPBASE = 2305; + int IF_SETTARGETVERB = 2306; + int IF_CLEAROPS = 2307; + int IF_SETOPKEY = 2350; + int IF_SETOPTKEY = 2351; + int IF_SETOPKEYRATE = 2352; + int IF_SETOPTKEYRATE = 2353; + int IF_SETOPKEYIGNOREHELD = 2354; + int IF_SETOPTKEYIGNOREHELD = 2355; + int IF_SETONCLICK = 2400; + int IF_SETONHOLD = 2401; + int IF_SETONRELEASE = 2402; + int IF_SETONMOUSEOVER = 2403; + int IF_SETONMOUSELEAVE = 2404; + int IF_SETONDRAG = 2405; + int IF_SETONTARGETLEAVE = 2406; + int IF_SETONVARTRANSMIT = 2407; + int IF_SETONTIMER = 2408; + int IF_SETONOP = 2409; + int IF_SETONDRAGCOMPLETE = 2410; + int IF_SETONCLICKREPEAT = 2411; + int IF_SETONMOUSEREPEAT = 2412; + int IF_SETONINVTRANSMIT = 2414; + int IF_SETONSTATTRANSMIT = 2415; + int IF_SETONTARGETENTER = 2416; + int IF_SETONSCROLLWHEEL = 2417; + int IF_SETONCHATTRANSMIT = 2418; + int IF_SETONKEY = 2419; + int IF_SETONFRIENDTRANSMIT = 2420; + int IF_SETONCLANTRANSMIT = 2421; + int IF_SETONMISCTRANSMIT = 2422; + int IF_SETONDIALOGABORT = 2423; + int IF_SETONSUBCHANGE = 2424; + int IF_SETONSTOCKTRANSMIT = 2425; + int IF_SETONRESIZE = 2427; + int IF_SETONCLANSETTINGSTRANSMIT = 2428;; + int IF_SETONCLANCHANNELTRANSMIT = 2429;; + int IF_GETX = 2500; + int IF_GETY = 2501; + int IF_GETWIDTH = 2502; + int IF_GETHEIGHT = 2503; + int IF_GETHIDE = 2504; + int IF_GETLAYER = 2505; + int IF_GETSCROLLX = 2600; + int IF_GETSCROLLY = 2601; + int IF_GETTEXT = 2602; + int IF_GETSCROLLWIDTH = 2603; + int IF_GETSCROLLHEIGHT = 2604; + int IF_GETMODELZOOM = 2605; + int IF_GETMODELANGLE_X = 2606; + int IF_GETMODELANGLE_Z = 2607; + int IF_GETMODELANGLE_Y = 2608; + int IF_GETTRANS = 2609; + int IF_GETCOLOUR = 2611; + int IF_GETFILLCOLOUR = 2612; + int IF_GETMODELTRANSPARENT = 2614; + int IF_GETINVOBJECT = 2700; + int IF_GETINVCOUNT = 2701; + int IF_HASSUB = 2702; + int IF_GETTOP = 2706; + int IF_GETTARGETMASK = 2800; + int IF_GETOP = 2801; + int IF_GETOPBASE = 2802; + int IF_CALLONRESIZE = 2927; + int IF_TRIGGEROP = 2928; + int MES = 3100; + int ANIM = 3101; + int IF_CLOSE = 3103; + int RESUME_COUNTDIALOG = 3104; + int RESUME_NAMEDIALOG = 3105; + int RESUME_STRINGDIALOG = 3106; + int OPPLAYER = 3107; + int IF_DRAGPICKUP = 3108; + int CC_DRAGPICKUP = 3109; + int MOUSECAM = 3110; + int GETREMOVEROOFS = 3111; + int SETREMOVEROOFS = 3112; + int OPENURL = 3113; + int RESUME_OBJDIALOG = 3115; + int BUG_REPORT = 3116; + int SETSHIFTCLICKDROP = 3117; + int SETSHOWMOUSEOVERTEXT = 3118; + int RENDERSELF = 3119; + int SETSHOWMOUSECROSS = 3125; + int SETSHOWLOADINGMESSAGES = 3126; + int SETTAPTODROP = 3127; + int GETTAPTODROP = 3128; + int GETCANVASSIZE = 3132; + int MOBILE_SETFPS = 3133; + int MOBILE_OPENSTORE = 3134; + int MOBILE_OPENSTORECATEGORY = 3135; + int SETHIDEUSERNAME = 3141; + int GETHIDEUSERNAME = 3142; + int SETREMEMBERUSERNAME = 3143; + int GETREMEMBERUSERNAME = 3144; + int SHOW_IOS_REVIEW = 3145; + int SOUND_SYNTH = 3200; + int SOUND_SONG = 3201; + int SOUND_JINGLE = 3202; + int CLIENTCLOCK = 3300; + int INV_GETOBJ = 3301; + int INV_GETNUM = 3302; + int INV_TOTAL = 3303; + int INV_SIZE = 3304; + int STAT = 3305; + int STAT_BASE = 3306; + int STAT_XP = 3307; + int COORD = 3308; + int COORDX = 3309; + int COORDZ = 3310; + int COORDY = 3311; + int MAP_MEMBERS = 3312; + int INVOTHER_GETOBJ = 3313; + int INVOTHER_GETNUM = 3314; + int INVOTHER_TOTAL = 3315; + int STAFFMODLEVEL = 3316; + int REBOOTTIMER = 3317; + int MAP_WORLD = 3318; + int RUNENERGY_VISIBLE = 3321; + int RUNWEIGHT_VISIBLE = 3322; + int PLAYERMOD = 3323; + int WORLDFLAGS = 3324; + int MOVECOORD = 3325; + int ENUM_STRING = 3400; + int ENUM = 3408; + int ENUM_GETOUTPUTCOUNT = 3411; + int FRIEND_COUNT = 3600; + int FRIEND_GETNAME = 3601; + int FRIEND_GETWORLD = 3602; + int FRIEND_GETRANK = 3603; + int FRIEND_SETRANK = 3604; + int FRIEND_ADD = 3605; + int FRIEND_DEL = 3606; + int IGNORE_ADD = 3607; + int IGNORE_DEL = 3608; + int FRIEND_TEST = 3609; + int CLAN_GETCHATDISPLAYNAME = 3611; + int CLAN_GETCHATCOUNT = 3612; + int CLAN_GETCHATUSERNAME = 3613; + int CLAN_GETCHATUSERWORLD = 3614; + int CLAN_GETCHATUSERRANK = 3615; + int CLAN_GETCHATMINKICK = 3616; + int CLAN_KICKUSER = 3617; + int CLAN_GETCHATRANK = 3618; + int CLAN_JOINCHAT = 3619; + int CLAN_LEAVECHAT = 3620; + int IGNORE_COUNT = 3621; + int IGNORE_GETNAME = 3622; + int IGNORE_TEST = 3623; + int CLAN_ISSELF = 3624; + int CLAN_GETCHATOWNERNAME = 3625; + int CLAN_ISFRIEND = 3626; + int CLAN_ISIGNORE = 3627; + int ACTIVECLANSETTINGS_FIND_LISTENED = 3800; + int ACTIVECLANSETTINGS_FIND_AFFINED = 3801; + int ACTIVECLANSETTINGS_GETCLANNAME = 3802; + int ACTIVECLANSETTINGS_GETALLOWUNAFFINED = 3803; + int ACTIVECLANSETTINGS_GETRANKTALK = 3804; + int ACTIVECLANSETTINGS_GETRANKKICK = 3805; + int ACTIVECLANSETTINGS_GETRANKLOOTSHARE = 3806; + int ACTIVECLANSETTINGS_GETCOINSHARE = 3807; + int ACTIVECLANSETTINGS_GETAFFINEDCOUNT = 3809; + int ACTIVECLANSETTINGS_GETAFFINEDDISPLAYNAME = 3810; + int ACTIVECLANSETTINGS_GETAFFINEDRANK = 3811; + int ACTIVECLANSETTINGS_GETBANNEDCOUNT = 3812; + int ACTIVECLANSETTINGS_GETBANNEDDISPLAYNAME = 3813; + int ACTIVECLANSETTINGS_GETAFFINEDEXTRAINFO = 3814; + int ACTIVECLANSETTINGS_GETCURRENTOWNER_SLOT = 3815; + int ACTIVECLANSETTINGS_GETREPLACEMENTOWNER_SLOT = 3816; + int ACTIVECLANSETTINGS_GETAFFINEDSLOT = 3817; + int ACTIVECLANSETTINGS_GETSORTEDAFFINEDSLOT = 3818; + int AFFINEDCLANSETTINGS_ADDBANNED_FROMCHANNEL = 3819; + int ACTIVECLANSETTINGS_GETAFFINEDJOINRUNEDAY = 3820; + int AFFINEDCLANSETTINGS_SETMUTED_FROMCHANNEL = 3821; + int ACTIVECLANSETTINGS_GETAFFINEDMUTED = 3822; + int ACTIVECLANCHANNEL_FIND_LISTENED = 3850; + int ACTIVECLANCHANNEL_FIND_AFFINED = 3851; + int ACTIVECLANCHANNEL_GETCLANNAME = 3852; + int ACTIVECLANCHANNEL_GETRANKKICK = 3853; + int ACTIVECLANCHANNEL_GETRANKTALK = 3854; + int ACTIVECLANCHANNEL_GETUSERCOUNT = 3855; + int ACTIVECLANCHANNEL_GETUSERDISPLAYNAME = 3856; + int ACTIVECLANCHANNEL_GETUSERRANK = 3857; + int ACTIVECLANCHANNEL_GETUSERWORLD = 3858; + int ACTIVECLANCHANNEL_KICKUSER = 3859; + int ACTIVECLANCHANNEL_GETUSERSLOT = 3860; + int ACTIVECLANCHANNEL_GETSORTEDUSERSLOT = 3861; + int CLANPROFILE_FIND = 3890; + int STOCKMARKET_GETOFFERTYPE = 3903; + int STOCKMARKET_GETOFFERITEM = 3904; + int STOCKMARKET_GETOFFERPRICE = 3905; + int STOCKMARKET_GETOFFERCOUNT = 3906; + int STOCKMARKET_GETOFFERCOMPLETEDCOUNT = 3907; + int STOCKMARKET_GETOFFERCOMPLETEDGOLD = 3908; + int STOCKMARKET_ISOFFEREMPTY = 3910; + int STOCKMARKET_ISOFFERSTABLE = 3911; + int STOCKMARKET_ISOFFERFINISHED = 3912; + int STOCKMARKET_ISOFFERADDING = 3913; + int TRADINGPOST_SORTBY_NAME = 3914; + int TRADINGPOST_SORTBY_PRICE = 3915; + int TRADINGPOST_SORTFILTERBY_WORLD = 3916; + int TRADINGPOST_SORTBY_AGE = 3917; + int TRADINGPOST_SORTBY_COUNT = 3918; + int TRADINGPOST_GETTOTALOFFERS = 3919; + int TRADINGPOST_GETOFFERWORLD = 3920; + int TRADINGPOST_GETOFFERNAME = 3921; + int TRADINGPOST_GETOFFERPREVIOUSNAME = 3922; + int TRADINGPOST_GETOFFERAGE = 3923; + int TRADINGPOST_GETOFFERCOUNT = 3924; + int TRADINGPOST_GETOFFERPRICE = 3925; + int TRADINGPOST_GETOFFERITEM = 3926; + int ADD = 4000; + int SUB = 4001; + int MULTIPLY = 4002; + int DIV = 4003; + int RANDOM = 4004; + int RANDOMINC = 4005; + int INTERPOLATE = 4006; + int ADDPERCENT = 4007; + int SETBIT = 4008; + int CLEARBIT = 4009; + int TESTBIT = 4010; + int MOD = 4011; + int POW = 4012; + int INVPOW = 4013; + int AND = 4014; + int OR = 4015; + int SCALE = 4018; + int BITCOUNT = 4025; + int TOGGLEBIT = 4026; + int SETBIT_RANGE = 4027; + int CLEARBIT_RANGE = 4028; + int GETBIT_RANGE = 4029; + int APPEND_NUM = 4100; + int APPEND = 4101; + int APPEND_SIGNNUM = 4102; + int LOWERCASE = 4103; + int FROMDATE = 4104; + int TEXT_GENDER = 4105; + int TOSTRING = 4106; + int COMPARE = 4107; + int PARAHEIGHT = 4108; + int PARAWIDTH = 4109; + int TEXT_SWITCH = 4110; + int ESCAPE = 4111; + int APPEND_CHAR = 4112; + int CHAR_ISPRINTABLE = 4113; + int CHAR_ISALPHANUMERIC = 4114; + int CHAR_ISALPHA = 4115; + int CHAR_ISNUMERIC = 4116; + int STRING_LENGTH = 4117; + int SUBSTRING = 4118; + int REMOVETAGS = 4119; + int STRING_INDEXOF_CHAR = 4120; + int STRING_INDEXOF_STRING = 4121; + int OC_NAME = 4200; + int OC_OP = 4201; + int OC_IOP = 4202; + int OC_COST = 4203; + int OC_STACKABLE = 4204; + int OC_CERT = 4205; + int OC_UNCERT = 4206; + int OC_MEMBERS = 4207; + int OC_PLACEHOLDER = 4208; + int OC_UNPLACEHOLDER = 4209; + int OC_FIND = 4210; + int OC_FINDNEXT = 4211; + int OC_FINDRESET = 4212; + int CHAT_GETFILTER_PUBLIC = 5000; + int CHAT_SETFILTER = 5001; + int CHAT_SENDABUSEREPORT = 5002; + int CHAT_GETHISTORY_BYTYPEANDLINE = 5003; + int CHAT_GETHISTORY_BYUID = 5004; + int CHAT_GETFILTER_PRIVATE = 5005; + int CHAT_SENDPUBLIC = 5008; + int CHAT_SENDPRIVATE = 5009; + int CHAT_SENDCLAN = 5010; + int CHAT_PLAYERNAME = 5015; + int CHAT_GETFILTER_TRADE = 5016; + int CHAT_GETHISTORYLENGTH = 5017; + int CHAT_GETNEXTUID = 5018; + int CHAT_GETPREVUID = 5019; + int DOCHEAT = 5020; + int CHAT_SETMESSAGEFILTER = 5021; + int CHAT_GETMESSAGEFILTER = 5022; + int WRITECONSOLE = 5023; + int GETWINDOWMODE = 5306; + int SETWINDOWMODE = 5307; + int GETDEFAULTWINDOWMODE = 5308; + int SETDEFAULTWINDOWMODE = 5309; + int CAM_FORCEANGLE = 5504; + int CAM_GETANGLE_XA = 5505; + int CAM_GETANGLE_YA = 5506; + int CAM_SETFOLLOWHEIGHT = 5530; + int CAM_GETFOLLOWHEIGHT = 5531; + int LOGOUT = 5630; + int VIEWPORT_SETFOV = 6200; + int VIEWPORT_SETZOOM = 6201; + int VIEWPORT_CLAMPFOV = 6202; + int VIEWPORT_GETEFFECTIVESIZE = 6203; + int VIEWPORT_GETZOOM = 6204; + int VIEWPORT_GETFOV = 6205; + int WORLDLIST_FETCH = 6500; + int WORLDLIST_START = 6501; + int WORLDLIST_NEXT = 6502; + int WORLDLIST_SPECIFIC = 6506; + int WORLDLIST_SORT = 6507; + int SETFOLLOWEROPSLOWPRIORITY = 6512; + int NC_PARAM = 6513; + int LC_PARAM = 6514; + int OC_PARAM = 6515; + int STRUCT_PARAM = 6516; + int ON_MOBILE = 6518; + int CLIENTTYPE = 6519; + int MOBILE_KEYBOARDHIDE = 6521; + int MOBILE_BATTERYLEVEL = 6524; + int MOBILE_BATTERYCHARGING = 6525; + int MOBILE_WIFIAVAILABLE = 6526; + int WORLDMAP_GETMAPNAME = 6601; + int WORLDMAP_SETMAP = 6602; + int WORLDMAP_GETZOOM = 6603; + int WORLDMAP_SETZOOM = 6604; + int WORLDMAP_ISLOADED = 6605; + int WORLDMAP_JUMPTODISPLAYCOORD = 6606; + int WORLDMAP_JUMPTODISPLAYCOORD_INSTANT = 6607; + int WORLDMAP_JUMPTOSOURCECOORD = 6608; + int WORLDMAP_JUMPTOSOURCECOORD_INSTANT = 6609; + int WORLDMAP_GETDISPLAYPOSITION = 6610; + int WORLDMAP_GETCONFIGORIGIN = 6611; + int WORLDMAP_GETCONFIGSIZE = 6612; + int WORLDMAP_GETCONFIGBOUNDS = 6613; + int WORLDMAP_GETCONFIGZOOM = 6614; + int WORLDMAP_GETCURRENTMAP = 6616; + int WORLDMAP_GETDISPLAYCOORD = 6617; + int WORLDMAP_COORDINMAP = 6621; + int WORLDMAP_GETSIZE = 6622; + int WORLDMAP_PERPETUALFLASH = 6628; + int WORLDMAP_FLASHELEMENT = 6629; + int WORLDMAP_FLASHELEMENTCATEGORY = 6630; + int WORLDMAP_STOPCURRENTFLASHES = 6631; + int WORLDMAP_DISABLEELEMENTS = 6632; + int WORLDMAP_DISABLEELEMENT = 6633; + int WORLDMAP_DISABLEELEMENTCATEGORY = 6634; + int WORLDMAP_GETDISABLEELEMENTS = 6635; + int WORLDMAP_GETDISABLEELEMENT = 6636; + int WORLDMAP_GETDISABLEELEMENTCATEGORY = 6637; + int WORLDMAP_LISTELEMENT_START = 6639; + int WORLDMAP_LISTELEMENT_NEXT = 6640; + int MEC_TEXT = 6693; + int MEC_TEXTSIZE = 6694; + int MEC_CATEGORY = 6695; + int MEC_SPRITE = 6696; + int WORLDMAP_ELEMENT = 6697; + int WORLDMAP_ELEMENTCOORD = 6699; } diff --git a/runelite-script-assembler-plugin/src/main/java/net/runelite/script/RuneLiteInstructions.java b/cache/src/main/java/net/runelite/cache/script/RuneLiteInstructions.java similarity index 88% rename from runelite-script-assembler-plugin/src/main/java/net/runelite/script/RuneLiteInstructions.java rename to cache/src/main/java/net/runelite/cache/script/RuneLiteInstructions.java index 02073e8144..f74d84f36f 100644 --- a/runelite-script-assembler-plugin/src/main/java/net/runelite/script/RuneLiteInstructions.java +++ b/cache/src/main/java/net/runelite/cache/script/RuneLiteInstructions.java @@ -22,12 +22,9 @@ * (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.script; +package net.runelite.cache.script; -import static net.runelite.api.Opcodes.RUNELITE_EXECUTE; -import net.runelite.cache.script.Instructions; - -public class RuneLiteInstructions extends Instructions +public class RuneLiteInstructions extends Instructions implements RuneLiteOpcodes { @Override public void init() diff --git a/runelite-api/src/main/java/net/runelite/api/Opcodes.java b/cache/src/main/java/net/runelite/cache/script/RuneLiteOpcodes.java similarity index 78% rename from runelite-api/src/main/java/net/runelite/api/Opcodes.java rename to cache/src/main/java/net/runelite/cache/script/RuneLiteOpcodes.java index b5fe92196a..092af67c36 100644 --- a/runelite-api/src/main/java/net/runelite/api/Opcodes.java +++ b/cache/src/main/java/net/runelite/cache/script/RuneLiteOpcodes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Adam + * Copyright (c) 2021, Adam * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,25 +22,12 @@ * (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.api; +package net.runelite.cache.script; -/** - * Utility class containing ASM opcodes used by the RuneLite client. - */ -public class Opcodes +public interface RuneLiteOpcodes extends Opcodes { - /** - * opcode used to return from scripts. - */ - public static final int RETURN = 21; - - /** - * opcode used to invoke scripts. - */ - public static final int INVOKE = 40; - /** * RuneLite execution opcode used to inject scripts. */ - public static final int RUNELITE_EXECUTE = 6599; + int RUNELITE_EXECUTE = 6599; } diff --git a/http-api/http-api.gradle.kts b/http-api/http-api.gradle.kts index 436fa78f13..a3997728cc 100644 --- a/http-api/http-api.gradle.kts +++ b/http-api/http-api.gradle.kts @@ -32,7 +32,6 @@ dependencies { compileOnly(group = "org.projectlombok", name = "lombok", version = ProjectVersions.lombokVersion) - implementation(project(":runelite-api")) implementation(group = "com.google.code.gson", name = "gson", version = "2.8.5") implementation(group = "com.google.guava", name = "guava", version = "30.1.1-jre") implementation(group = "com.squareup.okhttp3", name = "okhttp", version = "4.9.1") diff --git a/runelite-api/runelite-api.gradle.kts b/runelite-api/runelite-api.gradle.kts index 56b6cd4122..bbc959e457 100644 --- a/runelite-api/runelite-api.gradle.kts +++ b/runelite-api/runelite-api.gradle.kts @@ -30,6 +30,8 @@ dependencies { compileOnly(group = "org.projectlombok", name = "lombok", version = ProjectVersions.lombokVersion) + api(project(":cache")) + implementation(group = "com.google.code.findbugs", name = "jsr305", version = "3.0.2") implementation(group = "com.google.guava", name = "guava", version = "30.1.1-jre") implementation(group = "org.apache.commons", name = "commons-text", version = "1.9") diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java index 6864d8f5a5..228fd4a3dd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java @@ -776,6 +776,12 @@ public class GpuPlugin extends Plugin implements DrawCallbacks final Scene scene = client.getScene(); scene.setDrawDistance(getDrawDistance()); + // Only reset the target buffer offset right before drawing the scene. That way if there are frames + // after this that don't involve a scene draw, like during LOADING/HOPPING/CONNECTION_LOST, we can + // still redraw the previous frame's scene to emulate the client behavior of not painting over the + // viewport buffer. + targetBufferOffset = 0; + invokeOnMainThread(() -> { // UBO. Only the first 32 bytes get modified here, the rest is the constant sin/cos table. @@ -1029,21 +1035,9 @@ public class GpuPlugin extends Plugin implements DrawCallbacks private void drawFrame(int overlayColor) { - if (jawtWindow.getAWTComponent() != client.getCanvas()) - { - // We inject code in the game engine mixin to prevent the client from doing canvas replacement, - // so this should not ever be hit - log.warn("Canvas invalidated!"); - shutDown(); - startUp(); - return; - } - - if (client.getGameState() == GameState.LOADING || client.getGameState() == GameState.HOPPING) - { - // While the client is loading it doesn't draw - return; - } + // We inject code in the game engine mixin to prevent the client from doing canvas replacement, + // so this should not ever be tripped + assert jawtWindow.getAWTComponent() == client.getCanvas() : "canvas invalidated"; final int canvasHeight = client.getCanvasHeight(); final int canvasWidth = client.getCanvasWidth(); @@ -1105,7 +1099,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks // Draw 3d scene final TextureProvider textureProvider = client.getTextureProvider(); - if (textureProvider != null) + final GameState gameState = client.getGameState(); + if (textureProvider != null && gameState.getState() >= GameState.LOADING.getState()) { if (textureArrayId == -1) { @@ -1265,7 +1260,6 @@ public class GpuPlugin extends Plugin implements DrawCallbacks modelBufferSmall.clear(); modelBufferUnordered.clear(); - targetBufferOffset = 0; smallModels = largeModels = unorderedModels = 0; tempOffset = 0; tempUvOffset = 0; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/skillcalculator/SkillCalculator.java b/runelite-client/src/main/java/net/runelite/client/plugins/skillcalculator/SkillCalculator.java index 8d9581adde..672996ebeb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/skillcalculator/SkillCalculator.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/skillcalculator/SkillCalculator.java @@ -272,19 +272,15 @@ class SkillCalculator extends JPanel private void adjustCheckboxes(JCheckBox target, SkillBonus bonus) { - adjustXPBonus(0); - bonusCheckBoxes.forEach(otherSelectedCheckbox -> + for (JCheckBox otherSelectedCheckbox : bonusCheckBoxes) { if (otherSelectedCheckbox != target) { otherSelectedCheckbox.setSelected(false); } - }); - - if (target.isSelected()) - { - adjustXPBonus(bonus.getValue()); } + + adjustXPBonus(target.isSelected() ? bonus.getValue() : 0f); } private void renderActionSlots() @@ -347,7 +343,8 @@ class SkillCalculator extends JPanel int actionCount = 0; int neededXP = targetXP - currentXP; SkillAction action = slot.getAction(); - double xp = (action.isIgnoreBonus()) ? action.getXp() : action.getXp() * xpFactor; + final float bonus = action.isIgnoreBonus() ? 1f : xpFactor; + final double xp = Math.round(action.getXp() * bonus * 10f) / 10d; if (neededXP > 0) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterConfig.java index 4320b59e6c..7eb596275a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterConfig.java @@ -86,4 +86,15 @@ public interface SpecialCounterConfig extends Config { return 0; } + + @ConfigItem( + position = 5, + keyName = "bulwarkThreshold", + name = "Dinh's Bulwark", + description = "Threshold for Dinh's Bulwark (0 to disable)" + ) + default int bulwarkThreshold() + { + return 0; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialWeapon.java b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialWeapon.java index 2011a2e0e6..6d546b02a1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialWeapon.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialWeapon.java @@ -40,7 +40,7 @@ enum SpecialWeapon BARRELCHEST_ANCHOR("Barrelchest Anchor", new int[]{ItemID.BARRELCHEST_ANCHOR}, true, (c) -> 0), BONE_DAGGER("Bone Dagger", new int[]{ItemID.BONE_DAGGER, ItemID.BONE_DAGGER_P, ItemID.BONE_DAGGER_P_8876, ItemID.BONE_DAGGER_P_8878}, true, (c) -> 0), DORGESHUUN_CROSSBOW("Dorgeshuun Crossbow", new int[]{ItemID.DORGESHUUN_CROSSBOW}, true, (c) -> 0), - BULWARK("Dinh's Bulwark", new int[]{ItemID.DINHS_BULWARK}, false, c -> 0); + BULWARK("Dinh's Bulwark", new int[]{ItemID.DINHS_BULWARK}, false, SpecialCounterConfig::bulwarkThreshold); private final String name; private final int[] itemID; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingConfig.java index 9385d4d9da..3f02ca6359 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingConfig.java @@ -28,6 +28,7 @@ import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; import net.runelite.client.config.Units; +import net.runelite.client.plugins.woodcutting.config.ClueNestTier; @ConfigGroup("woodcutting") public interface WoodcuttingConfig extends Config @@ -57,6 +58,17 @@ public interface WoodcuttingConfig extends Config @ConfigItem( position = 3, + keyName = "clueNestNotifyTier", + name = "Clue nest notification", + description = "Configures the clue tier from which to start notifying of a clue nest spawn" + ) + default ClueNestTier clueNestNotifyTier() + { + return ClueNestTier.BEGINNER; + } + + @ConfigItem( + position = 4, keyName = "showWoodcuttingStats", name = "Show session stats", description = "Configures whether to display woodcutting session stats" @@ -67,7 +79,7 @@ public interface WoodcuttingConfig extends Config } @ConfigItem( - position = 4, + position = 5, keyName = "showRedwoods", name = "Show Redwood trees", description = "Configures whether to show a indicator for redwood trees" @@ -78,7 +90,7 @@ public interface WoodcuttingConfig extends Config } @ConfigItem( - position = 5, + position = 6, keyName = "showRespawnTimers", name = "Show respawn timers", description = "Configures whether to display the respawn timer overlay" diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java index c9ed030b3a..6fe527781e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java @@ -51,6 +51,7 @@ import net.runelite.api.events.GameObjectDespawned; import net.runelite.api.events.GameObjectSpawned; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; +import net.runelite.api.events.ItemSpawned; import net.runelite.client.Notifier; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; @@ -58,6 +59,7 @@ import net.runelite.client.events.OverlayMenuClicked; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDependency; import net.runelite.client.plugins.PluginDescriptor; +import net.runelite.client.plugins.woodcutting.config.ClueNestTier; import net.runelite.client.plugins.xptracker.XpTrackerPlugin; import net.runelite.client.ui.overlay.OverlayManager; import net.runelite.client.ui.overlay.OverlayMenuEntry; @@ -107,6 +109,7 @@ public class WoodcuttingPlugin extends Plugin private final List respawns = new ArrayList<>(); private boolean recentlyLoggedIn; private int currentPlane; + private ClueNestTier clueTierSpawned; @Provides WoodcuttingConfig getConfig(ConfigManager configManager) @@ -130,6 +133,7 @@ public class WoodcuttingPlugin extends Plugin treeObjects.clear(); session = null; axe = null; + clueTierSpawned = null; } @Subscribe @@ -148,6 +152,7 @@ public class WoodcuttingPlugin extends Plugin public void onGameTick(GameTick gameTick) { recentlyLoggedIn = false; + clueTierSpawned = null; currentPlane = client.getPlane(); respawns.removeIf(TreeRespawn::isExpired); @@ -190,11 +195,26 @@ public class WoodcuttingPlugin extends Plugin if (event.getMessage().contains("A bird's nest falls out of the tree") && config.showNestNotification()) { - notifier.notify("A bird nest has spawned!"); + if (clueTierSpawned == null || clueTierSpawned.ordinal() >= config.clueNestNotifyTier().ordinal()) + { + notifier.notify("A bird nest has spawned!"); + } + // Clear the clue tier that has previously spawned + clueTierSpawned = null; } } } + @Subscribe + public void onItemSpawned(ItemSpawned itemSpawned) + { + if (clueTierSpawned == null) + { + // This will be set only if one of the clue nests has spawned. It will then be reset the next game tick. + clueTierSpawned = ClueNestTier.getTierFromItem(itemSpawned.getItem().getId()); + } + } + @Subscribe public void onGameObjectSpawned(final GameObjectSpawned event) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/config/ClueNestTier.java b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/config/ClueNestTier.java new file mode 100644 index 0000000000..2e87136ede --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/config/ClueNestTier.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021, Tal + * 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.client.plugins.woodcutting.config; + +import com.google.common.collect.ImmutableMap; +import net.runelite.api.ItemID; + +public enum ClueNestTier +{ + BEGINNER, + EASY, + MEDIUM, + HARD, + ELITE, + DISABLED; + + + private static final ImmutableMap CLUE_NEST_ID_TO_TIER = new ImmutableMap.Builder() + .put(ItemID.CLUE_NEST_ELITE, ClueNestTier.ELITE) + .put(ItemID.CLUE_NEST_HARD, ClueNestTier.HARD) + .put(ItemID.CLUE_NEST_MEDIUM, ClueNestTier.MEDIUM) + .put(ItemID.CLUE_NEST_EASY, ClueNestTier.EASY) + .put(ItemID.CLUE_NEST_BEGINNER, ClueNestTier.BEGINNER) + .build(); + + static public ClueNestTier getTierFromItem(int itemId) + { + return CLUE_NEST_ID_TO_TIER.get(itemId); + } +} diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/woodcutting/WoodcuttingPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/woodcutting/WoodcuttingPluginTest.java new file mode 100644 index 0000000000..8cd4d20b59 --- /dev/null +++ b/runelite-client/src/test/java/net/runelite/client/plugins/woodcutting/WoodcuttingPluginTest.java @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2020, Jordan Zomerlei + * Copyright (c) 2019, 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.client.plugins.woodcutting; + +import com.google.inject.Guice; +import com.google.inject.testing.fieldbinder.Bind; +import com.google.inject.testing.fieldbinder.BoundFieldModule; +import javax.inject.Inject; +import net.runelite.api.ChatMessageType; +import net.runelite.api.Client; +import net.runelite.api.ItemID; +import net.runelite.api.Tile; +import net.runelite.api.TileItem; +import net.runelite.api.events.ChatMessage; +import net.runelite.api.events.ItemSpawned; +import net.runelite.client.Notifier; +import net.runelite.client.plugins.woodcutting.config.ClueNestTier; +import net.runelite.client.ui.overlay.OverlayManager; +import static org.junit.Assert.assertNotNull; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; +import org.mockito.junit.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class WoodcuttingPluginTest +{ + private static final String BIRDS_NEST_MESSAGE = "A bird's nest falls out of the tree."; + + @Inject + WoodcuttingPlugin woodcuttingPlugin; + + @Mock + @Bind + WoodcuttingConfig woodcuttingConfig; + + @Mock + @Bind + Notifier notifier; + + @Mock + @Bind + Client client; + + @Mock + @Bind + WoodcuttingOverlay woodcuttingOverlay; + + @Mock + @Bind + WoodcuttingTreesOverlay woodcuttingTreesOverlay; + + @Mock + @Bind + OverlayManager overlayManager; + + @Before + public void before() + { + Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); + } + + @Test + public void testLogs() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get some logs.", "", 0); + woodcuttingPlugin.onChatMessage(chatMessage); + assertNotNull(woodcuttingPlugin.getSession()); + } + + @Test + public void testOakLogs() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get some oak logs.", "", 0); + woodcuttingPlugin.onChatMessage(chatMessage); + assertNotNull(woodcuttingPlugin.getSession()); + } + + @Test + public void testArcticLogs() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get an arctic log.", "", 0); + woodcuttingPlugin.onChatMessage(chatMessage); + assertNotNull(woodcuttingPlugin.getSession()); + } + + @Test + public void testMushrooms() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get some mushrooms.", "", 0); + woodcuttingPlugin.onChatMessage(chatMessage); + assertNotNull(woodcuttingPlugin.getSession()); + } + + @Test + public void testBirdsNest() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BIRDS_NEST_MESSAGE, "", 0); + + when(woodcuttingConfig.showNestNotification()).thenReturn(true); + woodcuttingPlugin.onChatMessage(chatMessage); + verify(notifier).notify("A bird nest has spawned!"); + + when(woodcuttingConfig.showNestNotification()).thenReturn(false); + woodcuttingPlugin.onChatMessage(chatMessage); + verifyNoMoreInteractions(notifier); + } + + @Test + public void testClueNestConfigSameAsSpawn() + { + ChatMessage nestChatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BIRDS_NEST_MESSAGE, "", 0); + Tile tile = mock(Tile.class); + TileItem beginnerTileItem = mock(TileItem.class); + when(beginnerTileItem.getId()).thenReturn(ItemID.CLUE_NEST_BEGINNER); + ItemSpawned beginnerClueSpawned = new ItemSpawned(tile, beginnerTileItem); + + when(woodcuttingConfig.showNestNotification()).thenReturn(true); + when(woodcuttingConfig.clueNestNotifyTier()).thenReturn(ClueNestTier.BEGINNER); + woodcuttingPlugin.onItemSpawned(beginnerClueSpawned); + woodcuttingPlugin.onChatMessage(nestChatMessage); + woodcuttingPlugin.onGameTick(null); + verify(notifier).notify("A bird nest has spawned!"); + } + + @Test + public void testClueNestConfigSmallerThanSpawn() + { + ChatMessage nestChatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BIRDS_NEST_MESSAGE, "", 0); + Tile tile = mock(Tile.class); + TileItem eliteTileItem = mock(TileItem.class); + when(eliteTileItem.getId()).thenReturn(ItemID.CLUE_NEST_ELITE); + ItemSpawned eliteClueSpawned = new ItemSpawned(tile, eliteTileItem); + + when(woodcuttingConfig.showNestNotification()).thenReturn(true); + when(woodcuttingConfig.clueNestNotifyTier()).thenReturn(ClueNestTier.BEGINNER); + woodcuttingPlugin.onItemSpawned(eliteClueSpawned); + woodcuttingPlugin.onChatMessage(nestChatMessage); + woodcuttingPlugin.onGameTick(null); + verify(notifier).notify("A bird nest has spawned!"); + } + + @Test + public void testClueNestDisabledConfig() + { + ChatMessage nestChatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BIRDS_NEST_MESSAGE, "", 0); + Tile tile = mock(Tile.class); + TileItem eliteTileItem = mock(TileItem.class); + when(eliteTileItem.getId()).thenReturn(ItemID.CLUE_NEST_ELITE); + ItemSpawned eliteClueSpawned = new ItemSpawned(tile, eliteTileItem); + + when(woodcuttingConfig.showNestNotification()).thenReturn(true); + when(woodcuttingConfig.clueNestNotifyTier()).thenReturn(ClueNestTier.DISABLED); + woodcuttingPlugin.onItemSpawned(eliteClueSpawned); + woodcuttingPlugin.onChatMessage(nestChatMessage); + woodcuttingPlugin.onGameTick(null); + verifyNoInteractions(notifier); + } + + @Test + public void testClueNestConfigLargerThanSpawn() + { + ChatMessage nestChatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BIRDS_NEST_MESSAGE, "", 0); + Tile tile = mock(Tile.class); + TileItem beginnerTileItem = mock(TileItem.class); + when(beginnerTileItem.getId()).thenReturn(ItemID.CLUE_NEST_BEGINNER); + ItemSpawned beginnerClueSpawned = new ItemSpawned(tile, beginnerTileItem); + + when(woodcuttingConfig.showNestNotification()).thenReturn(true); + when(woodcuttingConfig.clueNestNotifyTier()).thenReturn(ClueNestTier.HARD); + woodcuttingPlugin.onItemSpawned(beginnerClueSpawned); + woodcuttingPlugin.onChatMessage(nestChatMessage); + woodcuttingPlugin.onGameTick(null); + verifyNoInteractions(notifier); + } + + @Test + public void testClueNestPlayerDrop() + { + ChatMessage nestChatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BIRDS_NEST_MESSAGE, "", 0); + Tile tile = mock(Tile.class); + TileItem beginnerTileItem = mock(TileItem.class); + when(beginnerTileItem.getId()).thenReturn(ItemID.CLUE_NEST_BEGINNER); + ItemSpawned beginnerClueSpawned = new ItemSpawned(tile, beginnerTileItem); + TileItem nestTileItem = mock(TileItem.class); + when(nestTileItem.getId()).thenReturn(ItemID.BIRD_NEST_22798); + ItemSpawned regularNestSpawned = new ItemSpawned(tile, nestTileItem); + + when(woodcuttingConfig.showNestNotification()).thenReturn(true); + + // Player drops clue nest + woodcuttingPlugin.onItemSpawned(beginnerClueSpawned); + woodcuttingPlugin.onGameTick(null); + verifyNoInteractions(notifier); + // A regular nest has spawned + woodcuttingPlugin.onItemSpawned(regularNestSpawned); + woodcuttingPlugin.onChatMessage(nestChatMessage); + woodcuttingPlugin.onGameTick(null); + verify(notifier).notify("A bird nest has spawned!"); + } + + @Test + public void testClueNestOtherItemSpawn() + { + ChatMessage nestChatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BIRDS_NEST_MESSAGE, "", 0); + Tile tile = mock(Tile.class); + TileItem beginnerTileItem = mock(TileItem.class); + when(beginnerTileItem.getId()).thenReturn(ItemID.CLUE_NEST_BEGINNER); + ItemSpawned beginnerClueSpawned = new ItemSpawned(tile, beginnerTileItem); + TileItem anotherItemTileItem = mock(TileItem.class); + ItemSpawned anotherItemSpawned = new ItemSpawned(tile, anotherItemTileItem); + + when(woodcuttingConfig.showNestNotification()).thenReturn(true); + when(woodcuttingConfig.clueNestNotifyTier()).thenReturn(ClueNestTier.BEGINNER); + + woodcuttingPlugin.onItemSpawned(beginnerClueSpawned); + woodcuttingPlugin.onItemSpawned(anotherItemSpawned); + + woodcuttingPlugin.onChatMessage(nestChatMessage); + woodcuttingPlugin.onGameTick(null); + verify(notifier).notify("A bird nest has spawned!"); + } +} \ No newline at end of file diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/ScriptVMMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/ScriptVMMixin.java index cf548e1f45..a2d58406c3 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/ScriptVMMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/ScriptVMMixin.java @@ -27,7 +27,6 @@ package net.runelite.mixins; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static net.runelite.api.Opcodes.*; import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.api.events.ScriptPostFired; import net.runelite.api.events.ScriptPreFired; @@ -37,6 +36,9 @@ import net.runelite.api.mixins.Mixin; import net.runelite.api.mixins.Replace; import net.runelite.api.mixins.Shadow; import net.runelite.api.widgets.JavaScriptCallback; +import static net.runelite.cache.script.Opcodes.INVOKE; +import static net.runelite.cache.script.Opcodes.RETURN; +import static net.runelite.cache.script.RuneLiteOpcodes.RUNELITE_EXECUTE; import net.runelite.rs.api.RSClient; import net.runelite.rs.api.RSScript; import net.runelite.rs.api.RSScriptEvent; diff --git a/runelite-script-assembler-plugin/src/main/java/net/runelite/script/AssembleMojo.java b/runelite-script-assembler-plugin/src/main/java/net/runelite/script/AssembleMojo.java index 72791ccfef..3a05d7e3d9 100644 --- a/runelite-script-assembler-plugin/src/main/java/net/runelite/script/AssembleMojo.java +++ b/runelite-script-assembler-plugin/src/main/java/net/runelite/script/AssembleMojo.java @@ -33,6 +33,7 @@ import java.io.IOException; import net.runelite.cache.IndexType; import net.runelite.cache.definitions.ScriptDefinition; import net.runelite.cache.definitions.savers.ScriptSaver; +import net.runelite.cache.script.RuneLiteInstructions; import net.runelite.cache.script.assembler.Assembler; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException;