Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/18/14 in all areas

  1. its that did you just fucking give me, your king, an order pouf! such a murderous and wonderful stare, anyone here watch hunter x hunter?
    2 points
  2. Looks good, but you could convert that to an enum.
    2 points
  3. For kids who don't have a job a nice $5 a week can be a new video game, etc. I make a decent $500 a week, and you might say this is a waste of my time. But I spend probably 30 minutes a week and I get $5 to spend on things from my car, or phone. It's really nice to see that that money isn't coming out of my paycheck, if I spent $5 a week for a year, I'd spend close to $250.
    2 points
  4. Definitely this, and also make sure to transfer over 1k Monkfish at a time perhaps whilst fishing.
    2 points
  5. @RoomScape, our newest (and oldest) retard
    2 points
  6. Using Multiple Classes Complete Guide! Tutorial Written By: @NotoriousPP Introduction: It has been brought to my attention that some script writers do not know how to use multiple class files inside of their project, and in this tutorial I will try to cover everything I can, to help you have a better understanding how this is done correctly. I will be working on an example project for this tutorial, just follow along using your own project, doesn’t matter which type of project, as long as you understand what’s going on. This project will be modeled in a State based framework, as I see this most often used throughout the forum. Another question you may have, why should you use multiple classes, what are the benefits, is there an upside? Speaking from an Organizational aspect, yes! Splitting up classes makes it easier for the writer and to whoever is working on the script, instead of having to search through a wall of text; you can simply find the class in your Project Folder. Things you’ll need: A Computer or Laptop. A IDE (For this tutorial I will be using Itellij) Latest Version of OSBot. A Brain (Might help) Getting your project setup: Create new project, and add OSBot as a library. Your project should now look something like this: Create packages inside of your src folder, this well help better organize your script! After doing this it should look similar to this: The Real Work Begins (Kinda): So now that we have packages in our src, we need to fill them up! So first lets create a Script class inside of our Core package. (Notice the Class name “ExampleScript”, this is following correct Conventions. An incorrect way of naming classes would be “examplescript”, “exampleScript”, “EXAMPLE_SCRIPT”, etc. If you would like to learn more about Conventions, you can go here: Code Conventions for the Java Programming Language) Alright so now we have a basic Skeleton setup, though it does nothing just yet. Well, lets change that! Since for this tutorial we are writing a State based script, first we need to create State Objects! To do this we need to create an Enum, which basically is “a special data type that enables for a variable to be a set of predefined constants.” (docs.oracle.com). I personally like to have a package that stores all my data needed for a script, so I’m going to create a new package “data”. After we have created the package, create a new Enum inside of the “data” package. (If you don’t know how to create an Enum right away, just create a new class file for right now, and I’ll show you what to do next!) (If you were one of the people who did not know how to create an Enum, simply create a new Class, and then replace “class” with “enum”, and your set!) For this Enum were are only really using the name, and not storing any real data here, so all we need to do is add the different States we want in our script! For this example, I will be using Attack, Eat, Loot, Drop, and Bank. REMEMBER! To follow correct Conventions we are going to name the states using all CAPITAL letters. Optional: Adding a toString() method can be used to make your “state” or “status” more presentable, and not YELLING AT YOU when displaying. The method essentially grabs whatever “state” being used, and modifies it to your liking. In the example below, it creates a final String “s”, then replaces all underscores (Not used in example) with a space; the next like I return the String “s”, though I grab the first Char of the string and add it to a substring for the rest of the string and add a toLowercase(), making ATTACK, to Attack. This is especially helpful when using States as a status; this method can be applied to all types of Enums! (Cool trick if you’re a Windows Intellij user! You can type all your states without having to type with caps lock, or holding shift; just type your states, select them, and press “ctrl + shift + u”, and it will capitalize all selected, or turn it to lowercase if already capital) So we have our States, now what do I do? Well we need to get a getState() method ready our Script class. If you don’t already know, this is the method we use to determine which action or “state” should be executed. Then in the onLoop we have a Switch statement that determines which action should be executed. So what do we do now? The some people here make the mistake of continuing using this class for their tasks, actions, and data; just everything really. This is exactly what this tutorials main focus is on; how we can use multiple classes to help organize our project. You Script class should now look something similar to this. So now we get to create our first separate class! You may ask, well how will I be able to use myPlayer(), client.getInventory(), if I’m not inside of the Script class. Well one word really “Constructors”. We are going to need to create a constructor that takes a Script variable which we can use throughout the script, in this case “sI” (Swizzbeat are you happy now? I didn’t use sA this time ) which refers to Script Instance; but first we need to create a new class inside of our “tasks” package (folder), and in the example I will be creating an Attack() class. In this class we create a public Constructor that accepts a Script variables “sI” as discussed before! So now you should have a class that looks like this. Well you’re almost done implementing your first separate class (If this is your first time that is)! In the Attack() class we can now use “sI” for all of the calls we need, so instead of typing myPlayer() like in the Script class, it would be sI.myPlayer() in your extended class. So for example you can do something along the line of this: (Please don’t use this snippit below for real, it’s just a funny example, I don’t want a PM saying this didn’t work…) Alright so I got a separate class, but how the hell do I use this shit? You might be asking. Well in your Script class, since you extended Script, by using “this” is other words a Script variable, so that’s what we will be using to call our class! So in the onLoop, we can now add the new separated class, simply by adding “new Attack(this);”. Yup it was that easy! So it should look similar to what I have below. Just import the class (Most IDEs do it automatically), and call the class using “new Class(this)”: Well if you don’t understand how this all works by now, read through it once more, it will make sense eventually! To add more classes to our project, just use the same logic we used in creating our Attack() class(Or hell you can just copy/paste, and edit a little). The other packages in our “src”, can be used for numerous of different classes, just it’s up to you to fill them, just use them to keep organized! Conculsion: Well if you followed along, and got it working correctly! Congratulations! Separating classes help you so much down the road when working with large project, teammates, and or co-workers! No one wants to read a wall of text, it’s much easier to navigate through folders and get the file you need (Like how an office files paper work, Duh…). I really hope you guys all enjoy reading this, and it helps a few people out with their scripts! If you have any suggestions, and or comments, please leave them below, and I’m more than gladly answer them! Also let me know about any errors that you find! I'm not a expert, just trying to help! Sources used: http://docs.oracle.com/javase/tutorial/java/javaOO/enum.html http://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html http://www.oracle.com/technetwork/java/codeconv-138413.html
    1 point
  7. 1 point
  8. Dunno, reading a thread, refereshing, suddenly the poster is already banned Khaleesi Same thing with exuals Perhaps we could use some system to check what the person is banned for? It's usually useful information.
    1 point
  9. I recently saw someone requesting karamja so if anyone needs it PM
    1 point
  10. Omg killua would look awesome, ill probs make something to do with him on the weekend
    1 point
  11. ^^^ pls make my fav char
    1 point
  12. are you fucking kidding me.... -.- why the hell would you choose rs3 over os
    1 point
  13. Here you go... http://lmgtfy.com/?q=free+icons
    1 point
  14. I agree with @Swizzbeat, I've seen countless pictures, and even had the chance to fuck with bots who using some type of message response, for example using CleverBot. You can obviously tell it's a bot by the way they respond. I even saw on bot who said a random word every 20 minutes or so, and that was a horrid Idea, because every time I asked what the fuck, it never responded. I feel you have more of a chance getting banned trying to talk back, than if you just ignored them, because honestly, it's not hard to outsmart a bot, and it could cause some issues down the road.
    1 point
  15. That's an issue on your behalf, but like has been said throughout this thread - Scripters deserve a constant flow of money for their product. Too many people buy these one time purchases and expect it to be flawlessly updated.
    1 point
  16. Gratz man! i'd buy you a beer if i could
    1 point
  17. '' so yea im free now '' lol. nope.
    1 point
  18. Congratz bro. party hard.
    1 point
  19. Working thank you..
    1 point
  20. Just confirm for me after you're done.
    1 point
  21. So, before you kill me for asking you to use bing, read below. I've been using Bing Rewards for awhile and with Bing Rewards I have 2-3 accounts. Every day I search a bunch on my phone and in my browser and earn rewards points. It takes about 2-5 minutes on each account. When I get around 500 credits, I redeem it for $5 amazon cards. I have gotten a few, and this is a really underused way to earn cash. If you want to do it, if you could, you could use my referral link. http://www.bing.com/explore/rewards?PUBL=REFERAFRIEND&CREA=RAW&rrid=_597783a8-4b68-ef21-3e51-2bf2837477d5
    1 point
  22. It's moved back to the top.
    1 point
  23. lol'd. I go to the bathroom and take my phone or tablet and my dad knocks on the door saying what're you doing and what's that sound. I :lol: and
    1 point
  24. You don't need to change ISPs to get a new IP, that's ridiculous. Call your ISP and say "I'd like a new IP address", the end; just don't run your mouth about how it's for a "bot". If they ask, just say you've been having issues with it and you'd like to change it. Also, play the account legit until it's well-rounded (well quested, lots of time put into untradables, etc) and then bot it for reasonable amounts of time in safer areas.
    1 point
  25. Imagine me saying this in George Takai's voice; "helloooooooooooooo" Welcome back Cinna
    1 point
  26. Hey, before i start I've seen this one already on forums, as i remember our BrainFree mentioned it. Because my engrish is really bad, i will try to provide links instead writing how it works. So here it is one more time: Convex hull is generally tightest area of point set. So what we want to do is to calculate 2D points of our object, entity and make convex hull for it for perfect bounding polygon, it will be really helpfull on fighter scripts or any script that needs to interact alot, it will fail less time. Bounding box you were using: What we want to accomplish: As you see we have some blind spots on basic rect bounding box: Red - hulling will reduce them. Yellow - hulling will not reduce them (actually the one i want to show) It is not really necessary to remove yellow ones so w/e. The thing is we want to shink area a little bit to be more precise when interacting. So the algorithm is like this: /** * Making convex hull around points. * * @param points - the points * @return - the convex hull points points. */ public static short[][] hull(short[][] points) { int upperSize = 2; int lowerSize = 2; int pointsSize = points.length; short[][] lUpper = new short[pointsSize][2]; short[][] lLower = new short[pointsSize][2]; short[][] xSorted = points.clone(); Arrays.sort(xSorted, new Comparator<short[]>() { @Override public int compare(short[] o1, short[] o2) { return Integer.compare(o1[0], o2[0]); } }); lUpper[0] = xSorted[0]; lUpper[1] = xSorted[1]; lLower[0] = xSorted[pointsSize - 1]; lLower[1] = xSorted[pointsSize - 2]; for (int i = 2; i < pointsSize; i++) { lUpper[upperSize] = xSorted[i]; upperSize++; while (upperSize > 2 && !rightTurn(lUpper[upperSize - 3], lUpper[upperSize - 2], lUpper[upperSize - 1])) { lUpper[upperSize - 2] = lUpper[upperSize - 1]; upperSize--; } } for (int i = pointsSize - 3; i >= 0; i--) { lLower[lowerSize] = xSorted[i]; lowerSize++; while (lowerSize > 2 && !rightTurn(lLower[lowerSize - 3], lLower[lowerSize - 2], lLower[lowerSize - 1])) { lLower[lowerSize - 2] = lLower[lowerSize - 1]; lowerSize--; } } short[][] result = new short[upperSize + lowerSize - 1][2]; System.arraycopy(lUpper, 0, result, 0, upperSize); System.arraycopy(lLower, 0, result, upperSize, lowerSize - 1); return result; } /** * Checks if points turns right. * * @param a - the 'a' point. * @param b - the 'b' point. * @param c - the 'c' point. * @return */ private static boolean rightTurn(short[] a, short[] b, short[] c) { return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]) > 0; } (I ddnt made it as i remember but i cant find real author) What do you need to read to understand this algorithm: http://en.wikipedia.org/wiki/Convex_hull en.wikipedia.org/wiki/Graham_scan /** * Converting points to polygon. * * @param points - the - the points. * @return the polygon based on points. */ public static Polygon toPolygon(short[][] points) { Polygon result = new Polygon(); for (short[] point : points) { result.addPoint(point[0], point[1]); } return result; } How to implement : First we need to get screen coords: http://osbot.org/osbot2_api/org/osbot/rs07/api/util/GraphicUtilities.html#getScreenCoordinates%28org.osbot.rs07.Bot,%20int,%20int,%20int,%20org.osbot.rs07.api.model.Model%29 Then we make hull based on points: hull(screenCoordinates); Example for dumbs: Entity litara = npcs.closest("Litara"); short[][] screenCoordinates = Calculations.getScreenCoordinates(this, litara.getGridX(), litara.getGridY(), litara.getZ(), litara.getModel()); short[][] hull = Calculations.hull(screenCoordinates); g.draw(Calculations.toPolygon(hull));
    1 point
  27. Going best case scenario isn't what should be done. Just do 1 account running shrooms for 5 hours a day = 6 dollars and run like 3 times in 30 days and you make your money back x2 - 2 bonds, so you still profit in 3 proggies 1% chance of ban botting 6 hours 3 times a month. Yet you still are acting as you aren't making money. One time scripts make the market crash faster, and everything. You paying a small fee is worth it in the long run. More scripter updates and dedication to fixing it because if they don't people won't renew.
    1 point
  28. I take back part of my statement, because customers actually benefit from monthly payments considering the scriptwriter will be keeping the script itself fully functional. Meaning, since they have an incentive scriptwriters will be working extra hard to maintain their income and I have completely faith in them. Hopefully we'll make the Friday release since this will be a big step for OSBot.
    1 point
  29. Good looking thread. Thanks for supporting OSBot @Jordan .
    1 point
  30. You are not alone brother.
    1 point
  31. One, you missed the entire point of the thread, this isn't how to setup your frame work, or how you should write your script, it is purely showing scriptwriters who do not know how to use more than one class file, some insight how someone might go about doing it; because quite frankly, quite a few don't/didn't know how. Two, the super.onStart() was automatically added, and since this IS NOT A REAL SCRIPT, I left it, because once again, this is not showing you how to write a script, just how to use more than one class. Three, once again quite a few script writers do not know how to use more than a single class in thief script, so one of the Mods thought it would be a useful resource to those looking to learn. My personal opinion, get off your high fucking horse, and learn to communicate like a adult, and not a preteen ass 14 year old, who uses his moms credit card for everything. It would be a lot easier to get your point across.
    1 point
×
×
  • Create New...