Skip to content

Instantly share code, notes, and snippets.

@qoh
qoh / lca.cs
Last active December 16, 2015 11:09
Local obstacle avoidance
function AIPlayer::setLCA( %this, %bool )
{
%this.setMoveX( 0 );
if ( %bool )
{
%this.lcaTick();
}
else if ( isEventPending( %this.lcaTick ) )
{
@qoh
qoh / server.cs
Last active December 16, 2015 11:19
exec( "./pathing.cs" );
function AIPlayer::aiTick( %this )
{
cancel( %this.aiTick );
%position = %this.getHackPosition();
if ( isObject( nodeGroup ) )
{
%useNodes = true;
exec( "./pathing.cs" );
function AIPlayer::aiTick( %this )
{
cancel( %this.aiTick );
%position = %this.getHackPosition();
if ( isObject( nodeGroup ) )
{
%useNodes = true;
@qoh
qoh / gist:5428975
Last active December 16, 2015 11:39
function line( %a, %b )
{
%distance = vectorDist( %a, %b );
%center = vectorScale( vectorAdd( %a, %b ), 0.5 );
%x0 = getWord( %a, 0 );
%y0 = getWord( %a, 1 );
%z0 = getWord( %a, 2 );
%x1 = getWord( %b, 0 );
datablock staticShapeData( lineShapeData )
{
shapeFile = "config/cube.dts";
};
function line( %a, %b )
{
%distance = vectorDist( %a, %b );
%center = vectorScale( vectorAdd( %a, %b ), 0.5 );
datablock staticShapeData( lineShapeData )
{
shapeFile = "config/cube.dts";
};
// individual angles
function line( %a, %b )
{
%distance = vectorDist( %a, %b );
@qoh
qoh / nodes.cs
Last active December 16, 2015 11:39
datablock staticShapeData( cubeShapeData )
{
shapeFile = "config/cube.dts";
};
function nodeSO( %position, %owner )
{
if ( strLen( %owner ) && !isObject( %owner ) )
{
error( "ERROR: Invalid node owner." );
function findPath( %start, %end )
{
if ( !isObject( %start ) || !isObject( %end ) )
{
return;
}
%start = %start.getID();
%end = %end.getID();
package flashlightPackage
{
function serverCmdLight( %client )
{
parent::serverCmdLight( %client );
if ( isObject( %client.player.light ) )
{
%client.player.light.detachFromObject();
%client.player.flashlightTick();
var jsdom = require('jsdom');
function discover(callback) {
jsdom.env(
'http://forum.blockland.us/?action=recent',
function (errors, window) {
discoverParse(callback, window.$);
window.close();
}
);