Jump to content

xlDino

Members
  • Posts

    56
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by xlDino

  1. this might help you get started, PM with any questions
  2. Would this fix wilderness ditch warning with webwalking? or do i need my own handler
  3. Not true. Post amazon prime bot cleanup day
  4. All thoughts or improvements are welcome! 1. initStages(): This method initializes the stages of the bot. It creates an array of "Stage" objects and assigns it to the "stages" variable. In this example, there are two stages defined: StageOne and StageTwo. 2. nextStage(): This method determines the next stage that should be executed based on the current stage. It searches for the index of the current stage in the "stages" array and returns the stage at the next index. If there are no more stages, it returns null, indicating that the script has completed. 3. onStart(): calls the initStages() method to initialize the stages and assigns the first stage to the currentStage variable upon bot startup. 4. onLoop(): Inside this method, the current stage is checked, and if it exists, its logic is executed by calling the `execute()` method of the current stage. After executing the logic, the isCompleted() method of the current stage is checked to determine if the stage is completed. If the stage is completed, the next stage is transitioned to by calling the nextStage() method. If there are no more stages, the script restarts by re-initializing the stages and assigning the first stage to the currentStage variable. The method returns an integer value that represents the delay between iterations of the loop. import java.awt.Graphics2D; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(name = "MyScript", author = "YourName", version = 1.0, info = "", logo = "") public class Main extends Script { boolean debugMode = true; private Stage previousStage; private Stage currentStage; private Stage[] stages; private void debug(String message) { if(debugMode){log("[DEBUG] " + message);} } private interface Stage { void execute() throws InterruptedException; boolean isCompleted(); } private void initStages() { stages = new Stage[]{ new StageOne(), new StageTwo() }; } private Stage nextStage() { int currentIndex = -1; for (int i = 0; i < stages.length; i++) { if (stages[i] == currentStage) { currentIndex = i; break; } } if (currentIndex != -1 && currentIndex + 1 < stages.length) { return stages[currentIndex + 1]; } return null; // No more stages, script completed } public void onStart() { // Initialize stages initStages(); // Start with the first stage currentStage = stages[0]; } public void onExit() { // Cleanup code } public void onPaint(Graphics2D g) { } public int onLoop() throws InterruptedException { if (currentStage != null) { boolean stageChanged = currentStage != previousStage; if (stageChanged) { debug("[StageHandler] Current Stage: " + currentStage); previousStage = currentStage; } currentStage.execute(); if (currentStage.isCompleted()) { currentStage = nextStage(); previousStage = null; // Reset previousStage when transitioning to a new stage } } if (currentStage == null) { debug("Stage is null! Restarting stages..."); initStages(); currentStage = stages[0]; previousStage = null; // Reset previousStage when restarting stages } return random(500, 1000); // Set a delay between iterations } private class StageOne implements Stage { public void execute() throws InterruptedException { } public boolean isCompleted() { // Stage One completion condition return false; } } private class StageTwo implements Stage { public void execute() throws InterruptedException { // Stage Two execution logic } public boolean isCompleted() { // Stage Two completion condition return false; } } } An example StageOne that checks if the player is moving, and completes if they are: private class StageOne implements Stage { public void execute() throws InterruptedException { // Check if the player is moving if (!myPlayer().isMoving()) { debug("Player is not moving..."); } else { debug("Player is moving..."); } } public boolean isCompleted() { // Completion condition: Player is moving return myPlayer().isMoving(); } }
  5. Found this out after hahahahaha
  6. This method finds what direction the player is facing based on the previous tile, and assigns it to the 'direction' string. private void checkPlayerDirection() { int currentX = myPlayer().getX(); int currentY = myPlayer().getY(); int deltaX = currentX - previousX; int deltaY = currentY - previousY; if (deltaX == 0 && deltaY == 0) { direction = previousDirection; // Use the previous direction when not moving } else if (deltaX == 0) { direction = deltaY > 0 ? "North" : "South"; } else if (deltaY == 0) { direction = deltaX > 0 ? "East" : "West"; } else if (deltaX > 0) { direction = deltaY > 0 ? "North-East" : "South-East"; } else { direction = deltaY > 0 ? "North-West" : "South-West"; } if (!direction.equals(previousDirection)) { log("Player is facing: " + direction); previousDirection = direction; } } onStart previousX = myPlayer().getX(); previousY = myPlayer().getY(); onLoop checkPlayerDirection(); previousX = myPlayer().getX(); previousY = myPlayer().getY(); Variables int previousX; int previousY; String direction; String previousDirection; Usage if(direction == "North") { //do something }
  7. public void projectilePrayerSwitch() { for (Projectile p : projectiles.getAll()) { if (p.getId() == 2176) { log("NPC attacked with magic!"); prayer.set(PrayerButton.PROTECT_FROM_MAGIC, true); } else if (p.getId() == 2178) { log("NPC attacked with ranged!"); prayer.set(PrayerButton.PROTECT_FROM_MISSILES, true); } } } and animations public void animationPrayerSwitch() { // Iterate over all NPCs for (NPC npc : npcs.getAll()) { // Get the current animation ID of the NPC int animationId = npc.getAnimation(); // Check if the NPC is attacking with magic if (animationId == 711) { log("NPC attacked with magic!"); // Activate Protect from Magic prayer.set(PrayerButton.PROTECT_FROM_MAGIC, true); } // Check if the NPC is attacking with ranged else if (animationId == 249 || animationId == 250) { log("NPC attacked with ranged!"); // Activate Protect from Missiles prayer.set(PrayerButton.PROTECT_FROM_MISSILES, true); } } }
  8. xlDino

    Accounts

    DM me on discord xlDino#8544
  9. Yea, not the average rs player. Bot to simulate the average player, not the top 0.1% and your bans WILL decrease
  10. Currently 70+ agility on multiple accounts. Bans are at an all time low using stealth mode + new mouse. If botting agility you should babysit and only bot 20-30mins at a time, with frequent breaks. Would you sit and do 3 hours of agility irl?
  11. xlDino

    Stealth Quester

    Any chance to add family crest for goldsmith gauntlets?
  12. Got it figured out, script is running flawlessly now! Not using ibans
  13. Long term user here, I'm looking to make a script. It will be fully open source, and community lead. So for starters, are there any niche's that could be filled? What would be a good start that's not been done to death? Hopefully this is the start of something great!
  14. No support for ibans staff/rune pouch?
  15. xlDino

    Czar Guardians

    Does script support the agility shortcut?
  16. Script is taking a long time to startup. Wont show correct XP gained in combat skill, and wont alch cause it thinks im out of nature runes (they're in my rune pouch)! Just thought i'd let you know
  17. Could I get a trial please?
  18. xlDino

    ezCannon

    can i get a trial please?
  19. Title says it all! willing to use a middleman looking for $25 CAD pm me on discord xlDino#8544
×
×
  • Create New...