Eliot Posted December 2, 2018 Posted December 2, 2018 In this video, I write the beginnings of an "AIO" Fighter script which can be extended in future videos. Feel free to use the source code for any purpose. Source code: import org.osbot.rs07.api.model.Item; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import java.util.Arrays; @ScriptManifest(name = "10MinFighter", version = 1.0, info = "", author = "", logo = "") public class Driver extends Script { String npcName; @Override public int onLoop() throws InterruptedException { // 1. decide which type of npcs to attack if (npcName == null) { if (myPlayer().getInteracting() != null) { npcName = myPlayer().getInteracting().getName(); } else { return 500; } } // 2. attack them if (!myPlayer().isAnimating() && myPlayer().getInteracting() == null) { NPC next = getNpcs().closest(npc -> npc.getName().equals(npcName) && npc.isAttackable() && !npc.isUnderAttack() && npc.getInteracting() == null); if (next != null) { next.interact("Attack"); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return myPlayer().getInteracting() != null; } }.sleep(); } } // 3. eat food so we don't die if (myPlayer().getHealthPercent() < 50) { Item food = getInventory().getItem(item -> Arrays.asList(item.getActions()).contains("Eat")); if (food != null) { food.interact("Eat"); sleep(2500); } } // 4. (optional) loot and bank return 500; } } Previous tutorial: 13 1 1
Tom Posted December 2, 2018 Posted December 2, 2018 Thanks I was able to make a fighter because of this 1
Eliot Posted December 2, 2018 Author Posted December 2, 2018 2 hours ago, NakedPotato said: Brb testing at corp Should work easy!
Mysteryy Posted December 3, 2018 Posted December 3, 2018 brb releasing mysteryyaiofighter Please make a paint 4 me too. 1
Ericthecmh Posted December 3, 2018 Posted December 3, 2018 I love your voice @Eliot will listen to this instead of music 1
Eliot Posted December 3, 2018 Author Posted December 3, 2018 17 minutes ago, Ericthecmh said: I love your voice @Eliot will listen to this instead of music Thanks bb, now join the Discord.
Marwan44 Posted December 3, 2018 Posted December 3, 2018 Really nice that your explaining it with voice aswell. thanks was entertaining to watch 1
Czar Posted December 3, 2018 Posted December 3, 2018 (edited) Time to write a fighter script Edited December 3, 2018 by Czar 1
Tom Posted December 3, 2018 Posted December 3, 2018 1 hour ago, Czar said: Time to write a fighter script bout time you learned eh 1
Mysteryy Posted December 3, 2018 Posted December 3, 2018 7 hours ago, Ericthecmh said: I love your voice @Eliot will listen to this instead of music I want him to make me a audiobook. 1
Developer Patrick Posted December 3, 2018 Developer Posted December 3, 2018 22 minutes ago, Mysteryy said: I want him to make me a audiobook. +1 1
Tempest Posted December 3, 2018 Posted December 3, 2018 (edited) You actually sound really good! Would appreciate removing the BGM though. Edited December 3, 2018 by Tempest 1