Everything posted by TheScrub
-
Banking with names!
thats the parameter for people to understand ik what u mean should be item_name no caps i have String s in my parameter's i renamed it for people to understand
-
Reading Script Settings/Presets
Accredit me if you use it please i release these out of my own time! this will return the data type of an ArrayList<String> from the text file we could do this for an int or pretty much any other type of object public ArrayList<String> readConfigSettings(String Path, int LineLimt) throws Throwable { BufferedReader br = new BufferedReader(new FileReader(new File(Path))); ArrayList<String> lines = new ArrayList<String>(); for (int i = 0; i < LineLimt; i++) { lines.add(i, br.readLine().toString()); } br.close(); return lines; } in use... using the file we produced using my other snippet on writing script settings.. ArrayList<String> settings = readConfigSettings((System.getProperty("user.home")+ File.separator + "OSBot" + File.separator + "data"+ File.separator + "settings.txt"),3); String option_one = settings.get(0); // the array starts at 0 String option_two = settings.get(1); int option_three = Integer.parseInt(settings.get(2));
-
Writting Files for Script Settings
Hey if you use this method and release the script leave an accreditation i release these snippets for the community... first we need to create a void like soo with a file name and the settings you want to it to save to an ".txt" file public void writeConfigSettings(String FileName,String... settings) throws IOException { Constructing the file writer and the exact name,location of the file // thanks to lackofchesee from TS3 for the path name! FileWriter f = new FileWriter(System.getProperty("user.home") + File.separator + "OSBot" + File.separator + "data" + File.separator + FileName +".txt"); // writing to an exact path to the osbot data folder also constructing a FileWriter Running the settings though a for loop to get a single setting then writing it to the file and spacing it on a line below this will be needed to read the text in my reading settings file for (String setting : settings) { // running though the strings f.write(setting + System.getProperty("line.separator")); } just closing the FileWriter stream of output f.close(); // closing the stream } public void writeConfigSettings(String FileName,String... settings) throws IOException { // thanks to lackofchesee from TS3 for the path name! FileWriter f = new FileWriter(System.getProperty("user.home") + File.separator + "OSBot" + File.separator + "data" + File.separator + FileName+".txt"); // writing to an exact path for (String setting : settings) { // running though the strings f.write(setting + System.getProperty("line.separator")); } f.close(); // closing the stream } in use String selected_herbs[] ={"Ranarr","Guam"}; writeConfigSettings("Settings",selected_herbs); this will save a .txt file in the data folder that will look like this called "Settings" Ranarr Guam
-
Get Time
havet tested in the morning public String getTime(){ Date d = new Date(); int Hour = d.getHours(); int Min= d. getMinutes(); String realMin= null; String realHour = null; String aSide = null; if (Min <10){ realMin="0"+Min; } if (Hour >12){ aSide="PM"; int i = d.getHours()-12; realHour = ""+i; } if (Hour <12){ aSide="AM"; } if (Min >9){ realMin = ""+Min; } String time =realHour+":"+realMin+" "+aSide; return time; //unfinished }
-
Screen Shot
Was bored soo w/ee Ideas on how to use Have a area on your paint and call the method if a mouse action. Display the image instead of writing on a jframe or jpanel etc. many more ways! public void takePicture() throws AWTException { Robot r = new Robot(); BufferedImage screenShot = r.createScreenCapture(new Rectangle( Toolkit.getDefaultToolkit().getScreenSize())); Date d = new Date(); int currentHour = d.getHours(); // deprecated methods i don't know the new ones int currentMin = d.getMinutes(); // same as the Hour String format = null; if (currentHour >11){ format="PM"; } if (currentHour <12){ format="AM"; } try { ImageIO.write(screenShot, "JPG", new File("Script_Name"+currentHour+"_"+currentMin+format+".jpg")); } catch (IOException e) { e.printStackTrace(); } }
-
NxBankFinder
Thanks for the acknowledgement on page 1!
-
Dreamliner's Trading Assistant
java.lang.NullPointerException at DreamTrader.getPrice(DreamTrader.java:270) at DreamTrader.onLoop(DreamTrader.java:122) at org.osbot.lA.run(kh:53) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) item was fally tabs
-
Withdrawing Items Using Names
http://osbot.org/forum/topic/11091-banking-with-names/
-
Client Solving Random Error (New One)
When solving the security book random where you get the book it try's to drop it and if your in an area where you can't drop it it will keep trying. Areas Include: Player Owned House (POH) // 2 add more
-
[Snippet] Actions & Doors
Purple representing the snippet section yer!
-
Banking with names!
Np mr Neal Caffrey picture guy!
-
Banking with names!
yer u better you sheeeeeet cunt!
-
Banking with names!
just something i wrote This will be able to return the id of the item name inside your bank With this snippet you will need to check if the bank is open With this snippet you must keep the anotation Wrote more around the core so it will return an int public int bankItemIdByName(String Item_Name){ Item items[] = client.getBank().getItems(); int item_id = 0; for (Item single_item : items) { if (single_item.getName().equals(Item_Name)) { item_id = single_item.getId(); return item_id; } } return item_id; } /* * This will return the id of the item by name * This was written by "TheScrub" * John of * Adelaide South Australia */ /*Example use of the method provided above*/ client.getBank().withdraw1(bankItemIdByName("Salmon"));
-
Centroid Class
Worth my time making a centroid class idk if it is discuss!!
-
Java glossary for dummies x
protected,private,public,Integer,Long,Double,Float some words that will need explation to begginers!
-
My first script!
make an simple power miner then move onto adding banking then u can take them skills and move else where if you need any help don't affaird to ask
-
Centre Position of an rectenangle area
simple will round down if max-min = a odd number just wrote it for the community to learn i have no use for it at all place this in your script obviously! public Position centreTile(Area Area, int Z) { int minY = Area.getMinY(); // just grabing data int maxY = Area.getMaxY(); int minX = Area.getMinX(); int maxX = Area.getMaxX(); int centreGapY = (maxY - minY) / 2; //works out the gap between the two int centreGapX = (maxX - minX) / 2; int Y = minY+centreGapY; // u add the min as u figured out the gap int X = minX+centreGapX; Position centre = new Position(X, Y, Z); return centre; }
-
Marijuana: Legal or illegal.
Well it should be illegal and just tax the fuck out of it. if people want it who care's if it's not you or affecting you in any-way shape or form!
-
How to use an item or cast a spell
if you need anymore help i'm on the osbot ts3 alil bit usually after school if you need anymore help!
-
How to use an item or cast a spell
well you will need to write your own method to interact with equipment inside the tab lucky for you i had the exact same problem so i wrote a little method to interact with a ring item in the equipment tab! which i will link below http://osbot.org/forum/topic/7274-interacting-with-equipment/ you will put this method inside your script then you will call it as such interactWithEquipment("STRING",DUEL_RING INT); as duel rings have many charges and all have separate int's you will need to do a for loop but i have that in my booleans so i don't worry about that so i use this method to get the id of the ring int i = equipmentTab.getItemInSlot(EquipmentSlot.RING).getId(); so you will need a boolean's something that looks like this private boolean hasRingOfDuelingEquiped() { for (int i : rods) { if ((equipmentTab.isWearingItem(EquipmentSlot.RING, i))) { return true; } } return false; } Rods is an variable i have set private final int rods[] = { 2552, 2554, 2556, 2558, 2560, 2562, 2564, 2566 }; private boolean inventoryHasRing() { for (int i : rods) { if (client.getInventory().contains(i)) { return true; } } return false; } once you have completed this phase you will need another boolean to check if the interface of the duel ring is open and if so you will need to interact with it sorry i can't spoon fed you anymore of my work hope this helps you!
-
Timers(Help)
have you created an onPaint void???
-
Basic Inventory Painting (For Begginers)
the first one is for example i have my own teletab script and i like to think outside the box and instead of having some paint i draw how many tabs i've made on the object
-
Basic Inventory Painting (For Begginers)
Every wondered how to get this effect it's simple in a few easy steps! this doesn't show the item id but it shows a string or an int for example this shows how many tabs I've made just to be creative! first we will need to get the inventory slot of the item we will be painting int i = client.getInventory().getSlotForId(ITEM); next we will return the rectangle around it Rectangle r = client.getInventory().getDestinationForSlot(i); next seeming we can't just draw r we need to get the values also keeping in mind they return as doubles and we need to Round them if you round a double you return a long so we need to cast it as an int we will do this for X,Y,Width and Height int recX = (int) Math.round(r.getX()); int recY = (int) Math.round(r.getY()); int recWidth = (int) Math.round(r.getWidth()); int recHeight = (int) Math.round(r.getHeight()); once we have this we can draw your rectangle!!! arg0 for me is set to g g.drawRect(recX, recY, recWidth, recHeight); if we want to take this a step further and draw an int or something next to the item inside the box we need to get the middle of the rectangle so we need to get the height and add the Y and then get the x and add the Width but we need to div the height and width by 2 to get the middle int recMidX = Math.round(recX + recWidth / 2); int recMidY = Math.round(recY + recHeight / 2); and there we go we can now draw it! g.drawString("123", recMidX, recMidY); now all together int i = client.getInventory().getSlotForId(ITEM); Rectangle r = client.getInventory().getDestinationForSlot(i); int recX = (int) Math.round(r.getX()); int recY = (int) Math.round(r.getY()); int recWidth = (int) Math.round(r.getWidth()); int recHeight = (int) Math.round(r.getHeight()); int recMidX = Math.round(recX + recWidth / 2); int recMidY = Math.round(recY + recHeight / 2); g.drawRect(recX, recY, recWidth, recHeight); g.drawString("123", recMidX, recMidY); Hope this helps people! if we want to do this same effect but show item ids we can do this simply by taking the code we have and just making some adjustments!! first we will need to get all the Inventory Items Item[] items = client.getInventory().getItems(); next this is an array of items so to use this in the next section we will just need to put it in an for loop like so for (Item singluarItem:items){ now we need to use the singluarItem to grab the id's of items int jj= singluarItem.getId(); and the rest is the same as before but just adding what we just did so all together it will look like this we need to remember we didn't take into en-count the items that are not there so u will need to keep the items in the inventory lumped at the beginning for this to work i would not suggest using this for anything other than debugging as it is a very a simple and crude method Item[] items = client.getInventory().getItems(); for (Item singluarItem:items){ int jj= singluarItem.getId(); int i = client.getInventory().getSlotForId(jj); Rectangle r = client.getInventory().getDestinationForSlot(i); int recX = (int) Math.round(r.getX()); int recY = (int) Math.round(r.getY()); int recWidth = (int) Math.round(r.getWidth()); int recHeight = (int) Math.round(r.getHeight()); int recMidX = Math.round(recX + recWidth / 2); int recMidY = Math.round(recY + recHeight / 2); g.drawRect(recX, recY, recWidth, recHeight); g.drawString(""+jj, recMidX, recMidY); } Expanded this for item id debugging hope this helps!!
-
Interacting with Equipment
it's alil hardcoded as fuck but meh hope this help was using this for ring of dueling you will need to change the child to the interface you desire and the equipment slot public void interactWithEquipment(String action, int i) throws InterruptedException { RS2InterfaceChild j = this.client.getInterface(387).getChild(22); long t = System.currentTimeMillis(); if ((equipmentTab.isWearingItem(EquipmentSlot.RING, i))) { equipmentTab.open(); while (!(equipmentTab.open()&& (System.currentTimeMillis() - t) < 7000)) { sleep(50); } if (equipmentTab.open()) { j.interact(action); sleep(2000); } } }
-
Hobbies (not gaming)
Listening to music, Making my own Furniture (Wood_Working) , Working on cars