This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Tile[] getPath(Tile start, Tile end) { | |
final Node[] path = getPath( | |
nodes[start.getX() - Game.getBaseX()][start.getY() - Game.getBaseY()], | |
nodes[end.getX() - Game.getBaseX()][end.getY() - Game.getBaseY()] | |
); | |
Tile[] route = new Tile[path.length]; | |
for (int i = 0; i < path.length; i++) { | |
final Node node = path[i]; | |
final Tile tile = new Tile(node.x + Game.getBaseX(), node.y + Game.getBaseY(), Game.getPlane()); | |
route[i] = tile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ((trap != null) && (trap.isOnScreen()) && (Players.getLocal().getAnimation() == -1)) | |
{ | |
Tile tile = trap.getLocation(); | |
trap.interact("Set-trap"); | |
SFields.inactivity = new Timer(0); | |
while ((SceneEntities.getAt(tile.getX(), | |
tile.getY()).getId() == SConstants.SWAMP_LIZARD_TRAP_OPEN) && | |
Players.getLocal().getAnimation() != -1) | |
{ | |
Context.get().getActiveScript().log.severe("inactive"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SetTrap extends Strategy implements Task | |
{ | |
SceneObject trap; | |
public void run() | |
{ | |
if (trap.isOnScreen()) | |
{ | |
// Already doing everything for me | |
SMethods.activateTrap(trap); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param trap the trap SceneObject | |
*/ | |
public static void activateTrap(SceneObject trap) | |
{ | |
if ((trap != null) && (trap.isOnScreen()) && (Players.getLocal().getAnimation() == -1)) | |
{ | |
Tile tile = trap.getLocation(); | |
System.out.println(tile.getX() + " : " + tile.getY()); | |
trap.interact("Set-trap"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.timer.powerminer; | |
import java.awt.Graphics; | |
import com.timer.powerminer.impl.DropOre; | |
import com.timer.powerminer.impl.MineRock; | |
import com.timer.powerminer.job.Node; | |
import com.timer.powerminer.job.Tree; | |
import org.powerbot.beta.core.script.BetaScript; | |
import org.powerbot.game.api.util.Random; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LootTrap extends Strategy implements Task | |
{ | |
SceneObject trap; | |
SceneObject[] traps; | |
public void run() | |
{ | |
for (SceneObject t : traps) | |
{ | |
trap = t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param trap the trap SceneObject | |
*/ | |
public static void activateTrap(SceneObject trap) | |
{ | |
if ((trap != null) && (trap.isOnScreen())) | |
{ | |
Tile loc = trap.getLocation(); | |
trap.interact("Set-trap"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (Player currentPlayer : Players.getLoaded()) | |
{ | |
if (currentPlayer != null && currentPlayer.getName() != Players.getLocal().getName()) | |
{ | |
for (String listName : closedPlayers) | |
{ | |
if (currentPlayer.getName().toLowerCase().equals(listName)) | |
{ | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// with bonus: | |
private void chop(int waitTime, int...ids) | |
{ | |
for (int id : ids) | |
{ | |
SceneObject tree = SceneEntities.getNearest(id); | |
if (tree != null && tree.isOnScreen()) | |
{ | |
Timer timer = new Timer(waitTime); | |
if (tree.interact("Chop")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @param matrixA the first matrix | |
* @param matrixB the second matrix | |
* @return the product | |
*/ | |
private static int[][] getProduct(int[][] matrixA, int[][] matrixB) | |
{ | |
if (matrixA[0].length != matrixB.length) | |
{ |
OlderNewer