-
Posts
21 -
Joined
-
Last visited
-
Feedback
0%
Everything posted by KevinHouse
-
Lol, your lucky I find this funny or I would have reported it
-
That was my problem when I started scripting for vinsert and osbot aswell, abstract methods
-
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"
-
[Release] Script Loader for Class- and Jar-Based Scripts
KevinHouse replied to DarkStorm's topic in Software Development
No need to say sorry. Great release! -
New Hooks, Java Support, Anti-Randoms, and More!
KevinHouse replied to
Laz's topic in News & AnnouncementsFinally Java support! Groovy debugging in Eclipse or converting Java's swing to Groovy's swingbuilder is a pain in the ass. -
[Release] Script Loader for Class- and Jar-Based Scripts
KevinHouse replied to DarkStorm's topic in Software Development
I can't seem to be able to find the .groovy file -
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; }