Jump to content

roguehippo

Members
  • Posts

    157
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by roguehippo

  1. i basically just need to know how to return a true if there are no "Logs" (or whatever item) in a given area. or if it would be easier if there are just no grounditems in an area at all, but this may cause future problems.
  2. i dont quite understand what you mean by passing around a reference to the script class. how would i reference it? and are you talking about my main class?
  3. Basically, what the title says. I was wondering how i am supposed to get live data like myPlayer().getPosition from a different class than main like from a gui. thanks
  4. Im posting here just so anyone else that has this problem can hopefully find the answer. After looking on many forums i found out the problem was actually due to an import mistake. i accidently imported like java.awt.List instead of java.util.List. -___-
  5. i guess something else is wrong because im still getting null pointers when i do anything with the grounditem
  6. thanks so much for getting back to me i didnt know that initializing it in this specific way was necesarry or even made a difference. is it easy to explain why this makes a difference? (i just want to make my future coding as good as possible)
  7. here is the code for my gui. http://pastebin.com/HUNyAuFY the adding of the strings when the loot button is pressed is at line 281. here is my main code. http://pastebin.com/HsuELXZi the looting functions are at the bottom thanks
  8. Hello forums, just a note before i start, i try to look up the answers for my questions on google before i come here to ask, and ive been trying for hours to get this to work to no avial. anyways, i have an arrayList of strings for a loot list (or atleast i think i do, every time i try to log the contents i just get a null pointer). anyways. im trying to turn the arraylist into an array so i can use it to find the closest ground item. here is my current function to determine if i should loot a stackable item. http://pastebin.com/rgxNpPbf the arraylist is transfered from an arraylist from the gui using this.(which is called in onStart() ) if(gui.UseLooting) { log("setting looting shit"); UseLooting = true; LootListStackable = gui.StackableLootList; LootListNotStackable = gui.NonStackableLootList; log("DISPLAYING LISTS"); // log(gui.StackableLootList.size()); //log(LootListStackable.size()); commented out because they both caused null pointers } the arraylists are declared in the gui like so public ArrayList<String> StackableLootList; and contents are added to the list in the gui when a button is pushed like so StackableLootList.add(LootToAdd.getText()); i literally have no idea why i get a null pointer whenever i try to do anything with the array lists in my main code. please help
  9. thank you everyone, i didnt know that i could use action listoners for the exact thing i was trying to do.
  10. hello, i was wondering what the best ways to get info (like if a checkbox is checked or if a button is selected) from the gui. the reason i ask is because i have run into a couple problems. what i have tried so far: if i use a statement to check like if(gui.button.isSelected) the button never shows up in the "gui." pop up menu. and if in the gui class i try to make a function to get the details of an item it doesn't allow me to access the variable. can anyone explain how to correctly get the information from the gui. thanks!
  11. The problem was that i hadnt set the default size yet. thank you everyone
  12. Hey, so while attempting to make my gui i have encountered a problem. when i call the gui to appear using gui.setvisible(true) I get a weird version where nothing pops up but it says that there is an open window in my open programs bar thing (picture for reference, the gui is the thing on window on the right). my Gui class is named "Gui" and is in the same package as the main class. i also call it by using "public Gui gui = new Gui();" at the top of main before onStart() in onStart the gui is set to visible with: "gui.setVisible(true);" its weird because i use the gui the same way i did in other scripts and it worked fine there. just wondering if anyone else has had this weird problem.
  13. Hey there, so im making a fighting script and im trying to make a method for creating a list of items to pick up that the user can put in. the problem im running into right now is that i beleive im doing everything right but on the button press it doesnt add anything to the table. This is my current code. http://pastebin.com/rKUbk6Kz this is how the gui looks if a visual is needed.
  14. wow, i thought i was trying to make a nice fighting script with a good amount of options but this just takes it to the next level. this looks amazing! i hope i can buy it some day
  15. Hello forums, I am trying to figure out how to either use a type of filter that will work with GroundItems. or a way to get all of the closest GroundItems inside of a certain area During the initialization of the ground item. thanks
  16. Its no problem i should have been more specific! ill have to look into iNodeRouteFinder, it shouldnt be too hard right?
  17. okay yea i didnt know, but kinda guessed, that walking event works only in the loaded areas. and i think WebWalkEvent is exactly what i needed, ill try to implement it, but what does it take in? and do i have to create like a web or something for it to work? paths seem like a simple and efficient way to do things but im trying to make something that walks from anywhere to a certain spot and i dont think i would be able to do that.
  18. Thanks! see i was stuck on using non supporting shoes meant for Skateboarding. would i have to create anything related to walking or webwalking or if i just put in an area it will walk to that area from anywhere
  19. so i am trying to make some of my own scripts and maybe upload them for people to use, but i feel like i need to update the way i walk. i currently use walking events which i think is pretty good, but i dont really know how to walk long distances or how to find out where my current position is compared to everything else to know what to do next. so if anyone can give me any tips for walking through runescape long distances or better in general, that would be awesome!
  20. hey there guys. im trying to learn how to use filters when defining an npc, mostly to find the closest npc that has a specific name, and is inside of a certain pre-defined area. my current code is: public boolean ShouldAttack() { NPC monster = npcs.closest(n -> ( !n.isUnderAttack() && n.getName().contains(g.name) && (g.monsterArea.contains(n) || g.monsterArea2.contains(n)) )); log("attacking"); if(monster.exists()) { log(monster.getName()); log(monster.getCurrentHealth()); if(g.safespot.contains(myPlayer()) && !myPlayer().isAnimating()) return true; } return false; } and returns a null pointer error whenever i do anything with monster. as im testing this the monsters are in the area and it should be returning true. the g.xxxx are just my global variables. initialized like so. public static class g { static Area safespot = new Area(3154, 9908, 3153, 9908); static Position SafeSpot = new Position(3154,9908,0); static String name = "Moss Giant"; static String ammo = "Iron arrow"; static String food = "Tuna"; static boolean shouldsafespot = true; static Area monsterArea = new Area(3155,9907,3159,9906); static Area monsterArea2= new Area(3157,9905,3160,9901); static String lootlist[] = {"Coins", "Law rune", "Nature rune", "Chaos rune", "Chaos rune" ,"Earth rune", "Air rune"}; }
  21. hey there forums, I was just wondering if it would be possible to check the amount of grounditems in a stack. like arrows on the ground. then pick them up if the stack is greater than a number. i tried : GroundItem loot = getGroundItems().closest(g.item); log("test1"); if(loot.getAmount() > 3 && (!inventory.isFull() || inventory.contains(g.item))) { log("test2 in if statement"); loot.interact("Take"); sleep(random(800,1000)); } -------- and the "loot.getamount() > 3" always made my code crash.
  22. when i use this it just sits there with the mouse hovering over a random tile.. my mistake, i didnt have the client in fixed mode. this script is amazing, the mouse movements are great, it drops ores when both the rocks are mined out. it is amazing at first glance
×
×
  • Create New...