Jump to content

KevinHouse

Members
  • Posts

    21
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

KevinHouse's Achievements

Bronze Poster

Bronze Poster (2/10)

0

Reputation

  1. Lol, your lucky I find this funny or I would have reported it
  2. That was my problem when I started scripting for vinsert and osbot aswell, abstract methods
  3. Player.getZ() returns the hight of the Tile fo your player on the Z axis, just like getX and getY return the X and Y coordinates of a player. You should open the combat tab and split the string from the widget with text "combat level: X"
  4. Finally Java support! Groovy debugging in Eclipse or converting Java's swing to Groovy's swingbuilder is a pain in the ass.
  5. It all depends on the situation, I think ternary is very usefull to clean up your code in most cases. Following example would be alot messier if using if else statements: public static Area createCubicArea(Position p1, Position p2) { int minX = (p1.getX() < p2.getX()) ? p1.getX() : p2.getX(); int maxX = (p1.getX() > p2.getX()) ? p1.getX() : p2.getX(); int minY = (p1.getY() < p2.getY()) ? p1.getY() : p2.getY(); int maxY = (p1.getY() > p2.getY()) ? p1.getY() : p2.getY(); int minZ = (p1.getZ() < p2.getZ()) ? p1.getZ() : p2.getZ(); int maxZ = (p1.getZ() > p2.getZ()) ? p1.getZ() : p2.getZ(); Area cubicArea = new Area(); for(int i = 0; i <= (maxX - minX); i++) { for(int j = 0; j <= (maxY - minY); j++) { for(int k = 0; k <= (maxZ - minZ); k++) { cubicArea.add(new Position(minX +i, minY +j, minZ +k)); } } } return cubicArea; }
×
×
  • Create New...