scriptersteve Posted January 14, 2018 Share Posted January 14, 2018 (edited) Making an Al-Kharid warriors script at the moment -> currently supports banking, potting, killing al kharid warriors. Aimed at f2p only (detects normal str pots) Just select your food type from the gui and hit play. Has basic paint Currently supports magic (must be autocast spell selected), ranged and melee. If using melee it pots, if using ranged it loots arrows (stacks > 5 in size) If training attack it will upgrade your scimitar if it is present in inventory i.e if your attack is 4 then levels to 5 if u have steel scim in inv it will equip it for better exp rates If training range will upgrade your bow if it is present in inventory hops worlds if too many players (2 > lvl 30 in your area -> hop) Script automatically stops if:- you run out of arrows, you run out of runes, you have no food in bank, you die (untested as never died) Bans: not been banned so far in all testing of script which is a fair amount. First Version download here: https://www.dropbox.com/s/rip93cyyb356g5k/Goblins.jar?dl=0 Ignore fact it's called goblins, was going to make a goblin banking script at the goblins near edge but changed my mind XD. 2nd version here: https://www.dropbox.com/s/vtr4cs0jirviam4/Goblins.jar?dl=0 3rd version here: https://www.dropbox.com/s/qc7y16mjn2zakks/Goblins.jar?dl=0 4th version here: https://www.dropbox.com/s/bwcl5fs3tll9702/Goblins.jar?dl=0 5th and probably final version here unless anything breaks: https://www.dropbox.com/s/bwcl5fs3tll9702/Goblins.jar?dl=0 Edited February 4, 2018 by scriptersteve 1 Quote Link to comment Share on other sites More sharing options...
T H C Posted January 14, 2018 Share Posted January 14, 2018 Nice release man! Quote Link to comment Share on other sites More sharing options...
Team Cape Posted January 14, 2018 Share Posted January 14, 2018 (edited) The code isn't malicious and the script looks like it would work - good job A few recommendations: 1. I'd recommend using a State structure for this type of script; it makes the code a lot cleaner. 2. You're effectively making the same check multiple times to progressively switch weapons in every onLoop(). I'd try to (at least) use else ifs for this. 3. The script assumes that the player will have infinite food - maybe add a condition to log out? There's more than that, but those are good things to start on Edited January 14, 2018 by Team Cape Quote Link to comment Share on other sites More sharing options...
Fearsy Posted January 14, 2018 Share Posted January 14, 2018 Nice release, good luck completing it Quote Link to comment Share on other sites More sharing options...
scriptersteve Posted January 14, 2018 Author Share Posted January 14, 2018 Thanks will keep those in mind and add extra bits to do that- will keep updating link as i go: quick question do you know the code for turning run on when run % greater than set amount and when you say logout, do you just mean script.stop()? 41 minutes ago, Team Cape said: The code isn't malicious and the script looks like it would work - good job A few recommendations: 1. I'd recommend using a State structure for this type of script; it makes the code a lot cleaner. 2. You're effectively making the same check multiple times to progressively switch weapons in every onLoop(). I'd try to (at least) use else ifs for this. 3. The script assumes that the player will have infinite food - maybe add a condition to log out? There's more than that, but those are good things to start on 43 minutes ago, Team Cape said: The code isn't malicious and the script looks like it would work - good job A few recommendations: 1. I'd recommend using a State structure for this type of script; it makes the code a lot cleaner. 2. You're effectively making the same check multiple times to progressively switch weapons in every onLoop(). I'd try to (at least) use else ifs for this. 3. The script assumes that the player will have infinite food - maybe add a condition to log out? There's more than that, but those are good things to start on Also when you say state structure, you mean like a banking state, killing state or what exactly? 1 Quote Link to comment Share on other sites More sharing options...
emigdiodia Posted January 14, 2018 Share Posted January 14, 2018 realy good Quote Link to comment Share on other sites More sharing options...
Team Cape Posted January 14, 2018 Share Posted January 14, 2018 15 minutes ago, scriptersteve said: Thanks will keep those in mind and add extra bits to do that- will keep updating link as i go: quick question do you know the code for turning run on when run % greater than set amount and when you say logout, do you just mean script.stop()? Also when you say state structure, you mean like a banking state, killing state or what exactly? stop() would work - states are really just a framework of if statements that help you structure the script, like this: private enum State { COMBAT, WALK_TO_FIGHT_AREA, WALK_TO_BANK, OPEN_BANK, BANK, LOG_OUT }; private State getState() { if(getInventory().contains("Salmon")) { if(!fightArea.contains(myPlayer()) return State.WALK_TO_FIGHT_AREA; if(getCombat().isFighting()) return State.COMBAT; return State.ATTACK_GUARD; } if(!bankArea.contains(myPlayer())) return State.WALK_TO_BANK; if(!getBank().isOpen()) return State.OPEN_BANK; if(getBank().contains("Salmon")) return State.BANK; return State.LOG_OUT; } public int onLoop() { switch(getState()) { case COMBAT: //combat with guard break; case ATTACK_GUARD: //attack guard break; case BANK: break; case WALK_TO_BANK: getWalking().webWalk(bankArea); break; //other states that you have go here, implement code into each one } } this is a simple example of how you might use a state system with this script - it helps to clean up the script, so it's a lot easier to debug would also recommend looking at a few tutorials on starting scripting, like APAs tea stealing script. Quote Link to comment Share on other sites More sharing options...
scriptersteve Posted January 14, 2018 Author Share Posted January 14, 2018 Alright will look into that more - thanks 1 Quote Link to comment Share on other sites More sharing options...
Explv Posted January 14, 2018 Share Posted January 14, 2018 (edited) 1 hour ago, Team Cape said: stop() would work - states are really just a framework of if statements that help you structure the script, like this: private enum State { COMBAT, WALK_TO_FIGHT_AREA, WALK_TO_BANK, OPEN_BANK, BANK, LOG_OUT }; private State getState() { if(getInventory().contains("Salmon")) { if(!fightArea.contains(myPlayer()) return State.WALK_TO_FIGHT_AREA; if(getCombat().isFighting()) return State.COMBAT; return State.ATTACK_GUARD; } if(!bankArea.contains(myPlayer())) return State.WALK_TO_BANK; if(!getBank().isOpen()) return State.OPEN_BANK; if(getBank().contains("Salmon")) return State.BANK; return State.LOG_OUT; } public int onLoop() { switch(getState()) { case COMBAT: //combat with guard break; case ATTACK_GUARD: //attack guard break; case BANK: break; case WALK_TO_BANK: getWalking().webWalk(bankArea); break; //other states that you have go here, implement code into each one } } this is a simple example of how you might use a state system with this script - it helps to clean up the script, so it's a lot easier to debug would also recommend looking at a few tutorials on starting scripting, like APAs tea stealing script. o_god_pls_no.jpg all that code can be simplified to: public int onLoop() { if(getInventory().contains("Salmon")) { if(!fightArea.contains(myPlayer())) { // walk to fight area } else if(getCombat().isFighting()) { // do nada } else { // attack guard } } else if(!bankArea.contains(myPlayer())) { // walk to bank } else if(!getBank().isOpen()) { // open bank } else if(getBank().contains("Salmon")) { //bank } else { //logout } } States add nothing, REEEEEEEEEEEEEEE Edited January 14, 2018 by Explv 1 Quote Link to comment Share on other sites More sharing options...
scriptersteve Posted January 14, 2018 Author Share Posted January 14, 2018 Sample proggy on the account i made earlier for testing this script: https://gyazo.com/5a25fa489ad9b5f57337a58287c9e29b Quote Link to comment Share on other sites More sharing options...
Butters Posted January 14, 2018 Share Posted January 14, 2018 2 hours ago, Explv said: States add nothing, REEEEEEEEEEEEEEE In this case true But might help when the conditions are more complex. Of course can just write separate condition checking methods like private boolean needsBank() { //... } Btw good luck with the script and happy coding Quote Link to comment Share on other sites More sharing options...
scriptersteve Posted January 14, 2018 Author Share Posted January 14, 2018 Now implemented a GUI, Range support, logging out when out of food: To do: Death logout should that happen(could happen on a lvl 3 if you were botting them here) world hopping cabbage looting Quote Link to comment Share on other sites More sharing options...
scriptersteve Posted January 14, 2018 Author Share Posted January 14, 2018 Have a university assignment due so still need to add above, thanks for all feedback btw, not going to 'fix' this script in terms of layout as i'm just doing it to learn but will be using the recommended approaches in future scripts. Appreciate it all Quote Link to comment Share on other sites More sharing options...
Team Cape Posted January 15, 2018 Share Posted January 15, 2018 6 hours ago, Explv said: o_god_pls_no.jpg all that code can be simplified to: public int onLoop() { if(getInventory().contains("Salmon")) { if(!fightArea.contains(myPlayer())) { // walk to fight area } else if(getCombat().isFighting()) { // do nada } else { // attack guard } } else if(!bankArea.contains(myPlayer())) { // walk to bank } else if(!getBank().isOpen()) { // open bank } else if(getBank().contains("Salmon")) { //bank } else { //logout } } States add nothing, REEEEEEEEEEEEEEE muddies up the onLoop(). state system also increases readability and is perfect for a small script like this one. doesn't matter if you personally don't like it; it's a very good place to start because it forces you into good, structured habits. 1 Quote Link to comment Share on other sites More sharing options...
Explv Posted January 15, 2018 Share Posted January 15, 2018 8 hours ago, Team Cape said: muddies up the onLoop(). state system also increases readability and is perfect for a small script like this one. doesn't matter if you personally don't like it; it's a very good place to start because it forces you into good, structured habits. No 1 Quote Link to comment Share on other sites More sharing options...