Skip to content

Instantly share code, notes, and snippets.

// $Id$
/*
* Copyright (C) 2010, 2011 sk89q <http://www.sk89q.com>
*
* 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,
while true do
-- press the up and right buttons for player 1
joypad.set(1, { up=1, right=1 })
-- press the down and left buttons for player 2
joypad.set(1, {down=1,left=1})
-- next frame (replace FCEU by snes9x or gens)
FCEU.frameadvance()
end
@md-5
md-5 / gist:3115299
Created July 15, 2012 06:08 — forked from ajvpot/gist:3115176
Minecraft Migrated Account Session Vulnerability
                  ████▓               
               ▓█▓▓▓▓▓██▒              
             ▒██▒▒▒▒▒▒▒▓█▓             
            ▓█▓▒▒▒▒▒▒▒▒▒▒██            
           ██▒▒▒▒▓███▓▒▒▒▒▓█▒          
         ▒█▓▒▓▓▓██▓░▓█▓▓▓▓▓▓█▓         
        ▓█▓▓▓▓▓██▓   ▒██▓▓▓▓▓██▒       
      ▒██▓▓▓▓███       ███▓▓▓▓██▓      
     ▓██▓█████▒         ▒█████████     

▒█████████ ▒▓▓▓▓▓▓▓▓▒▓█████████▒

@md-5
md-5 / Test.js
Created July 16, 2012 10:07
Test javascript script for MC-Bot
importPackage(Packages.com.md_5.bot.mc);
importPackage(Packages.java.lang);
var connection = new Connection("127.0.0.1", 25565);
connection.setUsername("md_5");
if (connection.connect()){
// read thread
new Thread(function run(){
@md-5
md-5 / LombokWin.java
Created July 18, 2012 10:23
Lombok, winning!
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import lombok.Cleanup;
import lombok.SneakyThrows;
import lombok.val;
public class Test {
@md-5
md-5 / Bot.java
Created July 19, 2012 10:10
REl move code
/**
* Moves the specified amount forwards and left in the current direction
* (calculated based on current yaw)
*
* @param forward, double sideways how far to move
* @param left how far to the left to move
*/
public void moveRelative(double forward, double left) {
final float yaw = getLocation().getYaw();
final double xToMove = forward * Math.cos(yaw) - left * Math.sin(yaw);
import net.minecraft.client.Minecraft;
public class DiamondDig implements Runnable {
public static int oldPlayerX;
public static int oldPlayerY;
public static int oldPlayerZ;
public static int stuckCount = 0;
public boolean noY = false;
public boolean noZ = false;
@md-5
md-5 / SharedKey.java
Created July 22, 2012 00:15
Shared key
private static byte[] getShared(SecretKey key, PublicKey pubkey) {
try {
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, pubkey);
return cipher.doFinal(key.getEncoded());
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
@md-5
md-5 / Test.js
Created July 22, 2012 02:53
MC-Bot test script
importPackage(Packages.com.md_5.bot.mc);
importPackage(Packages.com.md_5.bot.mc.entity);
importPackage(Packages.java.lang);
var bot = new Connection("127.0.0.1", 25565);
bot.setUsername("sha_1");
if (bot.connect()){
// read thread
@md-5
md-5 / LanBukkit.java
Created August 19, 2012 01:24
Shows your Bukkit server to the LAN
package com.md_5;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.util.logging.Level;
import org.bukkit.plugin.java.JavaPlugin;
public class LanBukkit extends JavaPlugin implements Runnable {