Jump to content

TheScrub

Members
  • Posts

    1130
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by TheScrub

  1. 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
  2. Purple representing the snippet section yer!
  3. Np mr Neal Caffrey picture guy!
  4. yer u better you sheeeeeet cunt!
  5. 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"));
  6. protected,private,public,Integer,Long,Double,Float some words that will need explation to begginers!
  7. TheScrub

    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
  8. 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; }
  9. if you need anymore help i'm on the osbot ts3 alil bit usually after school if you need anymore help!
  10. 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!
  11. have you created an onPaint void???
  12. 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
  13. 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!!
  14. 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); } } }
×
×
  • Create New...