Projects‎ > ‎

Cmd && Bash Scripts

Diablo 3 Auction House Buyout Calculator (javascript)

posted Jul 1, 2012, 8:41 PM by Chairman Steve   [ updated Jul 1, 2012, 8:48 PM ]

This script calculates the listing price required to get a certain payout in the game Diablo 3.

Dawn of The Dragons Scripts

posted May 24, 2012, 8:43 PM by Chairman Steve   [ updated May 24, 2012, 8:44 PM ]

http://userscripts.org/scripts/show/132408 is an Updated version of SReject’s DotD script. Ive simply added a few additional features. I wanted them. I added them. Now I’m sharing it with you.Chief among the updates is the ability to filter the raid list by difficulty, name, or both.

Raid Link Catcher - This simply listens to the clipboard and stores raid links. It is intended to be used with the raid share function in the above script.

http://userscripts.org/scripts/show/134135 is a script to format the raid links posted in kongregate's forums.It currently does NOT remember which links you have visited. It just changes the big messy link to something nice like Mazalu - N - 100K/220K

BASH::New Java class creation

posted Apr 23, 2011, 8:33 PM by Chairman Steve   [ updated Apr 23, 2011, 8:42 PM ]

While only particularly useful when coding using VI on the terminal, this is super convenient when you make a bunch of little java programs like I do. This is meant to be added to your .bashrc file.

#create a new java template
#usage: new desiredFilename [0]
#0 signifies that this java file will not have a main method or imports
new() {
        filename=$1
        kind=$2
        imports="import java.io.*;\nimport java.util.*;\n\n"
        classdef="public class $filename {\n\t"
        main="public static void main(String[] args)throws Exception{\n"
        constructor="public $filename (){\n\n\t}//end of constructor"
        inout="\t\tScanner in = new Scanner(new File(\"$filename.in\"));\n\t\tPrintStream out = new PrintStream(new File(\"$filename.out\"));\n\n\t}//end of main"
        footers="\n}//end of class $filename"
        if [ "$kind" = "0" ]; then
                echo -e "$classdef $constructor $footers" > $filename.java
        else
                echo -e "$imports $classdef $main $inout $footers" > $filename.java
        fi
}

CMD::Quick upload prep for Visual Studio projects

posted Apr 23, 2011, 5:05 PM by Chairman Steve   [ updated Apr 23, 2011, 7:37 PM ]

All this script does is zip the release exe, and bring it to the top. This needs to be in the top level of the project directory. Don't Forget to set the setupdir variable. This is the variable that tells the script where to find the setup file.

requires winrar in the paths environment variable.


@rem prep_uploads.bat
@rem Usage: place inside main Visual Studio project folder. execute.

@rem rar a -afzip -r -p%3 %2.zip %1\*.*
@echo off
set setupdir=SolSwapSetup
:: retrieving  name of current directory
for %%* in (.) do set MyDir=%%~n*
:: adding safety factor for no directory, i.e a drive
if not defined MyDir set MyDir=%CD:\=%
:: telling you what it is
:: echo the current directory is %MyDir%
cd %MyDir%\%MyDir%\bin\Release
ECHO %CD%
IF EXIST "%MyDir%.zip" DEL /Q "%MyDir%.zip"
winrar a -afzip "%MyDir%.zip" "%MyDir%.exe"
echo "%~DP0%MyDir%"
copy /B "%MyDir%.zip" "%~DP0"
cd "%~DP0"
copy /B "%~DP0%setupdir%\%setupdir%\release\*.msi" "%~DP0"

CMD::Convert a directory containing wavs into mp3 using vlc

posted Apr 23, 2011, 5:01 PM by Chairman Steve   [ updated Apr 23, 2011, 8:32 PM ]

You must have VLC added to your paths environment variable for this to work. File names cannot contain apostrophe ( ' ) character.

@rem transcode_wav_dir.bat
@rem Usage: convert a dir of wavs into mp3 using vlc

@echo off
SET filename=^"^"
FOR /F "tokens=*" %%G IN ('dir /b *.wav') DO (call :s_do_convert "%%G")
GOTO :end

:s_do_convert
 SET filename=%1
 ECHO %filename%
 vlc %filename% --no-sout-video --sout "#transcode{acodec=mp3}:std{access=file,mux=raw,dst='%filename:~1,-5%.mp3'}"
 GOTO :eof

:end
 PAUSE

1-5 of 5