Skip to content

Instantly share code, notes, and snippets.

View pxpc2's full-sized avatar
💭
CANSADO

Pedro D Cardoso pxpc2

💭
CANSADO
  • UnB - Universidade de Brasilia
  • Brasil
  • 11:13 (UTC -03:00)
View GitHub Profile
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;
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");
public class SetTrap extends Strategy implements Task
{
SceneObject trap;
public void run()
{
if (trap.isOnScreen())
{
// Already doing everything for me
SMethods.activateTrap(trap);
/**
* @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");
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;
public class LootTrap extends Strategy implements Task
{
SceneObject trap;
SceneObject[] traps;
public void run()
{
for (SceneObject t : traps)
{
trap = t;
/**
* @param trap the trap SceneObject
*/
public static void activateTrap(SceneObject trap)
{
if ((trap != null) && (trap.isOnScreen()))
{
Tile loc = trap.getLocation();
trap.interact("Set-trap");
for (Player currentPlayer : Players.getLoaded())
{
if (currentPlayer != null && currentPlayer.getName() != Players.getLocal().getName())
{
for (String listName : closedPlayers)
{
if (currentPlayer.getName().toLowerCase().equals(listName))
{
return;
}
// 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"))
/**
*
* @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)
{