Jump to content

venetox

Members
  • Posts

    110
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by venetox

  1. I don't see any need for a change. It took me 4 days to get my git account, meanwhile I spent time increasing my knowledge of the API and refactoring my scripts to make their code better. I took 8 days to get my first script to be accepted and like another 1 of 2 before it was on SDN. It would have probably been 4 days for script too, but I had to fix errors and had an incorrect folder in my Git. I don't see a problem with that wait time. If you have scripts you want to put out now, put them in Local Scripts, upload them to google drive, then when they get accepted, get Report the thread and ask for it to be moved to the SDN script forum. Even for people that have to wait longer for Git and SDN acceptance for their scripts. It is a process that takes time because it's a process that involves needing people with an incredible amount of experience with the API etc to be able to vett scripts well. I understand your reasoning, and understand why you would want this, however I simply don't think there is a need for it.
  2. That was fixed a few days ago. webWalking has been working correctly for quite a few days now (at least for most)
  3. I have to go out soon, but when I get back I will try and post some good info. A good pointer for now, is just keep making scripts, it will take a couple but you should pick it all up pretty quick if you already have some experience.
  4. i see everyones cashing in on their daily post bucks
  5. Its in arm2's signature. Its the flash player. Probably autoplays for you holy shit i remember the limewire memories.
  6. "We had a few technical issues with Mod Weath last week as he was out of the office."
  7. venetox

    pick ya fav

    2 but if it was the size of 1
  8. Yeah that's real nice, I focused on writing it out fully so I could explain the logic, although I didn't know to even do any of that. Still got a lot of learning about java functions. Very nice.
  9. If you mean you want to find the closest rock crab to your player. Entity rockCrab = getNpcs().closest("Rock crab"); if(rockCrab != null) { getWalking().webWalk(rockCrab.getPosition(); } If you want to find the closest position from a list of positions and do anything with it. Change positions to the list of positions you already have. closestPosition is the end result and will be the closestPosition out of all of them. Later on down the track, learn about lambda expressions, there should be a much nicer and shorter bit of code you could create using lambdas. ArrayList<Position> positions = new ArrayList<Position>(); // The list of positions Position closestPosition = null; // The closest positon for(Position p : positions) // Loop through the list of positions { if(closestPosition == null) // If closestPosition hasnt been set it, set it to the current position selected by loop closestPosition = p; else if(getMap().distance(p) < getMap().distance(closestPosition)) // Else if the current loops position is closer then closestPosition, set closestPosition to this one. closestPosition = p; } } Or as Explv said, You could simply input the array into webWalk and it would walk to the closest.
  10. Gratz on release, looks good and good luck on future version! No, they both return the exact same thing, some scripts just prefer different styles. Well creationx did ask how to get closest NPC in his post.
  11. Hi, I will keep this thread updated with snippets of code I find useful. If the code is not mine I will tag/link/name creator. /** * Moves the item found by itemName to the tab defined by tabNumber in the bank. * @param itemName The String itemName of the item. * @param tabNumber The tab number starting from 0, 0 is the global tab, 1 is the first tab etc. * @return Returns true if success, false if failed at any point. */ public boolean moveItemToTab(String itemName, int tabNumber) { RS2Widget tabWidget = getWidgets().get(12, 10, tabNumber); // Here we get the widget that refers to the tab we want to send it to inside the bank. Item item = getBank().getItem(itemName); // Here we get the instance of the item we want to move. (Item must be in bank) if(tabWidget != null && item != null) { Rectangle tabClickRectangle = tabWidget.getBounds(); // Here we get the bounding box for the widget (spot we must click) RectangleDestination tabDestination = new RectangleDestination(bot, tabClickRectangle); // Here we make that bounding box into a destination the mouse can use item.hover(); // Here we move the mouse to the item we want to move. Rectangle currentPos = new Rectangle((int) getMouse().getPosition().getX(), (int) getMouse().getPosition().getY(), 1, 1); // Here we get the mouses current position after moving to the item. RectangleDestination currentDestination = new RectangleDestination(bot, currentPos); // Create destination for the current position. return getMouse().continualClick(currentDestination, new Condition() { // Here we move from the current positon, to the tab's destination. public boolean evaluate() { getMouse().move(tabDestination, true); return tabClickRectangle.getBounds().contains(getMouse().getPosition()); } }); } else return false; }
  12. If you can make the claim its devaluing your house/property you should be able to have them be forced to make it double sided kinda thing. Contact council etc, first contact them though if you haven't already, I'm sure they wouldn't be nasty about it, and if they are, straight to the council.
  13. Double, double, toil, and trouble
  14. Some say his fiance is still logged into his paypal to this day.
  15. Lol, I instinctively tried to close the OSBot ad in your screenshot. Great tutorial, this will definitely help newbies. Also, quick note, You don't actually need to move all the code in JFrame class, instead, rename the JFrame.java and all relevant references to its name as a class to for example SettingsGUI then create an instance of the SetttingsGUI in your Main.java private SettingsGUI gui; public void onStart() { gui = new SettingsGUI(); gui.setVisible(true); } That is how I do settings gui's in my scripts, if you want to do stuff on clicking buttons etc, you would also want to pass your SettingsGUI the current script. This is how my SettingsGUI.java is in my HGuildMiner for example (created by window builder) package com.harleydaun.osrs.hguildminer.core; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.JButton; import javax.swing.JCheckBox; /** * The gui to change settings, created by Eclipse WindowBuilder */ public class SettingsGUI extends JFrame { private static final long serialVersionUID = 1100271528597140602L; private JPanel contentPane; private Main theScript; /** * Create the frame. */ public SettingsGUI(Main main) { theScript = main; setTitle(theScript.getName() + " " + theScript.getVersion() + " by " + theScript.getAuthor()); setBounds(100, 100, 170, 109); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JCheckBox chckbxMineMithril = new JCheckBox("Mine Mithril"); chckbxMineMithril.setBounds(25, 7, 97, 23); contentPane.add(chckbxMineMithril); JButton btnStart = new JButton("Start"); btnStart.addActionListener(e -> { theScript.selectedMineArea = Locations.AREA_MINING_GUILD; theScript.selectedMinePos = Locations.POS_MINING_GUILD; theScript.selectedBankArea = Locations.AREA_FALADOR_EAST_BANK; theScript.selectedMineString = "MG"; theScript.mineMithril = chckbxMineMithril.isSelected(); theScript.mineCoal = true; theScript.startScript(); }); btnStart.setBounds(25, 37, 99, 23); contentPane.add(btnStart); } } Then in my Main.java I have private SettingsGUI gui; // Instance of the GUI. public void onStart() { gui = new SettingsGUI(this); //various checks to see if to show the gui yet .. .. gui.setVisible(true); }
  16. When I get back from work I'll try help you out regarding this, I already have a good Tin Powerminer in my Iron Mine script (levels you to 15), So I'll pull that out and make sure its commented nicely and go through the logic. Ill be back at 5pm NZST (2 and a half hours) Edit: Nvm, You have it fixed. If you ever need any help on anything specific, PM me I'm always happy to help with this stuff.
  17. I'll post some info when I get back from work. Although I've never had any trouble from Windows 10 and have never had to do anything to make my Windows 10 installs nice, it might be to do with being on a laptop. Knowing laptops its probably full of bloatware. iirc decrap.org has a good program that removes anything that isn't a default windows program. If you do choose to go for installing a different OS, go for Windows 7 and nothing else. Windows 8/8.1 are absolute trash imo, 8.1 is not as bad and is kinda ok, but in comparison to Windows 10 its in the trash can. Windows 7 is always a solid OS, but I still think Windows 10 is leagues ahead, mostly because I end out actually using alot of the Windows 10 features on a daily basis. This is all opinion, some people hate or love some of these mentioned OS's, just try stuff and find what works best for you. Its practically impossible to brick a computer by changing OS so just keep changing till you find something you like.
  18. Yes, WebWalking is currently broken. Will have to wait for a Dev to update OSBot sadly. I think only workaround for now is to use paths rather than WebWalker, although I haven't tested that.
  19. The code I use is similar to @@Th3's, I will try to comment and explain it as best as possible. public boolean moveItemInSlot(int startSlot, final int endSlot) throws InterruptedException { if (getInventory().isItemSelected()) { // If we currently have something selected, unselect it, since we can't move items if we have something selected getInventory().deselectItem(); } return getMouse().continualClick(getInventory().getMouseDestination(startSlot), new Condition() { @ Override // Remove space here, forum likes to tag Ovveride public boolean evaluate() { getMouse().move(getInventory().getMouseDestination(endSlot), true); return getInventory().getMouseDestination(endSlot).getBoundingBox().contains(getMouse().getPosition()); } }); } So this is what it does. getMouse() Gets the instance of your mouse. getInventory().getMouseDestination(startSlot) returns the position the mouse should click to be clicking he slot you want to move from. continualClick() Moves the mouse to the specified destination (position of startSlot) and performs a left click for as long as the condition evaluates to false new Condition() creates the condition the continualClick will evaluate and until it returns true. inside evaluate() getMouse() Gets the instance of your mouse again. getInventory().getMouseDestination(slot2) gets the position the mouse should move to in order to be on endSlot move() is then used to move the mouse to endSlot getInventory().getMouseDestination(endSlot).getBoundingBox().conains(getMouse().getPosition()) is then used to check if the mouse is inside the endSlot's bounding box, if it is, then evaluate will return true and the mouse will let go of the left click and its all done, if not it will keep moving to the end slot until it is inside the bounding box. Hope this helps explain it a bit. Its a bit hard to explain, but it is fairly simple once you pull it all apart.
  20. ikr, was going through dispute archives earlier... UTTER GOLD, that shiet had me in tears
  21. I think the problem is the way your handling your cases. I ran into similar problems when I first started doing state based scripts. I would say you have problems elsewhere in your code as well as here. The first thing you should do when making a script imo, is layout the logic that you want the script to follow. In this case it would be like this getAction // First check if the inventory is full IF Inventory Is Full IF PowerMine // If it is and we are supposed to powermine, drop our items return DROP ELSE // If it is and we are not supposed to powermine, go to bank and bank our items. return BANK ENDIF ENDIF // Now check if we are inside the place to cut trees IF CAMELOT_TREES contains myPlayer or EDGEVILLE_TREES contains myPlayer // If we are in one of the places we should cut trees, cut them. return CHOP_TREE else // Otherwise, walk to one of the places we should cut trees return WALK_TO_TREES You should not be checking if the tree is null in your getAction logic, and you should not be checking if you are inside a bank in your walk logic. you should be checking if the tree is null in your Chop logic, and in your walk logic should be checking if you are inside the are you want to chop trees. I just whipped this up with comments to explain how I would go about it. http://pastebin.com/tMJTCQNA Main.java http://pastebin.com/z78vRNJ0 Action.java Haven't tested it since I don't have any bot accounts that can cut yews but I don't see any reason for it to not work.
×
×
  • Create New...