Jump to content

yfoo

Lifetime Sponsor
  • Posts

    191
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    100%

Everything posted by yfoo

  1. Day 4 or 5: 12/16/17 @Young Heek: Kinda, it looks something like this: package ScriptClasses; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "PayPalMeRSGP", name = "v:Alpha", info = "Alpha: Stun Alch", version = 0.12, logo = "") public class StunAlchScriptEntryPoint extends Script { PriorityQueueWrapper pqw; @Override public void onStart() throws InterruptedException { super.onStart(); ConstantsAndStatics.setHostScriptReference(this); pqw = new PriorityQueueWrapper(); } @Override public int onLoop() throws InterruptedException { return pqw.executeTopNode(); } } Runescape: I manually did a dragon defender. In doing so also advanced a few atk, str, and def levels. I now also have 94 mage. Current Stats: Scripting Progress: Implmented some artifical alching errors. I'm forgoing alching twice in a row because I don't think its necessary. Misclicking on earth blast when attempting to alch Attempting to alch an item but not clicking on the item. (there are some spots along the right edge of the alch icon that does not have the the item directly underneath) Some Issues I fixed After an alch runescape will return automatically return the player back to the magic tab, sometimes my script will attempt to race runescape by manually clicking back to the magic tab. This was caused by a call to canCast() before runescape automatically segues the tab back. I fixed the above by calculating the number of alchs left and storing that value therefore only calling canCast() on script start. (as of right now I just set that value to 100 for debugging purposes) Also after alching I was using the Magic.hoverOverSpell() to queue up a stun, however this happens only AFTER runescape flips the tab back to magic. I instead used Mouse.move() to a randomly generated coordinates over the stun icon similtaneously while runescape flips the tab back. These posts are more in depth than any commit message I've ever written. In my opinion the script is reasonably human-like but can use more tweaking. But I'll eat my words if I get banned. On another note, am I suppoused to take of InterruptedExceptions (try/catch/finally) or just throw them? I'm assuming just throw them as they are handled by the client as I occasionally see caught errors in the logger. As always, thank you for reading.
  2. Day 2: 12/13/17 Runescape Progress: 92 Magic with ~200k to 93, so about ~800k was gained. This was done using the alching script I made on my first day at OSbot. Scripting Progress: Created a Alpha version working stun-alching script. Had a little trouble with casting stun while the player is still alching animation but eventually fixed it, see below. The link to the souce code can be found here. https://github.com/PayPalMeRSGP/StunAlchWithNodes To better organize the script I used a node based system explained in this post: The advantage I interpretated from reading the above post are... seperating code into chunks or Nodes. This can be thought of as encapsulation as each node class holds the necessary code to preform its action reducing the code in onLoop() to just pq.executeNextAction(). I have nodes for alching, stunning, alching_error, and stunning_error. Alching and Stunning are explained by their respective names. Since stun-alching is a high APM task misclicks can occur thereby, a alching/stunning_error is an artificial mistake made by the script to emulate a human player. The mistakes I plan to program in later are... For Alching_errors: Misclicking on earth blast when attempting to alch Attempting to alch an item but not clicking on the item forgetting to stun and alching twice in a row For Stunning_errors: Misclicking on the NPC (missing) Misclicking entangle but not casting it (and not wasting runes) Misclicking entangle and casting it (maybe this goes in) a cleaner way to allow randomization of actions to occur. To implement the Node System I used a Priority Queue, the node at the top of the queue is to be executed next, usually this is either an alch or a stun as these have the highest priority by default. To swap between an alch or a stun, I switch the key or priority of the respective nodes. These nodes are then deleted and readded into the Pqueue,. In Java, a key update in a priority queue requires deleting and re-adding the associated object. (at least according to someone on stackoverflow) For an alching or stunning error to occur (i.e: have the alch/stun error node at the top of the pQueue), every time a successful alch or stun occurs I have a chance to increase the key of a stun_error or alch_error. (successful alch -> increase key of stun error; successful stun -> increase key of alch error). Eventually the priority of a stun error or alch error exceeds that of a successful alch or stun allowing for an artificial error to occur. The reason for having a success in one increase the other (its opposite) is because we do not want to proceed with an alching error after alching, the next action is suppoused to be a stun therefore a chance for a stun error to occur. In my opinion this is better than having random.nextInt() everywhere. Finally I would like to thank these users in no particular order for assisting me with scripting or otherwise in some way. Probably because I read something you wrote that was helpful. @Bobrocket @Apaec @Explv @The Undefeated@Chris Thank you for reading. Any constructive criticism on my progress or scripts are appreciated.
  3. In the process of writing a stun alching script I noticed that after calling castSpellOnEntity(HIGH_ALCH) then calling hoverSpell(STUN). The next call of castSpell(STUN) will not process until after the previous call of castSpellOnEntity(HIGH_ALCH). To better summarize: cast high alch -> hover cursor over stun -> pause until after high alch completes -> cast stun. However by replacing hoverSpell() with a call to Mouse.move() with random coordinates within the bounds of the stun spell, stun will be casted mid animation of high alch resulting in the desired outcome. My conclusion is that internally castSpell() or castSpellOnEntity() will delay the next castSpell() or castSpellOnEntity(). Can anyone else confim this? On another note, how do you check what interface tab the player is currently at (i.e: magic tab, inventory tab, quest tab, etc.) relevant code that handles stun alching: public int executeNodeAction() throws InterruptedException{ Magic m = hostScriptReference.getMagic(); PriorityNode nextNode = this.pq.peek(); hostScriptReference.log("Executing: " + nextNode.p.name()); switch(nextNode.p){ case ALCH: if(m.canCast(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)){ m.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY); MethodProvider.sleep(ConstantsAndStatics.randomNormalDist(ConstantsAndStatics.BETWEEN_ALCH_MEAN_MS, ConstantsAndStatics.BETWEEN_ALCH_STDDEV_MS)); if(m.isSpellSelected()){ hostScriptReference.getInventory().interact("Cast","Magic longbow"); } MethodProvider.sleep(ConstantsAndStatics.randomNormalDist(ConstantsAndStatics.RS_GAME_TICK_MS, 80)); swapKeysStunAlch(); if(hoverOverStun()){ //originally was m.hoverSpell(Spells.NormalSpells.STUN) //return (int) ConstantsAndStatics.randomNormalDist(50, 5); return 0; //force onLoop to not sleep to better test } } hostScriptReference.log("cannot cast alch"); return 10; case STUN: if(m.canCast(Spells.NormalSpells.STUN)){ if(npc == null){ hostScriptReference.log("no NPC creating instance"); npc = hostScriptReference.getNpcs().closest("Monk of Zamorak"); } stop = System.currentTimeMillis(); m.castSpellOnEntity(Spells.NormalSpells.STUN, npc); swapKeysStunAlch(); if(m.hoverSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)){ //return (int) ConstantsAndStatics.randomNormalDist(50, 5); return 0; //force onLoop to not sleep to better test } } hostScriptReference.log("cannot cast stun"); return 10; case ALCH_ERROR: //for later implementations of emulating human mistakes return 0; case STUN_ERROR: return 0; } return 1000; } private boolean hoverOverStun(){ int randX = ThreadLocalRandom.current().nextInt(STUN_UPPER_LEFT_BOUND.x, STUN_LOWER_RIGHT_BOUND.x); int randY = ThreadLocalRandom.current().nextInt(STUN_UPPER_LEFT_BOUND.y, STUN_LOWER_RIGHT_BOUND.y); hostScriptReference.log("hovering stun at: (" + randX + ", " + randY + ")"); return !hostScriptReference.getMouse().move(randX, randY); } The onLoop() method: @Override public int onLoop() throws InterruptedException { return pqw.executeNodeAction(); }
  4. A random mouse move within the bounds of the the high alch icon. My solution was to hardcode the 2 points on opposite corners of the icon (bounds) as at the time I did not know the method to obtain them. private static final Point LOWER_BOTTOM_LEFT_BOUND = new Point(709,336); private static final Point UPPER_TOP_RIGHT_BOUND = new Point(720,321); private boolean randomMouseMove(){ this.randomMouseMoveCountdown--; if(this.randomMouseMoveCountdown <= 0){ this.randomMouseMoveCountdown = ThreadLocalRandom.current().nextInt(750, 1001); int randX = ThreadLocalRandom.current().nextInt(LOWER_BOTTOM_LEFT_BOUND.x, UPPER_TOP_RIGHT_BOUND.x); int randY = ThreadLocalRandom.current().nextInt(LOWER_BOTTOM_LEFT_BOUND.y, UPPER_TOP_RIGHT_BOUND.y); getMouse().move(randX, randY); return true; } return false; } Within a set bounds.
  5. OsBot Ironman Challenge Rules IronMan mode in Runescape prevents the player from financially interacting with any other player in the game. Based upon RS IronMan mode, the OsBot Ironman Challenge prevents me from using any script not of my own creation. However taking and using code snippits such as from Explv's paint tutorial is legal. Methodology For about the next month I will attempt to spend a significant amount of time with OsBot's API to program an undetermined number scripts to achieve a number of ingame goals as well as proficiently learn the API. Simultaneously I will be botting on my account with the scripts I've made. Furthermore I will be hosting a public github repo with every script I write for now (not the future barrows one). Constructive Criticism is appreciated. https://github.com/PayPalMeRSGP These are the current stats of the my 3 week old account. I have legit played this account everything except 91 mage. I would be very sad if the account is banned and will do my best to ensure a standard of script nondeterminism. Bot smartly... breaks, 3-4 hours sessions MAX, playing legitamently, etc. Tenative Goals 75 atk, 75 str, 75 def, 70 range, 70 prayer, 99 mage. Scripter I Scripter II Planned Scripts Hello World Autoclicked: introduction to OSbot API https://github.com/PayPalMeRSGP/HelloWorld_OsBot Splash Alcher (awaiting sdn approval) https://github.com/PayPalMeRSGP/StunAlchWithNodes/tree/master/src DONE GUI to select debuff splashing spell (curse, vulerability, enfeeble, or stun), target NPC, and Alching target Draggable paint Splash Alching TODO add ability to splash debuff spell without alching. NMZ afker (Alpha) https://github.com/PayPalMeRSGP/NMZ_AFK Done: Drinks absorptions when low, Drinks Overloads when needed, guzzles rockcake to lower hp to 1. emulates AFKing NMZ by letting hp regenerate to a randomly generated limit and only interacting when an overload or absorption is needed. Otherwise the mouse is off the screen. TODO: Paint and GUI Automatically enter dreams Buy potions when low fix bug where sometimes overloads are skipped and the script guzzles to 1 hp from 51hp or above. Probably better to use onMessage() check for the overload expiration message instead of doing an HP check Detect when attacked by multiple NPCs and run across the room to encourage NPCs to line up. Barrows Script (After ScriptorII) Personal Skillset PayPal Software Engineer Proficient with Java and OOP paradigms. Passable with stackoverflow: Golang, Python, Ionic2 Framework, C/C++ Android Development Bachlors in CS Understanding of Data Structures and Algorithms, O(N), and all those genuinely intresting topics.
  6. Thanks guys, I ended up using the mouse position display and hardcoding it. I'll remember this.
  7. The client is able to highlight the bounds of interaction for items in the inventory. What class/methods would I use to obtain these bounds?
  8. yfoo

    Hello World

    Hi, I just started playing OSRS ~3weeks ago but have played/extensively botted back 6-7 years ago when Rs3 was still Rs2. This was also back when RSbuddy was a botting client and I was script kiddy. Now as a software engineer, I joined OSbot because I wanted to make my own scripts and get a few 99s. As a personal rule, I am not allowed to use anyone else's scripts, therefore any scripts I run are my own creation. If people are intrested I am willing to make my scripts open source along with progress updates on my account. I'll be botting in mirror mode to presumably mask the usage of a 3rd party client. For my Hello World script for OSbot's API heres a simple high alcher: https://github.com/PayPalMeRSGP/HelloWorld_OsBot. Currently it only alchs magic longbows but I plan to modify it tomorrow to include a paint and an item selection interface. Furthermore to make the script less deterministic it already uses a normal distribution method to generate a random interval between click intervals. Thank you for reading this, and good luck with goldfarming and inflating the runescape economy.
×
×
  • Create New...