Jump to content

Normangorman

Members
  • Posts

    21
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male
  • Location:
    Gateshead, England

Contact Methods

  • Skype
    dude_fish@hotmail.co.uk

Recent Profile Visitors

987 profile views

Normangorman's Achievements

Bronze Poster

Bronze Poster (2/10)

14

Reputation

  1. I've noticed recently that localWalker#walk won't actually always take you to the position that you want to walk to, but rather will go to one in the nearby area. This can cause bugs, for example if you define an area that is the inside of a certain building, and then you call localWalker#walk and pass it this area, then you might end up walking to one of the squares outside of the building because of this inaccuracy. It occurs because the default walking event has a distance threshold of 2, so any square within 2 squares of the one you pass to the function is considered a valid walk target. If you need walking that is accurate to the square, then you can change this threshold to 0. Position targetPosition = new Position(3400,3200,0); WalkingEvent w = new WalkingEvent(targetPosition); w.setMiniMapDistanceThreshold(0); w.setMinDistanceThreshold(0); script.execute(w); This will always walk to the exact square you give. By using custom events like this, you can also control whether the event blocks. So if you need asynchronous walking (which can be useful) then you can do this before you execute it: w.setAsync();
  2. Thanks for your help. By combining both of these checks I was able to create a snippet that solves the problem. Note that RandomSolver#shouldActivate crashes with a NullPointerException if you call it for the WELCOME_SOLVER event when you're already logged in. This is probably a bug - and is the reason for the try - catch below. if (!doneOnReady) { boolean loggedIn = bot.getClient().isLoggedIn(); boolean inWelcomeScreen; try { inWelcomeScreen = bot.getRandomExecutor().forEvent(RandomEvent.WELCOME_SOLVER).shouldActivate(); } catch (NullPointerException e) { inWelcomeScreen = false; } if (loggedIn && inWelcomeScreen == false) { onReady(); doneOnReady = true; } else { return 100; } }
  3. Thanks FrostBug - your comment led me to org.osbot.rs07.api.Widgets which has the methods in to do what I need to do
  4. I use IntelliJ for all my development so if you have any other questions feel free to send me a PM.
  5. Does anyone know how to implement this? Scripts seem to get a couple of 'onLoop's off in between the client solving the login screen event and detecting the welcome screen event. The welcome screen seems to cause weird bugs in the initial part of a script if you need to set up config based on what the player can see.
  6. Ok, yeah I understand what you mean. But still, there's a difference between saying sentences and having a conversation. The problem remains - how do we detect whether two people are conversing in order to collect data from their conversation to build this database. I guess if there are only 2 people (and you) and they are talking, then they must be talking to each other - but if you think about somewhere like the Grand Exchange, there are hundreds of people all talking at once.
  7. Actually it doesn't use the same template for greetings, there is a selection that it randomly chooses from. The screenshot in the post just happens to feature the same template chosen twice in a row. You're right though, it is risky because the standard of the conversations can vary a lot. I had this one recently which was pretty funny, and also fairly human like: Me: Hi X. X: Hello. Me: Hi. X: What's up. Me: Nothing, you? X: Just getting some levels. Me: Getting what? X: Strength. Me: Well in life you must learn to over come trails by believing that you will make it. X: Im too high for that much Me: I don't think s. Then again, you get the occasional awful one like this: X: Norma are u obby maulker? Me: I agree. X: So obby maulers are not 28lv anymore?? Me: I was never Roboton... X: With 60str Me: Your best friend. Your point about using people's full names just gave me an idea. Perhaps it could attempt to split up people's names into sub-names (so "DingleBert3" becomes "dingle" and "bert") and then use those instead. I'll definitely try and implement this An interesting idea definitely! Have you heard of the concept of neural networks? Because what you're suggesting is basically the same principle. Actually implementing this would be seriously hard, partly because you would need to gather a large amount of input data. It wouldn't be hard to gather a large amount of chat messages but gathering logs of people's conversations is basically impossible because the bot would need a near-human level of language understanding to be able to tell when two people are in conversation. If you can't gather conversations then the bot will be able to say runescape-esque things like "buying gf" or "selling lobs 300ea cause i'm an extortionate mf" but won't have any clue how to respond to people in a sensible way. tl;dr Your suggestion is great but would probably take a team of AI professors to implement.
  8. Thanks for checking out my script! Because this is my first public script, I am counting it as learning experience - and also making it free and open source. Whilst there are many AIO combat scripts and indeed cow killing scripts out there already, I think this one has some nice features that set it apart. Jar download: https://dl.dropboxusercontent.com/u/80523064/OSBot/FlawlessLumbridgeCows.jar Source code: https://github.com/Normangorman/flawlesslumbridgecows Features: Efficient and robust combat system which always selects the nearest cow that is not in combat. Supports both the eastern and western Lumbridge cow fields, and will randomly alternate between them. Randomizes the paths taken when walking to fields. Capable of sending you email updates with the progress that has been made (including information such as the amount of xp gained). This is great if you are going out and want to keep track of how the script is doing. Detects when someone is talking to you by scanning messages for your username or parts of your username. Starts up conversations with other players periodically using Cleverbot to generate messages. Conversations are aborted if the target moves away or does not respond. Chat logs are emailed to you (because they tend to be very funny). If someone attempts to trade with you then their offer will be politely declined. Picks up bones from cows that are killed and buries them when your inventory is full. Stat level goals can be set and the script will stop training that skill when the goal is met. Lots of error checks - if something goes wrong for any reason (e.g. you walk out of the field for a moment and someone shuts the gate) then the problem will be resolved and everything will be back on track in no time. Usage instructions: Start the script in either of the cow fields or anywhere around Lumbridge. I have only tested the email update functionality using GMail. If you use a different email provider then you need to find out the provider's SMTP host and port details. You may also need to give permission for the application to access your email account (you certainly do with GMail). Don't be worried about putting in your email address and password - nothing shady is going on. Read the source code on Github using the link above if it bothers you. The "Username aliases" section in the config are parts of your username that another player might use to identify you. E.g. If your name is "BobSlayer1" then someone might called you "bob" or "slayer" so you should enter these as aliases. They will be used to assess whether someone is talking to you. Gallery: 5 hour progress screen Sleek user interface Email update Responding to someone starting a conversation Politely declining a trade offer If you have any comments, tips or bug reports then I would love to hear them! Just leave a post and I will get back to you as soon as possible. Hopefully this script will be available on the SDN in the near future.
  9. I can confirm that the standard client runs on my Raspberry Pi which uses a variant of Debian. As long as there is a suitable Java runtime environment available for your system then everything should work fine.
  10. Hi all. I'm trying to work out how to change attack style (e.g. from "Chop" to "Hack"). It seems that there should be a method in org.osbot.rs07.api.Combat such as 'setAttackStyle' - but this does not seem to be the case. Is there an equivalent method somewhere in the API that I am missing?
  11. Ah yours looks great josedpay. I've heard it mentioned before but couldn't find it. I'll probably start using your one instead
  12. Hi all! Two scripts for you here - one to record the path your character walks and another to record an area of squares that you walk over. I'm sure scripts like this exist out there already but I couldn't find any, and wanted to try making my own. Both are useful for generating arrays of positions to be copy-pasted into your project. WALK RECORDER: Records the path your character walks, and then logs it as an array of positions. Code: import org.osbot.rs07.Bot; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; import java.util.ArrayList; @ScriptManifest(name ="OSBot Walk Recorder", author = "Normangorman", version = 1.0, info = "", logo = "") public class WalkRecorderScript extends Script { private java.util.List<Position> positions; private Position lastPosition; @Override public void onStart() { positions = new ArrayList<Position>(); lastPosition = myPosition(); positions.add(lastPosition); } @Override public void onExit() { log("///// Path as Position array: /////"); String str = "\nPosition[] path = {"; for (int i=0; i<positions.size(); i++) { Position p = positions.get(i); // Treat the last one differently to finish off the array. if (i == positions.size() - 1) { str += String.format("new Position(%d,%d,%d)};", p.getX(), p.getY(), p.getZ()); } else { str += String.format("new Position(%d,%d,%d), ", p.getX(), p.getY(), p.getZ()); } } log(str); log("//////////////////////////////////"); } @Override public int onLoop() throws InterruptedException { Position currentPosition = myPosition(); log(currentPosition.distance(lastPosition)); if (currentPosition.distance(lastPosition) > 1) { positions.add(currentPosition); lastPosition = currentPosition; } sleep(random(900,1000)); return 1; } @Override public void onPaint(Graphics2D g) { super.onPaint(g); g.setColor(Color.CYAN); g.drawString("Number of points in path: " + positions.size(), 10, 280); g.drawString(String.format("Most recent point added: (%d, %d, %d)", lastPosition.getX(), lastPosition.getY(), lastPosition.getZ()), 10, 295); g.setColor(Color.YELLOW); Bot b = getBot(); for (Position p : positions) { if (p.isVisible(b)) { g.fillPolygon(p.getPolygon(b)); } } } } Screenshot: The output you get from the log for this script looks something like this: Position[] path = {new Position(3198,3279,0), new Position(3200,3279,0), new Position(3203,3278,0), new Position(3205,3278,0), new Position(3207,3279,0), new Position(3209,3279,0), new Position(3211,3278,0)}; AREA RECORDER: This second script uses basically the same principle, however by using a more efficient data structure it allows much greater areas to be recorded. It is especially good for mapping the walkable regions of areas filled with obstacles such as the stronghold of security. It is also capable of handling large areas (I was able to record the whole of the Lumbridge cow field with it which is around 400 squares). Code: import org.osbot.rs07.Bot; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; import java.util.HashSet; import java.util.Iterator; @ScriptManifest(name = "OSBot Area Recorder", author = "Normangorman", version = 1.0, info = "", logo = "") public class AreaRecorderScript extends Script { private java.util.HashSet<Position> positions = new HashSet<Position>(); private Position currentPosition; @Override public void onStart() { currentPosition = myPosition(); } @Override public void onExit() { log("////// Position array: //////"); String str = "\nnew Area(new Position[] {"; Iterator<Position> posIterator = positions.iterator(); while (posIterator.hasNext()) { Position p = posIterator.next(); if (posIterator.hasNext()) { str += String.format("new Position(%d,%d,%d), ", p.getX(), p.getY(), p.getZ()); } else { str += String.format("new Position(%d,%d,%d)});", p.getX(), p.getY(), p.getZ()); } } log(str); log("/////////////////////////////"); } @Override public int onLoop() throws InterruptedException { currentPosition = myPosition(); positions.add(currentPosition); return 40; } @Override public void onPaint(Graphics2D g) { // Debug the number of positions in the area. g.setColor(Color.CYAN); g.drawString("Number of positions in area: " + positions.size(), 10, 280); // Highlight all positions in the area. Bot b = getBot(); Iterator<Position> posIterator = positions.iterator(); Position p; while (posIterator.hasNext()) { p = posIterator.next(); if (p.isVisible(b)) { g.fillPolygon(p.getPolygon(b)); } } // Fill in the current square. g.setColor(Color.RED); g.fillPolygon(currentPosition.getPolygon(b)); super.onPaint(g); } } Screenshot: Example log output: new Area({new Position(3197,3289,0), new Position(3197,3291,0), new Position(3197,3290,0), new Position(3197,3287,0), new Position(3197,3288,0)); Hope that someone finds these useful!
  13. Thanks for the quick responses guys! From what I've seen the community here seems great. I will try making them closer together and post again with my progress. Do you know where I can find Josed's path maker?
  14. Hi all, hopefully someone can help me out here. I'm trying to write a simple cow killing script featuring a death walk from Lumbridge back to the (western) cow field. The path I've declared looks like this: private final Position[] PATH_TO_COWS = { new Position(3225,3219,0), new Position(3234,3219,0), new Position(3230,3232,0), new Position(3218,3264,0), new Position(3215,3277,0), new Position(3197,3281,0), new Position(3199,3289,0) }; And the relevant code looks like this: case RUNNING_TO_COWS: log("Beginning running case."); localWalker.walkPath(PATH_TO_COWS); log("Finished walking path."); current_state = State.IDLE; break; My script uses a simple state-machine design, and RUNNING_TO_COWS is a state that occurs immediately after the player has died and respawned in lumbridge. It is also triggered on script startup if the player is in Lumbridge (this is the case for the log output below). Unfortunately what happens when I run this is that the bot walks to the first point in my list at (3225,3219,0) and then stops. At this point walkPath thinks it has reached the end of the path and thus ends. The log output looks like this: [iNFO][bot #1][07/03 02:50:05 AM]: Started script : Cow Killer [iNFO][bot #1][07/03 02:50:05 AM]: Beginning idle case. // In the idle case some code verifies the player is in Lumbridge and thus starts the RUNNING_TO_COWS case. [iNFO][bot #1][07/03 02:50:06 AM]: Beginning running case. [iNFO][bot #1][07/03 02:50:12 AM]: Finished walking path. // This occurs when the first point in the path has been reached. [iNFO][bot #1][07/03 02:50:13 AM]: Beginning idle case. Does anyone have any idea what I am doing wrong here? Any help would be very much appreciated. Will walkPath handle obstacles such as the gate to the cow field or will I have to do that manually? I had a look at https://github.com/Lem0ns/Walker but it seems overly bulky for my simple use case. It would also be helpful to know where I could find open source OSBot scripts to study, because I haven't been able to find many browsing the forums and I feel this is the best way to learn.
×
×
  • Create New...