Jump to content

exuals

Trade With Caution
  • Posts

    119
  • Joined

  • Last visited

  • Feedback

    100%

About exuals

Profile Information

  • Gender
    Male

Recent Profile Visitors

756 profile views

exuals's Achievements

Steel Poster

Steel Poster (4/10)

9

Reputation

  1. Thanks, my IDE does it automatically when I refactor const's though.
  2. It's intentional, otherwise it'd attack a monster and immediately attempt to attack another when you're in combat. It's an example to demonstrate how to do the right click next monster for max efficiency shit.
  3. Since there is a tutorial for the legacy I figured I'd throw up what I've been using to develop OSB2 scripts. So, before I copy and paste code, an event is similar to a 'node' with the addition of useful features such as; EventMode EventStatus EventMode determines when to run the code in the event. With concurrency changes in OSB2 you can run events in 'ASYNC' mode, AKA another thread that runs this event in sync with another already running event. For example say you have an autofighter, you can start a new event in async mode that checks prayer points and when low; drinks a dose of prayer restore. You can also set an event to run in BLOCKING mode, simply stating that when the current event is finished, run this one next. EventStatus determines what the event is currently doing, this is useful for managing multiple events. EventStatus can be: Queued Working Finished Failed Back to the autofighter example, some of the events could be: AttackMonster, this can be run in BLOCKING mode as we don't want to fight multiple monsters. When this event is executed, if there is another event currently running, it will be queued. When this event is Working it will be in combat with a monster, when the event is Finished, the monster should be dead and Failed would be if the monster is unable to be killed or killed us. This is incredibly useful as there is functionality to run code while event is queued, hence, if you queued an AttackMonster event it could right click the monster and wait for the current to be killed. EatFood, this would be run in ASYNC mode as we want to eat when we are low and not wait for the current event to finish. EatFood can be queued to indicate that you want to eat 3 or 4 pieces of food in a row. When the event is finished, determine that our health increased to complete the event. Now, our core script class: import java.awt.Graphics2D; import java.util.ArrayList; import org.osbot.script.Script; import org.osbot.script.event.Event; import Events.EventTest; public class TestScript extends Script { private ArrayList<Event> allEvents = new ArrayList<Event>(); @Override public int onLoop() throws InterruptedException { for (Event e : allEvents) { execute(e); } return 1000; } @Override public void onStart() throws InterruptedException { allEvents.add(new EventTest()); super.onStart(); } } Looks similar to the node framework right? Simple enough to read, we have an ArrayList of all of our events , onStart we add what events we want to use. During the onLoop for this example we simply execute all of the events in the arraylist. Note: If you have events that run in async make sure to place them before non async events when adding to the arraylist. And here is an example event: package Events; import org.osbot.legacy.script.MethodProvider; import org.osbot.rs07.api.model.NPC; import org.osbot.script.event.Event; public class FishSharks extends Event { private static final String FISHING = "Fishing"; private static final String HARPOON = "Harpoon"; private static final int _618 = 618; private static final int _2906 = 2906; @Override public int execute() throws InterruptedException { if (inventory.isFull()) setFinished(); if (!(myPlayer().getAnimation() == _618)) startFishing(); return 0; } private void startFishing() throws InterruptedException { NPC fishingspot = npcs.closest(_2906); if (fishingspot.exists()) { camera.toEntity(fishingspot); fishingspot.interact(HARPOON); sleep(MethodProvider.gRandom(1000, 200)); } } @Override public String toString() { return FISHING; } } This event simply catches sharks if it is not animating. Since the event hasn't stated a EventMode it is automatically set to BLOCKING. Here is an example of a ASYNC event; package Events; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.api.ui.Spell; import org.osbot.script.MethodProvider; import org.osbot.script.event.Event; public class AntiBan extends Event { private static final String ANTIBAN = "Antiban"; public AntiBan() { setAsync(); } @Override public int execute() throws InterruptedException { antiBan(); return 0; } private void antiBan() throws IllegalArgumentException, InterruptedException { int rand = MethodProvider.random(0, 4); switch (rand) { case 0: antiBan.hoverSkill(Skill.FISHING); break; case 1: antiBan.hoverSpell(Spell.HOME_TELEPORT); break; case 2: antiBan.moveMouseOutsideScreen(); break; case 3: camera.movePitch(99); break; } sleep(MethodProvider.gRandom(6000, 6000)); } @Override public String toString() { return ANTIBAN; } } Because this Event is run in ASYNC (Notice we set this in the constructor) the antiban will run concurrently with the other two events. And finally, the core of this example fishing script: import java.awt.Color; import java.awt.Graphics2D; import java.util.ArrayList; import java.util.Collections; import org.osbot.script.Script; import org.osbot.script.ScriptManifest; import org.osbot.script.event.Event; import Events.AntiBan; import Events.BankSharks; import Events.FishSharks; @ScriptManifest(author = "exuals", info = "I don't even", logo = "what", name = "exFishy", version = 0) public class exSharksAPI2 extends Script { private ArrayList<Event> allEvents = new ArrayList<Event>(); @Override public int onLoop() throws InterruptedException { for (Event e : allEvents) { execute(e); } return 1000; } @Override public void onPaint(Graphics2D arg0) { super.onPaint(arg0); int x, y, width, height; x = 20; y = 50; width = 100; height = 25; for (Event e : allEvents) { if (e.isWorking()) { arg0.setColor(Color.green); arg0.fillRect(x, y, width, height); } else if (e.isQueued()) { arg0.setColor(Color.yellow); arg0.fillRect(x, y, width, height); } else if (e.hasFailed()) { arg0.setColor(Color.red); arg0.fillRect(x, y, width, height); } arg0.setColor(Color.white); arg0.drawRect(x, y, width, height); arg0.setColor(Color.black); arg0.drawString(e.toString(), x + 15, y + 17); y += 30; } } @Override public void onStart() throws InterruptedException { Collections.addAll(allEvents, new AntiBan(), new FishSharks(), new BankSharks()); super.onStart(); } }
  4. I wrote a NMZ bot in 4 hours, shouldn't be a problem, logic is easy. Just gotta type haha.
  5. Broke from staking and need to make dosh. Going to write a quick GDK bot with some customization for my account (Ancient teleporting & Looting bag). I'll post progress in a list as I go along, if anyone would like to contribute or collab, shoot me a PM. Aiming to be finished by tomorrow, midnight at the latest. Completed: Starting items withdrawn from bank from hashmap Looting bag API (Deposits) Teleport to Graveyard Attack Green Dragon Eat Food Open Bank In Progress: Looting bag API (Withdraw, bank)
  6. If you'd like my old source I can probably dig it up for you.
  7. As a script writer who wrote the asynchronous tasking for a previous script, did you use a queue with an Overridden peek to determine where to place the mouse? That was my method, was incredibly efficient, would highly recommend. Also, could we see a script to check out the new API?
  8. exuals

    Chatbox

    I was recently kicked & banned from the Chat for telling the user "Cortana" to "Fuck off" Now, I'm curious. This isn't allowed because I swore? Or insulted you're little e-whore? Either way this is ridiculous, this is an internet community, a public way to express opinions. If I have a negative opinion of another user I'll state it as I expect them to state it to me, when in discussion. Cortana corrected my context of "you're/your", I told her to fuck off and was kicked. I rejoined the chat and then was banned after attempting to argue (without using "language") my side of how idiotic it is to censor language in a fucking chatroom. I can name multiple users on a daily basis who swear in that chatroom with moderator presence, anyone here know of a "Smoke Crack"? He's nothing but an idiot and annoying troll that swears and tells new users to delete system32, don't worry, you can still find him in the chatroom, but not I. Get you're shit together, censoring language in a public internet chatroom? Get real. Embarrassing to be a part of this community.
  9. Could I write you a private script in exchange for boosting me from S1 to G5? ;)
  10. exuals

    BETA v1.7.49

    why can't I disable auto login random yet?
  11. Nice. Why bother posting? Thanks bud. Yeah, 10$~.
  12. Let's hope this thread doesn't get lost and lags out my bot. exGDK Node-Based, Responsive, Stable What is it? exGDK is a Green Dragon killing script that uses Ancient Magicks, Ring of Dueling, Obelisks, Player Combat Detection, Quick Combat and much more. It is nearly complete, when finished it will be available on the SDN. Current Progress exGDK was developed on a node based framework to improve clarity and flexibility especially when adding new content or updating previous content. Nodes: EatFood - Eat if we have food and are under 60 health AttackDragon - Uses mini-map camera, local entity checking for attackable, then filtering for best result based on proximity/player factors, very fast, area based LootBones - Loots bones, uses mini-map, camera roto, right clicking, fail-safes PortalHandler - Can detect current wilderness level, current portal, centre of obelisk and activate. BankingHandler - Walks to bank, deposits everything except teleport runes, withdraws sharks, necessary runes. RingOfDuelingHandler - Activates ring of dueling. TeleportHandler - Teleports to Graveyard WalkToPortal - Walk from GDKArea to Portal GYToPortal - GY to Portal walking handler CombatResponder - Needs to be tweaked to only validate on enemy player in current facingentityarray AntiBan - 50%, need to finish random switch cases for detail PanicHandler - 25%, will detect player combat and attempt to escape. Will use prayers, running, eating, procedural path-finding Design
×
×
  • Create New...