Skip to content

Instantly share code, notes, and snippets.

m_iSoldierXPLevels=0; PFC
m_iSoldierXPLevels=120; SPEC
m_iSoldierXPLevels=350; LCPL
m_iSoldierXPLevels=700; CPL
m_iSoldierXPLevels=1200; SGT
m_iSoldierXPLevels=1900; TSGT
m_iSoldierXPLevels=2800; GSGT
m_iSoldierXPLevels=4000; MSGT
@Pwootage
Pwootage / crossword.py
Created January 29, 2015 22:11
Python crossword one-liner (i'm so sorry)
import sys
import itertools
class Crossword:
def __init__(self, path):
f = open(path, 'r')
lines = filter(lambda x: len(x) > 0, map(lambda x: x.strip(), f.readlines()))
f.close()
self.size = len(lines[0])
//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);