@echo off

color 0a

cls

setlocal enabledelayedexpansion

echo Draw image below.

set deafaultcolor=0

REM Line stuff.

REM setting stuff.

:reset

set color0_0=%deafaultcolor%

set color1_0=%deafaultcolor%

set color2_0=%deafaultcolor%

set color3_0=%deafaultcolor%

set color4_0=%deafaultcolor%

set color5_0=%deafaultcolor%

set color6_0=%deafaultcolor%

set color7_0=%deafaultcolor%

set color0_1=%deafaultcolor%

set color1_1=%deafaultcolor%

set color2_1=%deafaultcolor%

set color3_1=%deafaultcolor%

set color4_1=%deafaultcolor%

set color5_1=%deafaultcolor%

set color6_1=%deafaultcolor%

set color7_1=%deafaultcolor%

set color0_2=%deafaultcolor%

set color1_2=%deafaultcolor%

set color2_2=%deafaultcolor%

set color3_2=%deafaultcolor%

set color4_2=%deafaultcolor%

set color5_2=%deafaultcolor%

set color6_2=%deafaultcolor%

set color7_2=%deafaultcolor%

set color0_3=%deafaultcolor%

set color1_3=%deafaultcolor%

set color2_3=%deafaultcolor%

set color3_3=%deafaultcolor%

set color4_3=%deafaultcolor%

set color5_3=%deafaultcolor%

set color6_3=%deafaultcolor%

set color7_3=%deafaultcolor%

set color0_4=%deafaultcolor%

set color1_4=%deafaultcolor%

set color2_4=%deafaultcolor%

set color3_4=%deafaultcolor%

set color4_4=%deafaultcolor%

set color5_4=%deafaultcolor%

set color6_4=%deafaultcolor%

set color7_4=%deafaultcolor%

set color0_5=%deafaultcolor%

set color1_5=%deafaultcolor%

set color2_5=%deafaultcolor%

set color3_5=%deafaultcolor%

set color4_5=%deafaultcolor%

set color5_5=%deafaultcolor%

set color6_5=%deafaultcolor%

set color7_5=%deafaultcolor%

set color0_6=%deafaultcolor%

set color1_6=%deafaultcolor%

set color2_6=%deafaultcolor%

set color3_6=%deafaultcolor%

set color4_6=%deafaultcolor%

set color5_6=%deafaultcolor%

set color6_6=%deafaultcolor%

set color7_6=%deafaultcolor%

set color0_7=%deafaultcolor%

set color1_7=%deafaultcolor%

set color2_7=%deafaultcolor%

set color3_7=%deafaultcolor%

set color4_7=%deafaultcolor%

set color5_7=%deafaultcolor%

set color6_7=%deafaultcolor%

set color7_7=%deafaultcolor%

set mouseDraw=false

set mouse1=3

set mouse2=0

goto cmdIn

:drawLoop

DrawImage %color0_0% %color0_1% %color0_2% %color0_3% %color0_4% %color0_5% %color0_6% %color0_7% %color1_0% %color1_1% %color1_2% %color1_3% %color1_4% %color1_5% %color1_6% %color1_7% %color2_0% %color2_1% %color2_2% %color2_3% %color2_4% %color2_5% %color2_6% %color2_7% %color3_0% %color3_1% %color3_2% %color3_3% %color3_4% %color3_5% %color3_6% %color3_7% %color4_0% %color4_1% %color4_2% %color4_3% %color4_4% %color4_5% %color4_6% %color4_7% %color5_0% %color5_1% %color5_2% %color5_3% %color5_4% %color5_5% %color5_6% %color5_7% %color6_0% %color6_1% %color6_2% %color6_3% %color6_4% %color6_5% %color6_6% %color6_7% %color7_0% %color7_1% %color7_2% %color7_3% %color7_4% %color7_5% %color7_6% %color7_7%

goto cmdIn

:cmdIn

set mouse=false

chgcolor 0a

set /p in=Command:

if "%in:~0,1%"=="?" goto getHelp

if "%in:~0,1%"=="s" goto set

if "%in:~0,1%"=="d" goto drawLoop

if "%in:~0,1%"=="q" goto exit

if "%in:~0,1%"=="r" (

set deafaultcolor=%in:~2,1%0

set deafaultcolor=!deafaultcolor:~0,1!

REM echo !deafaultcolor!

REM if not defined deafaultcolor set deafultcolor=0

goto reset

)

if "%in:~0,1%"=="o" goto getEffectiveNum

if "%in:~0,1%"=="e" goto echo

if "%in:~0,1%"=="i" goto iso

if "%in:~0,1%"=="v" goto isoOut

if "%in:~0,1%"=="m" (

set mousedraw=true

goto mouseSet

)

echo Unknown command; type ? for help.

goto cmdIn

:echo

echo %in:~2%

goto cmdIn

:getHelp

echo Help is not yet implimented.

goto cmdIn

:iso

cls

if "%in:~2,1%"=="" set in=i 0

DrawImageIso2 %in:~2,1% %color0_0% %color0_1% %color0_2% %color0_3% %color0_4% %color0_5% %color0_6% %color0_7% %color1_0% %color1_1% %color1_2% %color1_3% %color1_4% %color1_5% %color1_6% %color1_7% %color2_0% %color2_1% %color2_2% %color2_3% %color2_4% %color2_5% %color2_6% %color2_7% %color3_0% %color3_1% %color3_2% %color3_3% %color3_4% %color3_5% %color3_6% %color3_7% %color4_0% %color4_1% %color4_2% %color4_3% %color4_4% %color4_5% %color4_6% %color4_7% %color5_0% %color5_1% %color5_2% %color5_3% %color5_4% %color5_5% %color5_6% %color5_7% %color6_0% %color6_1% %color6_2% %color6_3% %color6_4% %color6_5% %color6_6% %color6_7% %color7_0% %color7_1% %color7_2% %color7_3% %color7_4% %color7_5% %color7_6% %color7_7%

