Jump to content

jua1

Members
  • Posts

    43
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

jua1's Achievements

Bronze Poster

Bronze Poster (2/10)

5

Reputation

2

Community Answers

  1. jua1

    Null check

    so all those who have had trouble with this use getX() and getY() don't check for null just keep the same position for both snares.
  2. jua1

    Null check

    final Variables should be all caps... does that mean final are Const variables?
  3. jua1

    Null check

    yea sorry i spelt it correctly in the script I think im going to do it a different way because this is not working it seems that the null check doesnt work for this object.
  4. jua1

    Null check

    this is only a snippet of the code that is where its getting stuck. If i dont getPosition of the snare my script works perfectly. I need to log their positions though so you can run the script next to other bots or else its going to try to pick up other ppls snares. Im telling you guys I am only having problem with the null check for closestObjectForName("Bird Snare")
  5. jua1

    Null check

    thats possible but when i place it on the ground i get no value for ground item. Worth trying though il try it right now. Yea its not a ground item
  6. jua1

    Null check

    tried this it didn't work.
  7. jua1

    Null check

    nah after the null check i log its position so that you can run this with other people hunting in the same area and not try to pick up their snares, but the problem is the getPosition() requires a null check and i've also tried exist().
  8. jua1

    Null check

    script keeps getting stuck on a if(closestObject(9345) != null) the object is a bird snare and it is on the ground when it cycles through to the null check but it never gets passed. I've tried using closestNPC(), closestObjectForName(), ClosestNPCForName() all dont make it passed the null check. public void LaySnare() throws InterruptedException { Inventory Inven = client.getInventory(); final RS2Object GroundSnare = closestObject(9345); final Entity player = client.getMyPlayer(); if (player != null) if (HuntingGround.contains(player)) { if (Inven.contains(BirdSnareItem) == true) { Inven.interactWithName(BirdSnareItem, InteractSnare); sleep(10000); if(GroundSnare != null){ log("logging snare position"); snare = GroundSnare.getPosition(); if(!Inven.contains(BirdSnareItem)){ log(DetectState); StateHolder = 0;} } } } else { walkExact(HuntingGround); } }
  9. what i ended up doing was create a INT member variable in the GUI Class and depending on what script it selects it changes the value, then in the main it checks that integer.
  10. yea so your saying create a main class then make the GUI return which script to use then depending on the return execute that script?
  11. So as the title suggests I have a menu created with swing and a OSbot script. -Both classes are under the same package -I currently have the start button actionhandler create a new script() on pressing it -Im positive this is the wrong way to do it, anyone have some insight that could guide me onto the right path? public GUI(){ super("Menu"); setLayout(new FlowLayout()); setSize(300, 200); setResizable(true); setDefaultCloseOperation(EXIT_ON_CLOSE); Panel = new JPanel(); Panel.setBackground(Color.yellow); add(Panel); Panel.add(Box1); Panel.add(Box2); Panel.add(Button1); HandlerClass Handler = new HandlerClass(); Button1.addActionListener(Handler); setVisible(true); } public static void main(String[] args){ new GUI(); } private class HandlerClass implements ActionListener{ public void actionPerformed(ActionEvent event){ if(!Box1.isSelected() && !Box2.isSelected()){ new CatchBirds(); //new script() } } } }
  12. jua1

    common GUI

    Does anyone know what library or application people are using to create and code GUI for scripts? i've done stuff like Sprites in c++ , however i have no idea what libraries to use for java.
×
×
  • Create New...