Heroic Posted January 20, 2018 Share Posted January 20, 2018 Hey guys, Just made my first script, it powerfishes at lumbridge and has basic anti ban. Screeny: https://gyazo.com/c658a0b78a38fe527b782978483ec220 ShrimpFisher.jar 3 Quote Link to comment Share on other sites More sharing options...
Alek Posted January 20, 2018 Share Posted January 20, 2018 Good first script, however NPC ids change every Thursday. Good job on keeping it clean, not a fan of calling that antiban though. Quote Link to comment Share on other sites More sharing options...
Heroic Posted January 20, 2018 Author Share Posted January 20, 2018 6 minutes ago, Alek said: Good first script, however NPC ids change every Thursday. Good job on keeping it clean, not a fan of calling that antiban though. Thanks for the input :p, I had no idea that the Id's changed I suppose I should be finding the npc's by name then. I'm gonna look for some better ways to prevent bans then. Quote Link to comment Share on other sites More sharing options...
Alek Posted January 20, 2018 Share Posted January 20, 2018 27 minutes ago, Heroic said: Thanks for the input :p, I had no idea that the Id's changed I suppose I should be finding the npc's by name then. I'm gonna look for some better ways to prevent bans then. You won't be able to prevent bans, there is literally nothing you can do. Just focus on improving your scripts and finding a way to handle searching for the NPCs without directly using the ids. Let us know once you found your solution 1 Quote Link to comment Share on other sites More sharing options...
Jammer Posted January 20, 2018 Share Posted January 20, 2018 (edited) Great first script in addition to what alek said about the anti-ban there are a couple of things you need to change. I took the libery to decompile your jar. if (myPlayer().getAnimation() == 621) return random(600, 60000); You have if statements like this in many places of your code. This doesn't actually do anything except for returning a random integer. if (fishingSpot == null) return random(600, 60000); fishingSpot.interact(new String[] { "Net" }); Same thing here, returns a random Integer with no use. Also, you need to include the interaction inside the if statement. Otherwise you'll get a nullpointer exception if the fishingspot is null. if (random(0, 5) != 2) { mouse.moveOutsideScreen(); } This would make it move the mouse outside the screen all the time if it weren't for this: return random(600, 60000); } The return value should be a couple hundred ms. This will cause the script to sometimes sleep for 60sec and on average about 30. Going back to the previous code, if you have a normal return value like 200 the random int will be 2 every other second thus moving the mouse outside of screen back and forth constantly. Edited January 20, 2018 by Jammer 1 Quote Link to comment Share on other sites More sharing options...
Heroic Posted January 20, 2018 Author Share Posted January 20, 2018 1 hour ago, Jammer said: Great first script in addition to what alek said about the anti-ban there are a couple of things you need to change. I took the libery to decompile your jar. if (myPlayer().getAnimation() == 621) return random(600, 60000); You have if statements like this in many places of your code. This doesn't actually do anything except for returning a random integer. if (fishingSpot == null) return random(600, 60000); fishingSpot.interact(new String[] { "Net" }); Same thing here, returns a random Integer with no use. Also, you need to include the interaction inside the if statement. Otherwise you'll get a nullpointer exception if the fishingspot is null. if (random(0, 5) != 2) { mouse.moveOutsideScreen(); } This would make it move the mouse outside the screen all the time if it weren't for this: return random(600, 60000); } The return value should be a couple hundred ms. This will cause the script to sometimes sleep for 60sec and on average about 30. Going back to the previous code, if you have a normal return value like 200 the random int will be 2 every other second thus moving the mouse outside of screen back and forth constantly. Yea I didn't really think about a lot of these returns, the purpose of the long waiting times though was to simulate the "player" being AFK. Ill be updating the script over the next couple of days. Quote Link to comment Share on other sites More sharing options...
z10n Posted January 20, 2018 Share Posted January 20, 2018 Good job on your release bro! Happy scripting and =-D!! Quote Link to comment Share on other sites More sharing options...
H0rn Posted January 21, 2018 Share Posted January 21, 2018 Grats on your first script mate, you can only get better ;) Quote Link to comment Share on other sites More sharing options...
Heroic Posted January 21, 2018 Author Share Posted January 21, 2018 Thanks for the support guys I'm currently working on a banking feature. Quote Link to comment Share on other sites More sharing options...