package org.robockets.stronghold.robot.drivetrain;

import org.robockets.stronghold.robot.OI;
import org.robockets.stronghold.robot.Robot;

import edu.wpi.first.wpilibj.command.Command;

/**
 *
 */
public class Joyride extends Command {
	
	int inchesPerSecond = 12;

    public Joyride() {
        requires(Robot.driveTrain);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    	//Robot.driveTrain.encodersPID.enable();
    	//Robot.driveTrain.encodersPID.setSetpoint(Robot.driveTrain.getEncodersOffset());
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    	if (Robot.oi.joystick.getRawButton(5)) {
    		inchesPerSecond *= 0.1;
    	}
    	
    	if (Robot.oi.joystick.getRawButton(6)) {
    		inchesPerSecond *= 1.1;
    	}
    	//if (Math.abs(OI.joystick.getRawAxis(4)) < 0.1 && Math.abs(OI.joystick.getRawAxis(1)) > 0.1) {	
    		//Robot.driveTrain.encodersPID.enable();
    		//Robot.driveTrain.driveArcade(OI.joystick.getRawAxis(1), -Robot.driveTrain.encodersPID.get());

    	//} else if (Math.abs(OI.joystick.getRawAxis(1)) < 0.1 && Math.abs(OI.joystick.getRawAxis(4)) < 0.1) {
    		//Robot.driveTrain.encodersPID.setSetpoint(Robot.driveTrain.getEncodersOffset());
    		//Robot.driveTrain.encodersPID.reset();
    		//Robot.driveTrain.driveArcade(0, 0);
    	//} else {	
    		Robot.driveTrain.driveArcade(OI.joystick.getRawAxis(1), -OI.joystick.getRawAxis(4));
    		//Robot.driveTrain.encodersPID.setSetpoint(Robot.driveTrain.getEncodersOffset());
    		//Robot.driveTrain.encodersPID.reset();
    	//} 
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    	Robot.driveTrain.stop();
    	//Robot.driveTrain.encodersPID.disable();
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    	end();
    }
}

@@ -234,37 +234,45 @@
 d %7B%0A
-%09
 %0A%09
-int inchesPerSecond = 12
+double translate;%0A%09double rotate
 ;%0A
+%09
 %0A   
@@ -657,24 +657,115 @@
 execute() %7B%0A
+    %09translate = OI.joystick.getRawAxis(1);%0A    %09rotate = OI.joystick.getRawAxis(4);%0A    %09%0A
     %09if (Rob
@@ -802,42 +802,48 @@
 ) %7B%0A
-    %09%09inchesPerSecond
+%09%09%09translate *= 0.5;%0A%09%09%09rotate
  *= 0.
-1;%0A    
+5;%0A%09
 %09%7D%0A 
@@ -843,28 +843,25 @@
 ;%0A%09%09%7D%0A    %09%0A
-    
+%09
 %09if (Robot.o
@@ -900,30 +900,45 @@
   %09%09
-inchesPerSecond
+translate *= 0.8;%0A    %09%09rotate
  *= 
-1.1
+0.8
 ;%0A  
@@ -942,16 +942,19 @@
 %0A    %09%7D%0A
+%09%09%0A
     %09//i
@@ -1539,61 +1539,26 @@
 ade(
-OI.joystick.getRawAxis(1), -OI.joystick.getRawAxis(4)
+translate, -rotate
 );%0A 

Make the code actually work and make sense