March 6, 201510 yr 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, 201510 yr by PizzaBoxBoy2
March 6, 201510 yr 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) };
March 6, 201510 yr Make sure you are using the OSBot API import. That is: org.osbot.rs07.api.map.Position and not: javax.swing.text.Position
March 6, 201510 yr Author Thanks. Couldent find the import, and it had auto imported javax in an odd spot. Thanks a ton //Pizza
March 6, 201510 yr 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
March 6, 201510 yr 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
Create an account or sign in to comment