0xSKID Posted June 19, 2019 Share Posted June 19, 2019 Wanted to introduce myself, you can call me skid. I think I found my new hobby! I am sitting here enjoying some nice scotch watching my script kill cows. This weekend I finally gave in to all these ads about being able to play runescape on mobile. Having played runescape extensively in middle school I couldn't help but give in to the nostalgia and played through tutorial island on my phone. After a while I said hell I will just play a bit and started playing on my computer. Then I thought, well hell why not play multiple accounts at a time to keep my mind stimulated. Fast forward and I am playing four accounts at once while listening to podcast. I thought again, why not automate this so I started googling and came across this community. A little reading of OSBot's API and lurking this forum for code examples and I was on my way! Full disclosure, I have been a self-taught software engineer for the last three years or so and just started picking up Java as part of a new job so it didn't take a lot to come up with something that worked. What's the best way to get involved around here? I love the OSBot and just bought VIP so I can start running multiple bots at a time. I'd love to read some of people's more advanced scripts that they don't mind having open-sourced. Here's my first script! It went through a few revisions. I am still trying to understand how to best organize code around OSBot's API. public class CowKiller { private MethodProvider B; private String[] advesaryStrings = { "Cow", "Cow calf" }; public CowKiller(MethodProvider B) { this.B = B; } public void execute() throws InterruptedException { while(lifeSafe()) { if (B.getSettings().getRunEnergy() > 20) { run(); } NPC advesary = getAdvesary(); attack(advesary); } run(); B.getWalking().walk(Banks.LUMBRIDGE_LOWER); } private void attack(NPC advesary) throws InterruptedException { B.log("Attacking advesary!!!!!!!!!!!!!!"); while(attackCondition(advesary) && lifeSafe()) { B.log("attacking the cow"); advesary.interact("Attack"); B.sleep(B.random(1000, 5000)); } } private NPC getAdvesary() { return B.getNpcs().closest(npc -> attackable(npc)); } private boolean attackable(NPC advesary) { return wantedAdvesary(advesary) && advesary.getInteracting() == null && !advesary.isUnderAttack() && !advesary.isHitBarVisible() && B.getMap().canReach(advesary); } private boolean lifeSafe() { return B.skills.getDynamic(Skill.HITPOINTS) > 10; } private boolean attackCondition(NPC advesary) { return advesary.exists() && advesary.isAttackable(); } private void run() { B.getSettings().setRunning(true); } private boolean wantedAdvesary(NPC advesary) { for (String advesaryString : advesaryStrings) { if (advesary.getName().equals(advesaryString)) { return true; } } return false; } } I think that's enough for an introduction, cheers! Quote Link to comment Share on other sites More sharing options...
doubt Posted June 19, 2019 Share Posted June 19, 2019 Welcome! Good job on the script! Quote Link to comment Share on other sites More sharing options...
Hybris Posted June 19, 2019 Share Posted June 19, 2019 Hey mate welcome! I quickly went through the script & can tell you went through the API but the base of your script is not right. Read this, it should help a lot with what you're trying to achieve! Hybris Quote Link to comment Share on other sites More sharing options...
Proton Posted June 19, 2019 Share Posted June 19, 2019 Welcome! Quote Link to comment Share on other sites More sharing options...
uzlz Posted June 19, 2019 Share Posted June 19, 2019 welcome bro, looking forward to seeing good scripts Quote Link to comment Share on other sites More sharing options...
FuryShark Posted June 19, 2019 Share Posted June 19, 2019 Welcome to OSBot kitty Quote Link to comment Share on other sites More sharing options...
Rick Posted June 19, 2019 Share Posted June 19, 2019 cool intro Enjoy man and welcome! Quote Link to comment Share on other sites More sharing options...
113m Posted August 25, 2019 Share Posted August 25, 2019 Nice intro welcome! Quote Link to comment Share on other sites More sharing options...