Skip to content

Instantly share code, notes, and snippets.

View arilotter's full-sized avatar

Ari Lotter arilotter

View GitHub Profile
We couldn’t find that file to show.
@arilotter
arilotter / robot.js
Created December 4, 2012 15:51
public static void main(String[] args)
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(15*(1+Math.random()));
robot.turn(10*(1+Math.random()));
@arilotter
arilotter / robot.js
Created December 4, 2012 19:40 — forked from Sairento-92/robot.js
Boberczus
function Robot(robot) {}
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
robot.ahead(130);
robot.rotateCannon(50);
robot.back(130);
robot.rotateCannon(50);
if(robot.life==100)
robot.clone()
@arilotter
arilotter / robot.js
Created December 7, 2012 19:46
A.I.
//For finding and tracking other bots
self.pos = [0,0,0,0,0];
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
var predictedPos = predictRobot();
robot.rotateCannon(20);
@arilotter
arilotter / GMBeautifier.py
Created June 30, 2013 18:42
Pass a GM Studio project / project directory / object / script as argument 1, and get it beautified for you ;)
from bs4 import BeautifulSoup
import jsbeautifier
import os
import sys
import re
def beautifyObject(filePath):
f = open(filePath, 'r+')
obj = BeautifulSoup(f, 'xml')
f.close()
@arilotter
arilotter / GuiIngame.java
Created August 27, 2013 19:32
tooltip thing
if (this.mc.gameSettings.heldItemTooltips)
{
this.mc.mcProfiler.startSection("toolHighlight");
if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null)
{
s1 = this.highlightingItemStack.getDisplayName();
k1 = (k - fontrenderer.getStringWidth(s1)) / 2;
i2 = l - 59;
protected void drawItemStackTooltip(ItemStack par1ItemStack, int par2, int par3)
{
List list = par1ItemStack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
for (int k = 0; k < list.size(); ++k)
{
if (k == 0)
{
list.set(k, "\u00a7" + Integer.toHexString(par1ItemStack.getRarity().rarityColor) + (String)list.get(k));
}
protected void drawHoveringText(List par1List, int par2, int par3, FontRenderer font)
{
if (!par1List.isEmpty())
{
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
int k = 0;
Iterator iterator = par1List.iterator();
bool NetworkListener::initialize(ENetAddress *address, const char *baseKey)
{
if (enet_initialize () != 0)
return false;
atexit(enet_deinitialize);
_server = enet_host_create(address, 32, 0, 0);
if(_server == NULL)
return false;
import util
try:
import wpilib
except ImportError:
from pyfrc import wpilib
class RobotGuy(wpilib.SimpleRobot):
def __init__(self):