Sadboys 31 Posted August 28, 2018 Report Share Posted August 28, 2018 Hey all, This is a really simple tutorial for adding shift drop into your stock Project Insanity (PI) client. It's a cool feature, loved by all RuneScape players. In your Client.java (inside src, under models.players) Add the following code public static boolean shiftPressed = false; What are we doing here? (For newcomers) Here, we are creating a boolean that we can refer back to later to check if the shift key is currently pressed. This variable will be changed by key event listeners as seen later on in this tutorial. Then use CTRL+F or your IDE search tool to find the following condition: if (j == 1 && menuActionRow > 0) { And you should see something like this (although it may vary if you are not using a fresh/stock PI): if(j == 1 && menuActionRow > 0) { int i1 = menuActionID[menuActionRow - 1]; if(i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53 || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493 || i1 == 847 || i1 == 447 || i1 == 1125) { int l1 = menuActionCmd2[menuActionRow - 1]; int j2 = menuActionCmd3[menuActionRow - 1]; RSInterface class9 = RSInterface.interfaceCache[j2]; Underneath RSInterface class9 = RSInterface.interfaceCache[j2]; add: if (shiftPressed){ boolean hasDrop = false; int dropId = 0; for (int i = 0; i < menuActionName.length; i++){ if (menuActionName[i] == null) { continue; } // To check for destroyable items too if (menuActionName[i].contains("Drop") || menuActionName[i].contains("Destroy") || menuActionName[i].contains("Release")) { hasDrop = true; dropId = i; } } if (hasDrop) { doAction(dropId); return; } } What are we doing here? (For newcomers) Here, we are using the boolean shiftPressed to: firstly, check if the shift key has been pressed (which is set by the below event listeners) and we are then executing code based on the answer. If the shift key is pressed, then we are checking that the item has a drop, destroy or release option and dropping it. Now close your client.java, as we are done with this class and are moving onto another. Open RSApplet.java and search for: public final void keyPressed(KeyEvent keyevent) { And you should see: public final void keyPressed(KeyEvent keyevent) { idleTime = 0; int i = keyevent.getKeyCode(); int j = keyevent.getKeyChar(); Under this, add: if(keyevent.isShiftDown()){ client.shiftPressed = true; } Please note, if your client.java file has a capital c (Client.java), you will need to change this to Client.shiftPressed = true; What are we doing here? (For newcomers) Here we are inside the keyPressed method which deals with keys that are pressed, we are identifying the character that has been pressed and in this case, int i represents the key code of the character. So we are comparing it to KeyEvent.VK_SHIFT (the shift key), and if their codes match and we are telling the client that the shift key has been pressed and storing the answer into a boolean that we can refer back to and check on. Now search for: public final void keyReleased(KeyEvent keyevent) { You should see: public final void keyReleased(KeyEvent keyevent) { idleTime = 0; int i = keyevent.getKeyCode(); char c = keyevent.getKeyChar(); Under the last line of the above, add: if (i == KeyEvent.VK_SHIFT) { client.shiftPressed = false; } Again, please note, if your client.java file has a capital c (Client.java), you will need to change this to Client.shiftPressed = true;What are we doing here? (For newcomers) Here we are inside the keyReleased method which deals with keys that are released (unpressed), we are identifying the character that has been released and in this case, int i represents the key code of the character. So we are comparing it to KeyEvent.VK_SHIFT (the shift key), and if their codes match and we are telling the client that the shift key is no longer pressed and storing the answer into a boolean that we can refer back to and check on. _______________________________________ Now save and build your source and you will be good to go. Any questions, feel free to ask! 2 Link to comment Share on other sites More sharing options...
jemort1234 0 Posted March 13, 2019 Report Share Posted March 13, 2019 Thanks! Link to comment Share on other sites More sharing options...
Ai0vnju 0 Posted June 29, 2019 Report Share Posted June 29, 2019 Thanks man Link to comment Share on other sites More sharing options...
darkk98 1 Posted August 27, 2019 Report Share Posted August 27, 2019 This should be helpful! Link to comment Share on other sites More sharing options...
medicinalmac 1 Posted October 15, 2019 Report Share Posted October 15, 2019 thanks been looking for this Link to comment Share on other sites More sharing options...
Mr Extremez 1 Posted November 9, 2019 Report Share Posted November 9, 2019 Looks good Link to comment Share on other sites More sharing options...
sad 1 Posted March 14, 2020 Report Share Posted March 14, 2020 Nice man love your work ! 10 / 10 Link to comment Share on other sites More sharing options...
bigbrainrando 0 Posted March 25, 2020 Report Share Posted March 25, 2020 thanks m8! sure many will find this useful as did i Link to comment Share on other sites More sharing options...
UndeadAlien 0 Posted March 25, 2020 Report Share Posted March 25, 2020 thanks man, hope to see more Link to comment Share on other sites More sharing options...
Yotatchi 0 Posted March 28, 2020 Report Share Posted March 28, 2020 Thanks for the guide! Very easy to follow. Link to comment Share on other sites More sharing options...
needaccountlike 0 Posted March 29, 2020 Report Share Posted March 29, 2020 Thanks for adding this brother it was surely needed Thanks for adding this brother it was surely needed Link to comment Share on other sites More sharing options...
ArmBandito 1 Posted March 29, 2020 Report Share Posted March 29, 2020 Right on man, i appreciate it Link to comment Share on other sites More sharing options...
aidang95 0 Posted March 30, 2020 Report Share Posted March 30, 2020 thanks for this this is really useful! Link to comment Share on other sites More sharing options...
crazzmc 0 Posted April 1, 2020 Report Share Posted April 1, 2020 this is awesome, definitely gonna try this on a vencillio! this is awesome, definitely gonna try this on a vencillio! Link to comment Share on other sites More sharing options...
No5Rex 6 Posted April 2, 2020 Report Share Posted April 2, 2020 Thank you mate I plan to play around with this, have some ideas in mind. Let's see if it works Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now