Jump to content

LoudPacks

Members
  • Posts

    926
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by LoudPacks

  1. I've had an influx of ~30 sales on my nature chest theiver so it looks to me that lots of people are.
  2. I feel out of the loop. What the fuck is going on lmao
  3. Main.java lets u add a TaskScript. In main you can add(new TaskOne()); In side of TaskOne you have isActive which makes that specific task active when it return true. It also contains the looped code for said task. With it, you can write several "Tasks" or scripts that can all be added to the queue and ran within the main.java. I usually separate different tasks within a single script into different taskscripts, but you could also use different taskscripts as different scripts. For example, TaskOne() onActive() returns true if if the bank contains less than 500 bows, and will cut logs into bows, TaskTwo() might return true if you have 500 + bows in the bank, and could be set to perform a different task, like begin alching the bows. In this case I guess you could say you have two different scripts all within the same script. One for fletching, one for alching. Main: public void onStart() { super.onStart(); Settings settings = new Settings(this); settings.setCallback(b -> { start = System.currentTimeMillis(); //addTask(new Task()); addTask(new EatTask()); addTask(new OpenBankTask()); addTask(new BankingTask()); addTask(new SpiritTreeTask()); addTask(new GrandTreeTask()); addTask(new LadderOneTask()); addTask(new DaeroTask()); addTask(new WaydarTask()); addTask(new LumboTask()); addTask(new WalkToDungTask()); addTask(new WalkToSpotTask()); addTask(new CombatTask()); }); } In this case, I have different tasks for different steps in my script. These could easily be replaced with completely unrelated tasks, allowing you to have multiple scripts in one. Example Task import lemons.api.tasks.templates.AbstractTask; public class Task extends AbstractTask { private final long startAmount; @Override public void onStart() { super.onStart(); } public void onTaskStart() { //setup code startAmount = getInventory().getAmount(995); } public void run() { //code is looped getInventory().interact(995, "Drop"); } @Override public void onTaskFinish() { } @Override public boolean isActive() { return (getInventory().contains(995)); } }
  4. Lem0n API does this, you could check it out cause its open source and built off of the regular OSBot API.
  5. Learning about phylogeny and the origin of photosynthesis. I also got a new rx for my contacts. I also moved into my dads new house.
  6. I got the son of mars and the retro 6 golden moments in white
  7. Its fucked unless your using a laptop you can only stream with chrome apps.
  8. Me too I feel like a total dunce now.
  9. It might be a virus im too scared to try it :
  10. Checks if your health is above x%: private boolean healthAbovePercent(double p) { boolean flag = false; double dynamicLvl = getSkills().getDynamic(Skill.HITPOINTS); double staticLvl = getSkills().getStatic(Skill.HITPOINTS); if (dynamicLvl >= staticLvl * p) { flag = true; } return flag; } Note: don't flame I like to post basic snippets to help beginning scripters. Being able to search for simple snippets makes it easier to learn at the beginning.
  11. I would suggest following the Tea Stall guide by Apaec in the scripting tutorial section.
  12. LOL have you read the API? Use interactions. Then you can do: int count = 0; if(getItems().closest("Dildo") != null && getItems().closest("Dildo").interact("Take"){ count++; log(count); //sleep }
  13. long salmonCount = getInventory().getAmount("Salmon"); long salmonCount = getBank().getAmount("Salmon");
  14. They put everyone's name into a hat and have several weekly drawings to determine who gets banned.
  15. why u do dis. Now the prices will really crash. There's a paid one on the SDN.... so you basically just screwed all of them. :salty:
  16. Yea these people are dumb lmao. I smoke more weed (dabs) than probably anyone who would wear that shit and the only weed clothing I have is a structural model of the THC molecule and you can't even tell what it is unless you know chemistry.
  17. what Will something like this suffice? monitorThread = new Thread(){ public void run() { inventoryMonitor = new InventoryMonitor(getScript()) { @Override public void onChange() { for (Item i : getChanges()) { if(i != null){ lootCount += i.getAmount(); lootValue += CheckPrice.get(i.getId()); } } } }; groundMonitor = new GroundMonitor(getScript(), Settings.lootThresh, Settings.zoneArea) { @Override public void onChange() { for (org.osbot.rs07.api.model.GroundItem i : getChanges()) { if(i != null){ log(i.getName() + " : " + CheckPrice.get(i.getId())); } } } }; while(!monitorThread.isInterrupted()){ if (inventoryMonitor != null && !getBank().isOpen() && inventoryMonitor.hasChanged()) { inventoryMonitor.onChange(); inventoryMonitor.update(); } if (groundMonitor != null && !getBank().isOpen() && groundMonitor.hasChanged()) { groundMonitor.onChange(); groundMonitor.update(); } } } }; monitorThread.start();
  18. Don't know if anyone will use but I needed something with this functionality and came up with this. Any feedback is appreciated, I'm always trying to learn new things. GroundMonitor.java: import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.script.Script; public abstract class GroundMonitor { //My implementation filters out items less than price x, but I removed because it was specific to my needs private ArrayList<GroundItem> cache = new ArrayList<GroundItem>(); private Script ctx; public GroundMonitorRelease(Script ctx, int valueThreshold) { updateContext(ctx); update(); } public void updateContext(Script ctx) { this.ctx = ctx; } public abstract void onChange(); public boolean hasChanged() { return getChanges().length > 0; } public void update() { for (GroundItem item : ctx.getGroundItems().getAll()) { if (item != null) { cache.add(item); } } } public GroundItem[] getChanges() { List<GroundItem> items = new ArrayList<GroundItem>(); ArrayList<GroundItem> ci = new ArrayList<GroundItem>(); int changes = 0; for(GroundItem q : ctx.getGroundItems().getAll()){ if(q != null){ items.add(q); } } for (GroundItem item : items) { if (item != null) { int id = item.getId(); if (!contains(ci, id) && !cached(item)) { ci.add(item); changes++; } } } Collections.sort(ci, new Comparator<GroundItem>(){ @Override public int compare(GroundItem o1, GroundItem o2) { int d0 = CheckPrice.get(o1.getId()); //Use distance instead of price int d1 = CheckPrice.get(o2.getId()); //Use distance instead of price return (d0 < d1 ? -1 : //It will return the closer one first (d0 == d1 ? 0 : 1)); } }); return Arrays.copyOf(ci.toArray(new GroundItem[ci.size()]), changes); } private boolean cached(GroundItem item){ return cache.contains(item); } private boolean contains(ArrayList<GroundItem> list, int id) { for (GroundItem i : list) { if (i == null) continue; if (i.getId() == id) { return true; } } return false; } } Main.java (onStart): groundMonitor = new GroundMonitor(getScript()) { @Override public void onChange() { for (GroundItem i : getChanges()) { if(i != null){ log(i.getName() + " : " + CheckPrice.get(i.getId())); } } } }; Main.java (onPaint): if (groundMonitor != null && groundMonitor.hasChanged()) { groundMonitor.onChange(); groundMonitor.update(); }
  19. Lets not point any fingers lol I still learn new things all the time, I just think it should be more difficult to attain SII.
  20. There's hella and personally I think the 5 question test should be switched to a 15 question test requiring a score of 85% or higher and to be done in real time over skype.
  21. Okay so I came up with this. Now it will try and walk. How do I go about handling the rockfall when its in front of the player? if(!inZone()){ LocalPathFinder path = new LocalPathFinder(getBot()); LinkedList<Position> generatedPath = path.findPath(getRandomZone().zone.getRandomPosition(), generateModifiedClippingData()); getLocalWalker().walking.walkPath(generatedPath); } In getting the clipping data I also get a List<RS2Object> of all the rockfalls. Should I just iterate through that list and "mine" the closest one? Is there a better way of doing this?
  22. Can u explain the second part in a little more detail? Do you mean save all tiles where rocks spawn?
×
×
  • Create New...