Everything posted by Nezz
-
How to do an accurate loot tracker?
I think so, I have to test it still though. Because the action itself doesn't always work. There's no 100% accurate way to say "I picked this up." other than comparing inventories. Like I used to have a log saying "Picking up: " + item_name or whatever every time it went to pick up the item, it would print the log 3 or 4 times before it actually picked it up.
-
How to do an accurate loot tracker?
..this is completely unrelated to the thread m8. But I did, I pushed that update last night. What do you do with PricedLoot? I think you meant PriceItem? That makes more sense. haha Could you give an example on creating a PriceItem array? :x
-
How to do an accurate loot tracker?
I was thinking of having like..3 lists of items. 1. final list that you print. 2. current inv 3. new inv check current inv against new inv, if they're different add whatever is new to the loot list, curr inv = new inv But then I ran into things like what if they use food? what about stackable items? etc There's gotta be some easy way to do this that I'm not thinking of. hah
-
Methods to use potions
:x they don't? Every time someone tells me an ID doesn't change, I use it and find out that it changes. lol Though I have been using ID for noted pure ess on my rcer.
-
Methods to use potions
I never really knew the functionality difference between if else and switch cases were :x I think more of the focus in my snippet should be on the getPotName and getPotBonus, as that's what gave me the most trouble. with getPotName, you don't need to update ID's ;) and some people say if you wait until your pot runs all the way out, you lose out on xp, so I created the getPotBonus to figure out how much it gives you, and at what point to repot. I like your code though, so much neater than mine.
-
Methods to use potions
I wrote three methods to help use potions more dynamically. First is getPotName, which given something like "Super strength" or "Strength potion" will return the full name (includes the dosage on the end, essentially) Second is getPotBonus, which given something like "Super strength" or "Strength potion" will return the bonus you get from drinking the potion - based on your current stats. (Could easily add prayer or other skills to this, even make it dynamic with a Skill argument) public String getPotName(String pot_type){ Item temp = client.getInventory().getItemForNameThatContains(pot_type); if(temp != null){ return temp.getName(); } else{ return null; } } public int getPotBonus(String pot_type){ int str = client.getSkills().getLevel(Skill.STRENGTH); int att = client.getSkills().getLevel(Skill.ATTACK); int rang = client.getSkills().getLevel(Skill.RANGED); if(pot_type == "Super strength") return (5+(int)(str * .15)); else if(pot_type == "Strength potion") return (int)(str * .12); else if(pot_type == "Super attack") return (5 + (int)(att*.15)); else if(pot_type == "Attack potion") return ((int)(att*.12)); else if(pot_type == "Ranging potion") return ((int)(rang*.12)); else return 0; } Finally we have usePotion, which again, given something like "Super strength" or "Strength potion" will use the above two methods to determine *if* you need to use the potion, and if you do, it will. Potion use is based on 2/3 the amount of stat bonus you get from the potion. This last method can probably be refined a lot, but it worked for what I needed it to so this is as far as it got. public boolean usePotion(String potion_type) throws InterruptedException{ String potion_name = getPotName(potion_type); if(potion_name != null){ Item pot = client.getInventory().getItemForName(potion_name); int pot_bonus = getPotBonus(potion_type); if(pot != null){ //get current skill level if(potion_name.contains("ength")){ int skill_level = client.getSkills().getLevel(Skill.STRENGTH); int curr_skill_level = client.getSkills().getCurrentLevel(Skill.STRENGTH); int pot_at = (int)(pot_bonus*2/3); //once bonus str is at 2/3 if((curr_skill_level - skill_level) <= pot_at){ log("Using Strength Potion!"); client.getInventory().interactWithName(potion_name, "Drink"); return true; } } else if(potion_name.contains("ttack")){ int skill_level = client.getSkills().getLevel(Skill.ATTACK); int curr_skill_level = client.getSkills().getCurrentLevel(Skill.ATTACK); int pot_at = (int)(pot_bonus*2/3); //once bonus str is at 2/3 if((curr_skill_level - skill_level) <= pot_at){ log("Using Attack Potion!"); client.getInventory().interactWithName(potion_name, "Drink"); return true; } } else if(potion_name.contains("ang")){ int skill_level = client.getSkills().getLevel(Skill.RANGED); int curr_skill_level = client.getSkills().getCurrentLevel(Skill.RANGED); int pot_at = (int)(pot_bonus*2/3); //once bonus str is at 2/3 if((curr_skill_level - skill_level) <= pot_at){ log("Using Ranging Potion!"); client.getInventory().interactWithName(potion_name, "Drink"); return true; } } else{ log("Unknown potion type!"); } } else{ log("Couldn't find " + potion_type + " in your inventory!"); } } return false; }
-
Custom inventory interact method
/* * public boolean interactInv will return true/false whether it was capable of interacting with an inventory item given the specified interaction. */ public boolean interactInv(String itemName, String interact) throws InterruptedException{ //create an inventory variable for less typing. Inventory in = client.getInventory(); //check if inventory contains item if(in.contains(itemName)){ //create a mouse destination based off of a rectangle created around the slot of the item MouseDestination md = new RectangleDestination(in.getDestinationForSlot(in.getSlotForName(itemName))); //move the mouse over the slot if(!client.moveMouseTo(md, false, false, false)) return false; //create a list of the options available in the menu, cycle through them to find specified interaction List<Option> menu_option = client.getMenu(); int use = 999; for(Option opt : menu_option){ if(opt != null){ if(opt.action.compareToIgnoreCase(interact) == 0){ use = menu_option.indexOf(opt); break; } } } //if the option was the first in the list, left click it and return true. if(use == 0){ return client.moveMouseTo(md, false, true, false); } //if use != 999, it was found in the options list. if(use != 999){ //move mouse over the slot, right click it. (could be replaced with client.moveMouse(md,true)) if(!client.moveMouseTo(md, false, true, true)) return false; //create a new mouse destination based a new rectangle created over interact option of the menu md = new RectangleDestination(new Rectangle(client.getMenuX(), client.getMenuY() + 19 + use * 15, client.getMenuWidth(), 14)); //click the mouse return client.moveMouseTo(md, false, true, false); } else{ //the interact option wasn't found in the list, return false sleep(25); return false; } } else return false; } This can be adapted for NPC's, RS2Object's, items in a bank, etc. Any improvements/suggestions are appreciated.
-
FREE SCRIPTS TO ALL WHO SPAM PM LEVI IN THE CHAT BOX
http://prntscr.com/2ylbjz #rekt
- #Troll2014 Bring Back :Troll1:
- Weed is extremely dangerous!
-
My Weekend!
Nascar is boring. Except when shit crashes. I was half expecting you to say "Yeah, I met my idol! Then I stabbed the shit out of him. It was great!" But srsly glad you had fun m8
-
[Now Selling] Botting VPSs | $8/mo | Runs 3 or 4 bots | Custom deals on request
I vouch for this lovely person.
- Post your IRL pictures
-
SDN Scripter Name Color
...so is ten dollars. OSbot has made more than 10 dollars from my scripts.
-
SDN Scripter Name Color
Or make exceptions on how many days are required before applying.
-
SDN Scripter Name Color
Unless there's something I'm missing, I don't see the difference between removing just the pip and removing both pip and name color. Do they keep the SDN Scripter rank even after their scripts are removed? The only thing you're preventing is an easy way of recognizing scripters. I don't like that for someone to know I'm a scripter, they have to find a post of mine on the forums. (Or find a script of mine) If they request to have it removed, then take away the colored name and pip. Don't punish all of us just because there are a few bad people. That's the thing. I can't apply, I haven't been here long enough. Does that mean I shouldn't get recognized for having scripts on the SDN?
-
SDN Scripter Name Color
It's motivation for me, but I have to wait another like 15 days before I can apply for OSD. I just think it'd be nice to get a name color for being an SDN scripter. If they don't update their scripts when they break, take them off the SDN, take away their rank.
-
SDN Scripter Name Color
I mean, they already have the rank. They just don't have the name color. I don't see the difference. All it does is make you recognizable in chat that you've made a script (which could be beneficial to new scripters).
-
SDN Scripter Name Color
I think SDN Scripter's should have a color for their names.
- Log's Back!
-
SDN Script Price not as Stated
Hey guys, so I uploaded my new script on SDN Nezz's runecrafter and it's $8.99 however I requested $10, is there any reason for this? http://osbot.org/forum/store/product/283-nezzs-aio-runecrafter/ http://osbot.org/forum/topic/37122-nezzs-aio-runecrafter/ Thanks!
-
07 ACC, Original Owner, Barrows Pure, 99 Fletching!
What was the 1ban that happened?
-
EOC Account For Sale!
I bid 7,832,164 for this account.
-
Verify your paypal on osbot
Supported like a fed Leona.
-
OSBot Player Moderator List
I shiggy diggy. You have my support, m8