PizzaBoxBoy2 Posted March 6, 2015 Share Posted March 6, 2015 (edited) When defining a position array like so: private Position[] path = { new Position(3165, 3481, 0), new Position(3164, 3471, 0), new Position(3157, 3462, 0), new Position(3145, 3456, 0), new Position(3131, 3453, 0), new Position(3121, 3451, 0), new Position(3116, 3449, 0) }; I get an error on new Position: Cannot instantiate the type Position Any Ideas on what is causing this? Both tutorials available for walking haven't helped. Any help? //Pizza Edited March 6, 2015 by PizzaBoxBoy2 Quote Link to comment Share on other sites More sharing options...
Isolate Posted March 6, 2015 Share Posted March 6, 2015 When defining a position array like so: private Position[] path = { new Position(3165, 3481, 0), new Position(3164, 3471, 0), new Position(3157, 3462, 0), new Position(3145, 3456, 0), new Position(3131, 3453, 0), new Position(3121, 3451, 0), new Position(3116, 3449, 0) }; I get an error on new Position: Cannot instantiate the type Position Any Ideas on what is causing this? Both tutorials available for walking haven't helped. Any help? private Position[] path = new Position[]{ new Position(3165, 3481, 0), new Position(3164, 3471, 0), new Position(3157, 3462, 0), new Position(3145, 3456, 0), new Position(3131, 3453, 0), new Position(3121, 3451, 0), new Position(3116, 3449, 0) }; Quote Link to comment Share on other sites More sharing options...
PizzaBoxBoy2 Posted March 6, 2015 Author Share Posted March 6, 2015 Same error still //Pizza Quote Link to comment Share on other sites More sharing options...
Botre Posted March 6, 2015 Share Posted March 6, 2015 Make sure you are using the OSBot API import. That is: org.osbot.rs07.api.map.Position and not: javax.swing.text.Position Quote Link to comment Share on other sites More sharing options...
PizzaBoxBoy2 Posted March 6, 2015 Author Share Posted March 6, 2015 Thanks. Couldent find the import, and it had auto imported javax in an odd spot. Thanks a ton //Pizza Quote Link to comment Share on other sites More sharing options...
Botre Posted March 6, 2015 Share Posted March 6, 2015 Thanks. Couldent find the import, and it had auto imported javax in an odd spot. Thanks a ton //Pizza Dw it's a common mistake, glad you solved it 1 Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted March 6, 2015 Share Posted March 6, 2015 private Position[] path = new Position[]{ new Position(3165, 3481, 0), new Position(3164, 3471, 0), new Position(3157, 3462, 0), new Position(3145, 3456, 0), new Position(3131, 3453, 0), new Position(3121, 3451, 0), new Position(3116, 3449, 0) }; This doesn't matter, since you can initiliaze with just {} behind your declaration ;) If you initialize it later on you have to do it this way When defining a position array like so: private Position[] path = { new Position(3165, 3481, 0), new Position(3164, 3471, 0), new Position(3157, 3462, 0), new Position(3145, 3456, 0), new Position(3131, 3453, 0), new Position(3121, 3451, 0), new Position(3116, 3449, 0) }; I get an error on new Position: Cannot instantiate the type Position Any Ideas on what is causing this? Both tutorials available for walking haven't helped. Any help? //Pizza Recheck your imports Use the osbot import instead Khaleesi Quote Link to comment Share on other sites More sharing options...