Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Batch Scripts

Author
Message
XdaZylax
14
Years of Service
User Offline
Joined: 21st Apr 2012
Location:
Posted: 21st Apr 2012 13:47
Im not sure if you can help me but a friend refered me to these forums.

Im trying to create a simple text based maths tutor type program.
at the moment im trying to get a part of it so it asks a question (done)
you can input an answer (done)
then use an if statement to see whether the answer equals a set answer known as %test2% and if it does it runs a command (done)

however im having trouble with the FALSE part of the statement
where if it doesnt equal the correct answer it does a certain command.

here's the command im using,

pause> Press Enter to Continue
set %test2%=10
set /p test1=does, 5 + 5 = 10? (input)
if %test1%==10 echo q2.bat
if [not] %test1%==%test2% echo Bad Luck

any help will be appreciated

Legacy *nods head cooly*
XdaZylax
14
Years of Service
User Offline
Joined: 21st Apr 2012
Location:
Posted: 21st Apr 2012 15:24
I figured it out
If anyone else has any trouble using IF ELSE scripts in DOS

here is a snippet of what i did to resolve it.

:START

set /p name=Please enter your name (input)

IF "%name%"=="" (
ECHO No name is Entered!!
echo.
GoTo :START
) ELSE (
GoTo :WELCOME
)
::End of name

Legacy *nods head cooly*
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st Apr 2012 15:37
Get the free DBPro, you can make it way more interesting.

XdaZylax
14
Years of Service
User Offline
Joined: 21st Apr 2012
Location:
Posted: 21st Apr 2012 15:44
Yes, I've got it.
But I'm only learning the basics of Programming at the moment.
I am quite Adept in design HTML
and i can do alot of system based Batch commands.

So at the moment I am trying to learn the programming Batch Commands to make text based Games etc.

For DBPro, i don't know any language to use it yet

Legacy *nods head cooly*
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 21st Apr 2012 16:25
Is there any particular reason for doing this with batch files? The syntax can be pretty tricky to get right, and can have slightly differing behaviour across different versions of Windows.



Support a charitable indie game project!
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 21st Apr 2012 16:41 Edited at: 21st Apr 2012 16:44
^^agreed with pincho
you seem to have a basic grasp of programming logic
there is no end to the fun learning games you can create with dark basic pro.
its free to use until you want to make money from it and then its only $50 which is an absolute steal.


you will find all the help and guidance you could ever need here.
welcome to the community.
kezzla

Sometimes I like to use words out of contents
XdaZylax
14
Years of Service
User Offline
Joined: 21st Apr 2012
Location:
Posted: 22nd Apr 2012 04:28
I don't know any of the language for it.
Any links to beginners tutorials etc would be helpful.

Legacy *nods head cooly*
ShaunRW
DBPro Developer
18
Years of Service
User Offline
Joined: 7th Jan 2008
Location: Brisbane, Australia
Posted: 22nd Apr 2012 06:29
Yeah use DBPro, I find it easier than writing batch scripts.

XdaZylax
14
Years of Service
User Offline
Joined: 21st Apr 2012
Location:
Posted: 22nd Apr 2012 08:32
haha, I have no idea how to use DBPro yet?
I'm trying to learn basic scripting, and from what i've seen and tried batch scripting is easier.

If any could send me to some type of tutorial for DBPro it would be appreciated

Legacy *nods head cooly*
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 22nd Apr 2012 09:37
Use tdk's tutorials. they are what I used when I was starting out, and i still use them as i progress with my programming.
http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

another resource is to open up the dark basic ide and press f1 for the help menu.

dbPro has a really good help system.
id start with the introduction, getting started and in particular the principals section.

when i first started i read the principals section and as new commands were introduced i wrote little programs that use them creatively.

and of course there is the DBPro newcomers forum where you can ask all the questions you want. there are a lot of really gifted programmers who frequent that forum to offer help to beginners.

Sometimes I like to use words out of contents
XdaZylax
14
Years of Service
User Offline
Joined: 21st Apr 2012
Location:
Posted: 22nd Apr 2012 12:24
ok thanks
i like knowing a lot of programming languages, so i'll finish what i'm doing with Batch, and then i'll start with DBPro.

Hopefully i can get the hang of it.
im pre adept with design HTML and CSS
i know some javascript
and at the rate im going at the moment, im pretty good with Batch,

I will prop look up the forums once i get started with DBPro

Legacy *nods head cooly*
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 22nd Apr 2012 13:52
Quote: "I don't know any of the language for it.
Any links to beginners tutorials etc would be helpful."


Well the code you posted....


:START

set /p name=Please enter your name (input)

IF "%name%"=="" (
ECHO No name is Entered!!
echo.
GoTo :START
) ELSE (
GoTo :WELCOME
)
::End of name


.... is very similar to the code in DBPro.

Login to post a reply

Server time is: 2026-07-21 20:38:59
Your offset time is: 2026-07-21 20:38:59