Everything posted by Botre
-
Music for programming?
I really prefer silence myself however sometimes I like to listen to rain sound effects. Music distracts me way too much :p
-
(Snippet) [Entitype] How to collect a list of any Entity sub-class type
Allows you to group multiple entity types in one list which may or may not allow for more efficient overall traversal cost / filtering. Allows you to access sub-list of RS2Object sub-types such as Wall Decoration, which may allow for more efficient filtering. Examples: List<Entity> wallRelated = Entitype.collect(this, Entitype.OBJECT_WALL_DECORATION, Entitype.OBJECT_WALL_OBJECT); List<Entity> playersAndGroundItems = Entitype.collect(this, Entitype.PLAYER, Entitype.GROUND_ITEM); List<Entity> all = Entitype.collect(this, Entitype.ALL); List<Entity> entities = Entitype.collect(ctx, Entitype.OBJECT_ALL, Entitype.NPC, Entitype.GROUND_ITEM); if(!entities.isEmpty()) { Entity target = entities.get(random.nextInt(entities.size())); target.examine(); } Snippet: import java.util.ArrayList; import java.util.List; import java.util.stream.IntStream; import org.osbot.rs07.api.model.Character; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.GroundDecoration; import org.osbot.rs07.api.model.InteractableObject; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.model.WallDecoration; import org.osbot.rs07.api.model.WallObject; import org.osbot.rs07.script.MethodProvider; public class Entitype { public static final int OBJECT_GROUND_DECORATION = 0; public static final int OBJECT_INTERACTABLE_OBJECT = 1; public static final int OBJECT_WALL_DECORATION = 2; public static final int OBJECT_WALL_OBJECT = 3; public static final int OBJECT_ALL = 4; public static final int CHARACTER = 5; public static final int NPC = 6; public static final int PLAYER = 7; public static final int GROUND_ITEM = 8; public static final int ALL = 9; public static List<Entity> collect(MethodProvider ctx, int... types) { List<Entity> result = new ArrayList<>(); List<Entity> objectsGroundDecoration = new ArrayList<>(); List<Entity> objectsInteractableObject = new ArrayList<>(); List<Entity> objectsWallDecoration = new ArrayList<>(); List<Entity> objectsWallObject = new ArrayList<>(); if(IntStream.of(types).anyMatch(x -> x < OBJECT_ALL)) { for (RS2Object o : ctx.getObjects().getAll()) { Class<?> clazz = o.getClass(); if(clazz.equals(GroundDecoration.class)) { objectsGroundDecoration.add(o); } else if(clazz.equals(InteractableObject.class)) { objectsInteractableObject.add(o); } else if(clazz.equals(WallDecoration.class)) { objectsWallDecoration.add(o); } else if(clazz.equals(WallObject.class)) { objectsWallObject.add(o); } } } for (int type : types) { switch (type) { case ALL: List<Entity> all = new ArrayList<>(); all.addAll(ctx.getObjects().getAll()); all.addAll(ctx.getNpcs().getAll()); all.addAll(ctx.getPlayers().getAll()); result.addAll(all); break; case OBJECT_ALL: result.addAll(ctx.getObjects().getAll()); break; case OBJECT_GROUND_DECORATION: result.addAll(objectsGroundDecoration); break; case OBJECT_INTERACTABLE_OBJECT: result.addAll(objectsInteractableObject); break; case OBJECT_WALL_DECORATION: result.addAll(objectsWallDecoration); break; case OBJECT_WALL_OBJECT: result.addAll(objectsWallObject); break; case CHARACTER: List<Character<?>> characters = new ArrayList<>(); characters.addAll(ctx.getNpcs().getAll()); characters.addAll(ctx.getPlayers().getAll()); result.addAll(characters); break; case NPC: result.addAll(ctx.getNpcs().getAll()); break; case PLAYER: result.addAll(ctx.getPlayers().getAll()); break; case GROUND_ITEM: result.addAll(ctx.getGroundItems().getAll()); break; } } return result; } }
- :mald:
-
Hi I'm bored.
- [Question] WalkingEvent timeout
- [Question] WalkingEvent timeout
Is there a cleaner way than the following snippet to set the timeout of a WalkingEvent? While we're at it, what is the default timeout for a WalkingEvent? (walkingTimer is a timer class) walkingTimer.reset(); WalkingEvent walkingEvent = new WalkingEvent(voidKnightArea); walkingEvent.setBreakCondition(new Condition() { @Override public boolean evaluate() { return walkingTimer.getElapsedSeconds() > 10; } }); execute(walkingEvent); Cheerseroni- :doge: uppcases
public void EatShark() { Item shark = getInventory().getItem("Shark") if(shark != null) shark.interact("Eat"); World.killPuppy(); }- Uh huh this my shit
- Introduce me to anime
The only anime series I have ever watched completely is Death Note, the only anime movies I have seen are the Miyazaki ones. I prefer plot over action but that doesn't mean I'm unable to appreciate me some stylized action. Following a 12 year old boy going on an adventure for 700 episodes isn't my thing. Over-the top cute stuff and borderline-hentai is out of the question. Introduce me to some good anime pls.- Looking for a web master / designer collaborator
Looking for someone to work on / brainstorm about project of mine. Your skill set must include: - HTML5 - CSS - JavaScript or JSP - MySQL or any other RDBMS PM me your portfolio. I will never expect you to work for free- pc acc
- Your preferred web hosting provider?
What's your preferred web hosting provider and why? Looking for a cheap way to host a personal website, would preferably want to avoid a 4$/month charge :p Thanks!- LOOOL best thing i've heard today
Bre 2 point 2 thousand silver bars, ded- How do i make my script STOP and not just stop moving
- We made it
- We made it
Feedback means nothing, I would trust you over most people with 200+ feedback. ....- Trying to Understand Show/Hide Paint
You need a rectangle, a boolean and a mouse listener. Rectangle: https://docs.oracle.com/javase/7/docs/api/java/awt/Rectangle.html Has a contains(Point point) method MouseListener: https://docs.oracle.com/javase/7/docs/api/java/awt/event/MouseListener.html mouseClicked(MouseEvent e) MouseEvent has a method called getPoint() To register a MouseListener in OSBot: getBot().addMouseListener(MouseListener m) Create a rectangle Create a boolean Add a new MouseListener to the client When the mouse is clicked, grab the MouseEvent's point and check if the rectangle contains it, if so -> invert the boolean- Legal action from making scripts
I'm sure I hope bot owners learned from iBot's mistakes.- Yet another IPTorrent invite giveaway!
Free stuff. Hi- Question for scripters: what components do you use in your paints
Snake'd wp- Question for scripters: what components do you use in your paints
I would like my paint maker to cover all your wishes and desires, what I currently have on my list: Static: Text Rectangle Rounded Rectangle Ellipse Image Dynamic: Text Image(s) / animation Progress bar Shoot!- Microsoft will allow Xbox gamers to play against PS4 and PC players
Gl doing this with your controller I'm curious how they are going to balance the whole control-thingie though since controller aiming tends to be much more assisted than mouse aiming.- 99 fletching f2p pure
- Hello OSBot!
- Why get a degree in CS?
Couldn't agree more. Yes you learn a lot of foundations and a broad skill set, an a lot of it may not seem relevant to the market you're aiming for (yet). However, and I'm speaking as someone with no degree in CS and a couple of job interviews in the sector behind me, you will get quizzed on those foundations because even though your position might not require direct knowledge of them, you'll be expected to able to work fluently with people that do. EVERY SINGLE job interview I went to, every single one of them, I ended up adding something new to my "to-learn" list, now I'm not saying all of those additions would have been covered by a CS degree but a lot of them would've, 50% easily. In order to be employable, knowing one language will rarely suffice, you'll be expected how databases work, how networking works, etc... (this on top of all the enterprise frameworks and APIs). I'm not saying you can't all learn these yourself, but do not underestimate the learning package. - [Question] WalkingEvent timeout
Account
Navigation
Search
Configure browser push notifications
Chrome (Android)
- Tap the lock icon next to the address bar.
- Tap Permissions → Notifications.
- Adjust your preference.
Chrome (Desktop)
- Click the padlock icon in the address bar.
- Select Site settings.
- Find Notifications and adjust your preference.
Safari (iOS 16.4+)
- Ensure the site is installed via Add to Home Screen.
- Open Settings App → Notifications.
- Find your app name and adjust your preference.
Safari (macOS)
- Go to Safari → Preferences.
- Click the Websites tab.
- Select Notifications in the sidebar.
- Find this website and adjust your preference.
Edge (Android)
- Tap the lock icon next to the address bar.
- Tap Permissions.
- Find Notifications and adjust your preference.
Edge (Desktop)
- Click the padlock icon in the address bar.
- Click Permissions for this site.
- Find Notifications and adjust your preference.
Firefox (Android)
- Go to Settings → Site permissions.
- Tap Notifications.
- Find this site in the list and adjust your preference.
Firefox (Desktop)
- Open Firefox Settings.
- Search for Notifications.
- Find this site in the list and adjust your preference.