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
fun ByteBuffer.rsadec(exponent: BigInteger, modulus: BigInteger) { | |
val length = g1 | |
val dec = BigInteger(gdata(length)).modPow(exponent, modulus).toByteArray() | |
position(0) | |
pdata(dec) | |
position(0) | |
} | |
====================================================================== |
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
[debugproc,test] | |
def_int $radius = 1; // 1, 2 or 3 | |
def_coord $coord = coord; | |
def_int $x = coordx($coord); | |
def_int $z = coordz($coord); | |
def_int $centerX = divide($x, pow(2, 3)); | |
def_int $centerZ = divide($z, pow(2, 3)); |
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
[ScriptOpcode.MAP_BLOCKED]: (state) => { | |
const coord = state.popInt(); | |
if (coord < 0 || coord > Position.max) { | |
throw new Error(`MAP_BLOCKED attempted to use coord that was out of range: ${coord}. Range should be: 0 to ${Position.max}`); | |
} | |
const pos = Position.unpackCoord(coord); | |
const zone = World.getZone(pos.x, pos.z, pos.level); |
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
[opplayeru,christmas_cracker] @player_pull_christmas_cracker; | |
[label,player_pull_christmas_cracker] | |
if (inv_total(inv, christmas_cracker) = 0) { | |
return; | |
} | |
if(.busy = true) { | |
mes("<.displayname> is busy."); | |
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
[proc,moveallinv](inv $src, inv $dest) | |
def_int $size = inv_size($src); | |
def_int $i = 0; | |
while ($i < $size) { | |
def_obj $obj = inv_getobj($src, $i); | |
if ($obj ! null) { | |
inv_moveitem($src, $dest, $obj, inv_total($src, $obj)); | |
} | |
$i = add($i, 1); | |
} |
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
[oploc1,_door_left_closed] | |
def_coord $opposite = ~movecoord_loc_return(~door_close(loc_angle)); | |
sound_synth(door_open, 0, 0); | |
loc_del(500); | |
loc_add(~movecoord_loc_return(~door_open(loc_angle)), loc_param(next_loc_stage), calc((loc_angle + 3) % 4), wall_straight, 500); | |
loc_findallzone($opposite); | |
while (loc_findnext = true) { | |
if (loc_coord = $opposite & loc_category = door_right_closed) { | |
loc_del(500); | |
loc_add(~movecoord_loc_return(~door_open(loc_angle)), loc_param(next_loc_stage), calc((loc_angle + 1) % 4), wall_straight, 500); |
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
import fs from 'fs'; | |
import Jagfile from '#jagex2/io/Jagfile.js'; | |
import Packet from '#jagex2/io/Packet.js'; | |
export default class WordEnc { | |
private static fragments: number[] = []; | |
private static bads: Uint16Array[] = []; | |
private static badCombinations: number[][][] = []; | |
private static domains: Uint16Array[] = []; |
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
import * as fs from 'fs'; | |
import Jagfile from '../src/js/jagex2/io/Jagfile'; | |
import Model from '../src/js/jagex2/graphics/Model'; | |
import NpcType from '../src/js/jagex2/config/NpcType'; | |
import Bzip from '../src/js/vendor/bzip'; | |
import PixFont from '../src/js/jagex2/graphics/PixFont'; | |
beforeAll(async (): Promise<void> => { | |
await Bzip.load(fs.readFileSync('./test/resources/bz2.wasm')); | |
}); |
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
// // main | |
if (GameShell.getParameter('world').length === 0) { | |
GameShell.setParameter('world', '1'); | |
} | |
if (GameShell.getParameter('detail').length === 0) { | |
GameShell.setParameter('detail', 'high'); | |
} | |
if (GameShell.getParameter('method').length === 0) { |
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
export function fillTexturedTriangle( | |
xA: i32, | |
xB: i32, | |
xC: i32, | |
yA: i32, | |
yB: i32, | |
yC: i32, | |
shadeA: i32, | |
shadeB: i32, | |
shadeC: i32, |