Page 1 of 1

[Release] SDraw ( A batch .EXE helper )

Posted: 02 May 2016 19:18
by SirJosh3917
Hello! This is my first post on this forums, of which has been very helpful to me :mrgreen:
Recently I've been coding in C#, and decided to make a cool little tool to help me and you guys out!
All you need is a windows computer, and the .NET 2.0 or later framework installed!

Also, before I dive any deeper into this SDraw thing, just know that SDraw draws pretty pictures and can detect mouse X and Y.
Image

If you would like to skip me rambling on in text, and hear a kid scream in your ear, go here: https://youtu.be/02Q9Miii26o ( That kid is me)

But all you have to do is goto http://josh0n.weebly.com/batch.html and download SDraw from the Batch .EXE Tools
Then once you download it, look inside SDraw, and there will be 2 folders.
One is called "Example" and the other is called "SDraw Programs". The example has a screen that looks like the picture you saw above, and the other folder has a readme.txt, "SDraw", and "SDraw Image Creator". The image creator lets you draw images for SDraw, and SDraw are all the files you'll need to use SDraw.

For reference, here is an example batch file using SDraw to draw a picture get the user's X and Y

Code: Select all

@echo off
setlocal enabledelayedexpansion

sdraw /img 0 0 pic.txt

sdraw /click

::READ CODE
::make sure you have already "setlocal enabledelayedexpansion" , else, uncomment this next line of code
::setlocal enabledelayedexpansion
set c=0
for /f "delims=~" %%A in (mouse.txt) do (
if "!c!" == "0" set x=%%A
if "!c!" == "1" set y=%%A
set /a c=!c!+1
)

echo X: !x! Y: !y!
pause


Here is the readme, because it contains almost all the information you need to know about SDraw. The video contains the rest:

Code: Select all


-------------------
EASY IMAGE CREATION
-------------------
Use SDraw Image Creator to easily create images!
Just click on a color in the second row
and draw somewhere in the console!
Then click the save button and it's saved as "pic.txt"
Easy as pie!

----
CREATING IMAGES
----
Draw images using the image editor tool, or you can type
E.X:
if you type "color /?" into the color it gives you some numbers and letters meaning a color
such as how you do "color 0a", black background light green foreground
so draw an image with the color you want to show:
00EEE00
0E000E0
0E000E0
0E000E0
00EEE00

E is a light yellow, 0 is a black.
Can you guess what it'd draw:
----
DRAWING IMAGES
----
Type "sdraw /img x y imgname" to draw an image at x, y
E.X.
Lets say we used the image above.
we saved the image as "face.txt" and we want to draw it at 0, 0
sdraw 0 0 face.txt
then the program would draw it.
NOTE: if you don't understand console X and Y,
*X axis     1
Y*01234567890
 0
a1
x2
i3
s4
 5
 6
 7
 8
 9
10
----
GETTING MOUSE
----
the other useful thing about SDraw is how you can get the mouse
using "sdraw /click" you can get the user to click
then "sdraw /click x" grabs the x of the click
"sdraw /click y" grabs the y of the click
E.X.

EXAMPLE CODE:

sdraw /click

sdraw /click x
echo X: %errorlevel%
sdraw /click y
echo Y: %errorlevel%

NOTICE: sometimes this method of getting x and y is not always reliable. You'll need
to read from the "mouse.txt" file yourself to correctly get the X and Y.

Some code reading the file:

::READ CODE
::make sure you have already "setlocal enabledelayedexpansion" , else, uncomment this next line of code
::setlocal enabledelayedexpansion
set c=0
for /f "delims=~" %%A in (mouse.txt) do (
if "!c!" == "0" set x=%%A
if "!c!" == "1" set y=%%A
set /a c=!c!+1
)

echo X: !x! Y: !y!

----


Re: [Release] SDraw ( A batch .EXE helper )

Posted: 03 May 2016 05:11
by misol101
Kind of funny, another batch .exe helper posted the same day as mine... they must be a dime a dozen! :)

But I suppose it also means a lot of people want this kind of functionality.

I'll check out your program.