ugpjosh Posted September 30, 2014 Share Posted September 30, 2014 My current code: http://pastebin.com/hTsBeh9u I'm having trouble getting my player to move to the 'STEAL_POS' whenever he's in the 'DANGER_AREA'. I can't seem to figure this out, any help? I need him to move back to this spot otherwise it will not allow me to steal from the tea stall. Link to comment Share on other sites More sharing options...
Joseph Posted September 30, 2014 Share Posted September 30, 2014 The logic looks fine, you should try debugging the area. The best way to debug it is by using the area#getPositions(plane) to get all position with in the area, use a for loop in the onPaint. do a simple is visible boolean check and use the Position#getpolygon, and draw it in the onPaint. example: for (Position pos : AREA.getPositions(0)) { if (pos.isVisible(bot)) { g.draw(pos.getPolygon(bot)); } } Link to comment Share on other sites More sharing options...
Fay Posted September 30, 2014 Share Posted September 30, 2014 Just as an addition: Line 47 can be snipped (called on 50 but move to top). Defined in 59 (aswell, pretty sure it should be moved to top anyways). Line 78 should be 400+ average reaction time for a player is around there not 200-300 consistently. Also to touch on what josedpay said, if you don't to script that part the option is also in the GUI of the client to enable client debugging or something along those lines, will so the same thing just easier on your. Link to comment Share on other sites More sharing options...
ugpjosh Posted September 30, 2014 Author Share Posted September 30, 2014 I'm still really confused, I'm a beginner at java and I could really use some extra help here. Link to comment Share on other sites More sharing options...
Joseph Posted September 30, 2014 Share Posted September 30, 2014 I'm still really confused, I'm a beginner at java and I could really use some extra help here. Debug the area, make sure that you created the area correctly. You could draw all position in the area like I said in the first post. Which is much easier and much visual. Or you could do it differently not sure how Link to comment Share on other sites More sharing options...
ugpjosh Posted September 30, 2014 Author Share Posted September 30, 2014 I'm a beginner and I'm not exactly sure how to do all that. Link to comment Share on other sites More sharing options...
pitoluwa Posted September 30, 2014 Share Posted September 30, 2014 I think that area is too small, try to extend it by 1x1 tile Link to comment Share on other sites More sharing options...
Apaec Posted September 30, 2014 Share Posted September 30, 2014 (edited) First, change the enumeration name 'STEAL_POS' to something else, not too great having an enum + variable with the same name, it could confuse things. If you can't seem to make it walk to the position, perhaps try getting it to walk to a 1x1 area instead ? (yes, this is possible). For example: public Area STEAL_AREA = new Area(3270,3412, 3270,3412); Then when you want to walk to it, just call the code localWalker.walk(STEAL_AREA.getRandomPosition(0)); and that should work (idk, can't remember the syntax off the top of my head but i think that's right EDIT: also, don't be afraid to overextend the area to the other side of the wall. this could be the area: Edited September 30, 2014 by Apaec Link to comment Share on other sites More sharing options...
Joseph Posted October 1, 2014 Share Posted October 1, 2014 Learn to debug, debugging it's your best friend. If you wanted to, you have your area created. You don't know how to draw the tiles in the area so do something different. Remove Everton from the onloop, add a Boolean if I'm in the area log a statement. Else log a different statement. Then run the script and walk in and out the area and see what the results are. If it's false when you're in the area that means you fucked up the area. Later I'll add in the debug for painting the position Link to comment Share on other sites More sharing options...
ugpjosh Posted October 1, 2014 Author Share Posted October 1, 2014 I PM'd you about an error I keep getting. Link to comment Share on other sites More sharing options...