Skip to content

Instantly share code, notes, and snippets.

//moneyLimit = 500
//Set that in the onload script!
if(pinv.getItemInSlot(35) != null)
{
if(pinv.getItemInSlot(35).getItemID() != 353)
{
for(i=0;i<35;i++)
{
if(pinv.getItemInSlot(i) == null)
@Pwootage
Pwootage / gist:1075302
Created July 11, 2011 04:09
Push a block
if (hitBlock != null)
{
blockID = world.getBlockID(hitBlock.x, hitBlock.y, hitBlock.z);
pushid = 12;
iceid = 79;
triggerid = 201;
if (blockID == pushid)
{
@Pwootage
Pwootage / light_clycler.js
Created July 13, 2011 23:40
Light cycler
try
{
directions[0] = directions[0];
}
catch (exception)
{
directions = new Array();
for (i = 0; i < 16; i++)
{
directions[i] = 1;
var pos = player.getPosition();
var x = Math.floor(pos.x);
var y = Math.floor(pos.y) - 2;
var z = Math.floor(pos.z);
var idUnderneath = world.getBlockID(x,y,z);
var metaUnderneath = world.getMetadata(x,y,z);
/* 242 */ if (!debug)
/* */ {
/* */ try
/* */ {
/* 246 */ Class.forName("mod_TooManyItems");
/* 247 */ HashSet excludeIds = (HashSet)ModLoader.getPrivateValue(TMIConfig.class, null, "excludeIds");
/* 248 */ excludeIds.add(Integer.valueOf(IronBubble.bf));
/* 249 */ excludeIds.add(Integer.valueOf(PigSlayer.bf));
/* 250 */ excludeIds.add(Integer.valueOf(VampireBlade.bf));
/* 251 */ excludeIds.add(Integer.valueOf(NatureStaff.bf));
var posx = -146;
var posy = 64;
var posz = 67;
var ppos = player.getPosition();
if (ppos.x > posx && ppos.x < posx+1)
{
if (ppos.z > posz && ppos.z < posz+1)
{
//x,y,zOffset are either -4, 0, or 4, depending on fan facing.
if (!(e instanceof ju)) //e = Entity, ju = EntityFallingSand
{
double dist = e.h(i + 0.5D, j + 0.5D, k + 0.5D) * Math.abs(xOffset + yOffset + zOffset) / 4.0D;//e.h = distance from entity
e.d(0.07000000000000001D * xOffset / dist, 0.07000000000000001D * yOffset / dist, 0.07000000000000001D * zOffset / dist);//e.d = add velocity
if (((e instanceof gs)) && (((gs)e).usingUmbrella()))//gs = EntityPlayer
{
e.d(0.07000000000000001D * xOffset / dist, 0.07000000000000001D * yOffset / dist, 0.07000000000000001D * zOffset / dist);
}
function fakeFan(xmin, xmax, zmin, zmax, ypos)
{
var ppos = player.getPosition();
if (ppos.x > xmin && ppos.x < xmax+1) {
if (ppos.z > zmin && ppos.z < xmax+1) {
if (ppos.y > ypos) {
dist = (ppos.y - ypos) + 0.4;
var pvel = player.getVelocity();
if (dist < 4) {
player.setVelocity(pvel.x, pvel.y + ((0.07 * ((4-dist)))-0.04), pvel.z);
@Pwootage
Pwootage / gist:1119286
Created August 2, 2011 00:06
Arrow puzzle noteblock->lightstone then trigger nearby memory blocks
pinv = player.getInventory()
redck = 4
var ppos = player.getPosition();
var px = Math.round(ppos.x);
var py = Math.round(ppos.y);
var pz = Math.round(ppos.z);
for each (var entity in player.getEntitiesWithinRange(50))
{
if(entity.classType == "Arrow")
updateMana = function()
{
pPos = player.getPosition();
if (world.getLightValue(pPos.x, pPos.y, pPos.z) > 3)
{
generateMana();
}
else
{
loseMana();