goto cmdIn

:isoOut

ExportTriags %color0_0% %color0_1% %color0_2% %color0_3% %color0_4% %color0_5% %color0_6% %color0_7% %color1_0% %color1_1% %color1_2% %color1_3% %color1_4% %color1_5% %color1_6% %color1_7% %color2_0% %color2_1% %color2_2% %color2_3% %color2_4% %color2_5% %color2_6% %color2_7% %color3_0% %color3_1% %color3_2% %color3_3% %color3_4% %color3_5% %color3_6% %color3_7% %color4_0% %color4_1% %color4_2% %color4_3% %color4_4% %color4_5% %color4_6% %color4_7% %color5_0% %color5_1% %color5_2% %color5_3% %color5_4% %color5_5% %color5_6% %color5_7% %color6_0% %color6_1% %color6_2% %color6_3% %color6_4% %color6_5% %color6_6% %color6_7% %color7_0% %color7_1% %color7_2% %color7_3% %color7_4% %color7_5% %color7_6% %color7_7%

goto cmdIn

:mouseSet

if %mousedraw%==true (

::cls

DrawImage %color0_0% %color0_1% %color0_2% %color0_3% %color0_4% %color0_5% %color0_6% %color0_7% %color1_0% %color1_1% %color1_2% %color1_3% %color1_4% %color1_5% %color1_6% %color1_7% %color2_0% %color2_1% %color2_2% %color2_3% %color2_4% %color2_5% %color2_6% %color2_7% %color3_0% %color3_1% %color3_2% %color3_3% %color3_4% %color3_5% %color3_6% %color3_7% %color4_0% %color4_1% %color4_2% %color4_3% %color4_4% %color4_5% %color4_6% %color4_7% %color5_0% %color5_1% %color5_2% %color5_3% %color5_4% %color5_5% %color5_6% %color5_7% %color6_0% %color6_1% %color6_2% %color6_3% %color6_4% %color6_5% %color6_6% %color6_7% %color7_0% %color7_1% %color7_2% %color7_3% %color7_4% %color7_5% %color7_6% %color7_7%

set mousedraw=false

MenuBar

REM if %mousedraw%==doing (

REM set mousedraw=done

REM chgcolor 5a

REM echoj " " $0a " "

REM chgcolor 0a

REM echoj " "

REM chgcolor 8a

REM echoj " "

REM chgcolor 7a

REM echoj " "

REM chgcolor fa

REM echoj " "

REM chgcolor 5a

REM echoj " " $0a " " $0a $0a

REM chgcolor 0a

REM echoj " "

REM chgcolor 4f

REM echoj ^>^< $0a

REM chgcolor 0a

REM echoj $0a " "

REM chgcolor 2a

REM echoj ^<^> $0a

REM chgcolor 0a

)

chgcolor 0a

For /f "tokens=1,2,3" %%a in ('Mouse.exe 2^>Nul') Do (

Set "x=%%b"

set "y=%%c"

Set /a "c=%%a"

)

set /a x=%x%/2

if %x% LEQ 7 (

if %y% LEQ 7 (

set /a color%x%_%y%=mouse%c% + 0

set /a c_OLD=mouse!c! + 0

set c_NEW=0

::echoj !c_OLD!,!c_NEW!;

if "!c_OLD!"=="3" set c_NEW=0

if "!c_OLD!"=="2" set c_NEW=8

if "!c_OLD!"=="1" set c_NEW=7

if "!c_OLD!"=="0" set c_NEW=15

SetPixel %x% %y% !c_NEW!

goto mouseSet

)

)

if %y%==9 (

set n=5

REM if %x%==4 set n=3

REM if %x%==5 set n=3

REM if %x%==6 set n=2

REM if %x%==7 set n=2

REM if %x%==8 set n=1

REM if %x%==9 set n=1

REM if %x%==10 set n=0

REM if %x%==11 set n=0

if %x%==2 set n=3

if %x%==3 set n=2

if %x%==4 set n=1

if %x%==5 set n=0

if not !n!==5 set mouse%c%=!n!

)

if %y%==12 (

if %x%==4 goto cmdin

REM if %x%==9 goto cmdin

)

if %y%==14 (

if %x%==4 set mousedraw=true

rem if %x%==9 set mousedraw=true

)

goto mouseSet

:set

set inX=%in:~2,1%

set inY=%in:~4,1%

set inColor=%in:~6,1%

set color%inX%_%inY%=%inColor%

goto cmdIn

:getEffectiveNum

set x=0

set y=0

set "result= "

set currentDark=0

::set currentDark1=0

set currentLight=0

::set currentLight1=0

set currentBit = 0

:getNumLoop

REM if %x%==4 (

REM set curentDark1=%currentDark%

REM set currentDark=0

REM set curentLight1=%currentLight%

REM set currentLight=0

REM )

if %x%==8 (

set x=0

set /a y=y+1

::set result=%result%%currentDark1%%currentDark%, 0x%currentLight1%%currentLight%, 0x

set result=%result%%currentDark%,%currentLight%,

REM Adds the 2 hex digits to the end.

set currentDark=0

set currentLight=0

)

if %y%==8 (

echo %result%

goto cmdIn

)

set /a currentBit = color%x%_%y% + 0

set /a currentDark=(%currentDark% * 2) + (%currentBit% ^& 1 )

set /a currentLight=(%currentLight% * 2) + ((%currentBit% ^& 2) / 2)

set /a x=x+1

goto getNumLoop

goto cmdIn

:exit

echo Are you sure?

choice

if %errorlevel%==2 goto cmdIn