Skip to content

Instantly share code, notes, and snippets.

View Shadowrs's full-sized avatar

Jak Shadowrs

  • UK
View GitHub Profile
@Shadowrs
Shadowrs / CombatMovement.java
Created May 26, 2020 05:44
Dementhium 637 combat following
public static boolean combatFollow(Mob mob, Mob other, CombatType type) {
mob.turnTo(other);
int distance = mob.getLocation().getDistance(other.getLocation());
if (distance > 17) {
mob.getCombatExecutor().reset();
return false;
}
if ((type == CombatType.MELEE || type == CombatType.DEFAULT) && canMelee(mob, other)) {
if (diagonal(mob.getLocation(), other.getLocation())) {
mob.requestClippedWalk(other.getLocation().getX(), mob.getLocation().getY());
@Shadowrs
Shadowrs / PathFinder.java
Created May 26, 2020 05:29
484 rs2hd Jedi PathFinder
/*******************************************************************************
* Azureify Revision 498 RuneScape Emulator
* Copyright (C) 2012 Ryan ryry-@sympatico.ca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@Shadowrs
Shadowrs / AStarPathFinder.java
Created May 26, 2020 05:25
Graham's A* Path Finder
package org.hyperion.rs2.pf;
import java.util.HashSet;
import java.util.Set;
import org.hyperion.rs2.model.Location;
/**
* An implementation of a <code>PathFinder</code> which uses the A* search
* algorithm. Unlike the <code>DumbPathFinder</code>, this will attempt to find
@Shadowrs
Shadowrs / DumbPathFinder.java
Created May 26, 2020 05:19
Josh Mai's DumbPathFinder
package org.rs2server.rs2.model.pathfinder;
import org.rs2server.rs2.clipping.RegionClipping;
import org.rs2server.rs2.clipping.TileControl;
import org.rs2server.rs2.model.GameObject;
import org.rs2server.rs2.model.GameObjectDefinition;
import org.rs2server.rs2.model.Location;
import org.rs2server.rs2.model.Mob;
import org.rs2server.rs2.model.NPC;
import org.rs2server.rs2.model.Player;
@Shadowrs
Shadowrs / shortcuts.kt
Created May 19, 2020 16:22
Full shortcut code
// Al Kharid mine shortcut exit
r.onObject(16550) @Suspendable {
if (it.player().skills().level(Skills.AGILITY) < 38) {
it.message("You need an agility level of 38 to negotiate these rocks.")
} else {
it.player().lock() // disallows movement, logout, eating, most things you can do
it.delay(1) // wait 1 tick
it.player().looks().render(738, 737, 737, 737, 737, 737, -1) // change the stand,walk,run,turn anims to "holding hands out"
it.player().sound(2244, 10, 4) // play a sound effort
it.player().pathQueue().clear() // clear any previous requested walking destinations
@Shadowrs
Shadowrs / DarkBeasts.kt
Created May 19, 2020 12:28
Dark Beasts Combat
package nl.bartpelle.veteres.content.npcs.slayer
import co.paralleluniverse.fibers.Suspendable
import nl.bartpelle.skript.Script
import nl.bartpelle.veteres.content.combat.EntityCombat
import nl.bartpelle.veteres.content.combat.PlayerCombat
import nl.bartpelle.veteres.model.AttributeKey
import nl.bartpelle.veteres.model.Entity
import nl.bartpelle.veteres.model.entity.Npc
import nl.bartpelle.veteres.util.CombatStyle
@Shadowrs
Shadowrs / Camelot.kt
Created May 16, 2020 17:56
operator and extension functions
class Inventory {
val items: Array<Item> = arrayOf()
}
fun Inventory.isfull(): Boolean {
items[0] = Item(1)
return true
}
@Shadowrs
Shadowrs / LinkedTaskSequence.java
Created May 2, 2020 00:10
lare96's task chained concept lare96's chained task concept
package net.arrav.task;
import com.google.common.base.Preconditions;
import net.arrav.world.World;
import java.util.*;
/**
* A sequence of {@link LinkedTask}s that are ran in <i>FIFO</i> order, and the
* solution to scheduling tasks in bulk. The problem with scheduling many tasks
@Shadowrs
Shadowrs / PacketCallback.java
Created December 19, 2019 16:42
parabot example
package org.parabot.osscape.callback;
import org.parabot.api.output.Verboser;
import org.parabot.core.Context;
import org.parabot.core.reflect.RefClass;
import org.parabot.core.reflect.RefMethod;
import org.parabot.osscape.Loader;
import org.zenyte.min.api.accessors.*;
import org.parabot.osscape.api.methods.Game;
import org.parabot.osscape.api.wrapper.Tile;
"C:\Program Files\Java\jdk1.8.0_202\bin\java.exe" -Xss4M -javaagent:C:\Users\Jak\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\191.6183.20\lib\idea_rt.jar=53367:C:\Users\Jak\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\191.6183.20\bin -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_202\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_