Discuss Scratch

lol90
Scratcher
500+ posts

I'm finally learning how to script in another programming language!

Today, I started a new game called “Why is You and Who are Me”, a text-based adventure. The entire thing will be written in Batch. It's quite easy to learn after 30 minutes or so. I really hope it goes well enough to be publicly released. Wish me luck!


The end.
turkey3
Scratcher
1000+ posts

I'm finally learning how to script in another programming language!

Cool! If you get a chance, check out codecademy.com.

Before I knew any other languages and only new scratch, I used to think other languages used blocks

Last edited by turkey3 (Feb. 22, 2014 01:23:32)


lol90
Scratcher
500+ posts

I'm finally learning how to script in another programming language!

turkey3 wrote:

Cool! If you get a chance, check out codecademy.com.

Before I knew any other languages and only new scratch, I used to think other languages used blocks

Does it teach Batch?

And I knew that other languages used a bunch of * I couldn't understand at the time.

From what I've heard, the best way to learn C# and JavaScript is by using Batch first.

Although I've ran into a problem already. I've looked all over and no answers were found. When I tried making a multiple choice question, when you typed “look (something)”, it would just go back to cmd.exe instead of continuing the game. I also tried typing in some other stuff, and it only came up with the first response. The script looks like this so far:

@echo off
echo “Wake up…”
pause
echo “Wake up.”
pause
echo “WAKE UP!!!!”
pause
echo “Phew. Glad you're awake. Now I know you just moved in, but you gotta see all the sights! Come on!”
pause
goto repeat1

:repeat1
echo You are in a room with a painting, some plants and tables, two beds, a doormat, a door, and a guy standing near you.
goto problem1

:problem1
set/p options1= What will you do?
if %options1%==look door goto door1
if %options1%==look guy goto guy1
if %options1%==look plants goto plants1
if %options1%==look tables goto tables1
if %options1%==look doormat goto doormat1
if %options1%==look painting goto painting1
if %options1%==look beds goto beds1
if %options1%==repeat goto repeat1
if %options1%==look under pillow goto under pillow1
if %options1%==look paper goto paper1
if %options1%==look pillow goto pillow1
if %options1%==open door goto ?
if %options1%==talk to guy goto guyspeak1
if %options1%==talk guy goto guyspeak1

:door1
echo It's a door. You open these.
goto problem1

:guy1
echo The guy is 5 foot 11. He is wearing a blue shirt and brown pants. He looks eager to go outside.
goto problem1

:plants1
echo Aww, cute. Someone decorated the place. Maybe it's the guy?
goto problem1

:tables1
echo Nothing much here. There is, however, a piece of paper on the table.
goto problem1

:doormat1
echo Usually there would be something cool under one of these. Try looking under it to find out what is under there!
goto problem1

:painting1
echo _________
echo | 0 0 |
echo | \____/ |
echo —————–
echo Not that pretty, but hey, it's a free picture. Also, there seems to be a note stuck to it.
goto problem1

:beds1
There are two beds on the opposite side of each other. One of them has something under a pillow.

:under pillow1
Under the pillow is a key!
set/p options2=Want to take the key?
if %options2%==yes goto key taken
if %options2%==y goto key taken
if %options2%==no goto problem1
if %options2%==n goto problem1

Anything that could be fixed?


The end.
AonymousGuy
Scratcher
1000+ posts

I'm finally learning how to script in another programming language!

Well you can't include spaces because that just doesn't work.

So when it does the “if %options1% == look door goto door1”, it is executing the command “door goto”, because a space shows that that is the end of the condition to be evaluated.
lol90
Scratcher
500+ posts

I'm finally learning how to script in another programming language!

AonymousGuy wrote:

Well you can't include spaces because that just doesn't work.

So when it does the “if %options1% == look door goto door1”, it is executing the command “door goto”, because a space shows that that is the end of the condition to be evaluated.

So instead of “if %options1%==look door goto door1”, I should try “lookdoor goto door1”? Or is this still not right?


The end.
fission
Scratcher
57 posts

I'm finally learning how to script in another programming language!

I highly recommend that you learn Java or C#. Batch is very limited and not really like any other widely used language.

Christiaan Huygens is my arch-nemesis!
lol90
Scratcher
500+ posts

I'm finally learning how to script in another programming language!

fission wrote:

I highly recommend that you learn Java or C#. Batch is very limited and not really like any other widely used language.

I'm using it as my starting point for programming. I'll use Batch first, then if I get good at that, I'll try another language, and so on and so forth.

Batch may be a (removed by moderator - please keep it polite) language, but it's a pretty good place to start for those who don't know anything about coding (besides Scratch or Stencyl.)

Last edited by Paddle2See (April 7, 2014 23:46:21)



The end.
turkey3
Scratcher
1000+ posts

I'm finally learning how to script in another programming language!

lol90 wrote:

fission wrote:

I highly recommend that you learn Java or C#. Batch is very limited and not really like any other widely used language.

I'm using it as my starting point for programming. I'll use Batch first, then if I get good at that, I'll try another language, and so on and so forth.

Batch may be a (removed by moderator - please keep it polite) language, but it's a pretty good place to start for those who don't know anything about coding (besides Scratch or Stencyl.)
Basic HTML is pretty simple.

Last edited by Paddle2See (April 7, 2014 23:46:44)


AonymousGuy
Scratcher
1000+ posts

I'm finally learning how to script in another programming language!

turkey3 wrote:

Basic HTML is pretty simple.
(Eh ehm, isn't HTML a markup language? )

You can actually do quite a bit with Batch, and I recommend knowing a little bit so you can write a compiler script for .java files if you ever want to learn Java.
turkey3
Scratcher
1000+ posts

I'm finally learning how to script in another programming language!

AonymousGuy wrote:

turkey3 wrote:

Basic HTML is pretty simple.
(Eh ehm, isn't HTML a markup language? )

You can actually do quite a bit with Batch, and I recommend knowing a little bit so you can write a compiler script for .java files if you ever want to learn Java.
Mindless of it's name, it is still useful in web development.

lol90
Scratcher
500+ posts

I'm finally learning how to script in another programming language!

I converted the batch file into a vbs script, so no more worrying that the batch file will destroy the universe or anything!


The end.

Powered by DjangoBB