Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Teehee, batch scripts  (Read 1802 times)

FluffyToast J

  • Bay Watcher
    • View Profile
Teehee, batch scripts
« on: October 25, 2009, 04:55:48 am »

So I wrote a batch script that I can run from Steam to let me play any number of versions of DF that I want. Basicly, when you run it, it asks you what version you want to play. Then, after hitting a number, it shows you a pretty little screen with DWARF FORT on it. Then it runs the dwarfort.exe in the path you specified for it.

Screenshots:



Download:
http://dffd.wimbli.com/file.php?id=1566

I realise this is very silly. I had fun doing it. And, if you ask for a download, you'll end up having to configure the paths yourself, since all our computers are different.

Post what your batch scripts (if any) can do ^_^
« Last Edit: November 07, 2009, 06:39:05 pm by Manifold1 »
Logged

IndonesiaWarMinister

  • Bay Watcher
    • View Profile
Re: Teehee, batch scripts
« Reply #1 on: October 25, 2009, 06:45:23 am »

What, want!
Logged

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Teehee, batch scripts
« Reply #2 on: October 25, 2009, 01:27:12 pm »

All mine do is
Code: [Select]
gcc {stuff}
pause

It's all that I need them to do, though.
Logged
Eh?
Eh!

Mr Tk

  • Bay Watcher
  • Would you like a mint? It's only waffer thin.
    • View Profile
Re: Teehee, batch scripts
« Reply #3 on: October 25, 2009, 07:25:25 pm »

Code: [Select]
gcc {stuff}
pause

It's a make file except not!
Logged
First ten minutes of play I ate my loincloth and then got some limbs torn off by a super friendly rat. Thumbs up from me.

SolarShado

  • Bay Watcher
  • Psi-Blade => Your Back
    • View Profile
Re: Teehee, batch scripts
« Reply #4 on: October 28, 2009, 04:10:32 pm »

That is a cool batch script Manifold, care to post it? I'd really like to know how you changed the BG color...

I made a script to backup files, had to tweak it just earlier today. Nothting really interesting, just a bunch of xcopy {fuzz} > nuls and echos.
Logged
Avid (rabid?) Linux user. Preferred flavor: Arch

FluffyToast J

  • Bay Watcher
    • View Profile
Re: Teehee, batch scripts
« Reply #5 on: October 29, 2009, 12:04:01 am »

Alright, I'll post it up soonish. When you get it, you'll have to configure the file paths yourself. I can post a how-to on that if people want, too.

As for the background colour, you'll be able to get that from the script.
Logged

Killas[SiN]

  • Bay Watcher
  • [SiN]
    • View Profile
Re: Teehee, batch scripts
« Reply #6 on: November 04, 2009, 05:57:18 am »

Woooah looks awesome...
Could you post a how-to please?
Help us technologically disabled ones here :o
Logged
You should make Korean pros into game-ending, SPEED:0 megabeasts.
A Jaedong appears at your fort.
DF: gg
DF has left the game.

Sensei

  • Bay Watcher
  • Haven't tried coffee crisps.
    • View Profile
Re: Teehee, batch scripts
« Reply #7 on: November 04, 2009, 01:30:44 pm »

Probably goes without saying for most, but I might as well say...

HOW TO MAKE A .BAT FILE
For Beginners

-Open up Notepad
-Type script hoohah (this you will just have to research)
-Save as...
-Select the file type 'any'
-Use Filename.bat as the name (wherein 'filename' is whatever you want)
-Click file to run, or right click > open with notepad to edit
-DON'T USE WORDPAD
Logged
Let's Play: Automation! Bay 12 Motor Company Buy the 1950 Urist Wagon for just $4500! Safety features optional.
The Bay 12 & Mates Discord Join now! Voice/text chat and play games with other Bay12'ers!
Add me on Steam: [DFC] Sensei

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Teehee, batch scripts
« Reply #8 on: November 04, 2009, 06:06:11 pm »

Or, simply rename a .txt to end in .bat. This only works if folder options->hide extensions of known file types is OFF.

How else would I mass produce .c and .h files?
Logged
Eh?
Eh!

FluffyToast J

  • Bay Watcher
    • View Profile
Re: Teehee, batch scripts
« Reply #9 on: November 07, 2009, 07:32:01 am »

INCOMING BATCH FILE UPLOAD IMMINENT.

STANDBY...

BATCH FILE RECEIVED.

http://dffd.wimbli.com/file.php?id=1566

Readme is included. Have fun ^_^
« Last Edit: November 07, 2009, 07:36:07 am by Manifold1 »
Logged

SolarShado

  • Bay Watcher
  • Psi-Blade => Your Back
    • View Profile
Re: Teehee, batch scripts
« Reply #10 on: November 07, 2009, 07:49:48 pm »

Got it.

Hmm... My dos-style scripting is a little rusty, but there should be a way to re-use that banner code, without having to copy it each time that is...

I know bash will let you define functions...
Logged
Avid (rabid?) Linux user. Preferred flavor: Arch

Killas[SiN]

  • Bay Watcher
  • [SiN]
    • View Profile
Re: Teehee, batch scripts
« Reply #11 on: November 07, 2009, 08:23:32 pm »

Awesome thanks...

Time to read up on it..
Logged
You should make Korean pros into game-ending, SPEED:0 megabeasts.
A Jaedong appears at your fort.
DF: gg
DF has left the game.

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Teehee, batch scripts
« Reply #12 on: November 07, 2009, 08:30:55 pm »

Probably copy it upwards, to before the if block.

Better, put the exit if first, then the text display, then the version if block.

Also, the goto 1: could be cut out entirely, or some sort of "that is not an option" should be put in, otherwise it is a wasted branch check, and as everyone knows, it is always better to conserve a few CPU cycles, because these are the days of DOS when you only have 64k memory for both the program being run and all it's data....

(But seriously, that if for 1 is unneeded, if my experience with C means anything Tested, anything not handled DOES fall through into 1:)

(This may only be a problem on XP)
Also: The E option was both:
  • broken
  • case sensitive


I modified it. It should work better, at least on XP, and be much easier to add to, and be smaller in general.

It is not perfect, but the code is shrunk, both e and E exit, and invalid options are handled.
There is a C: on it's own, this handles the situation where you aren't already in the C drive, and cd won't work. All paths are in quotations, just in case.
Spoiler (click to show/hide)

I left all the old options in place, as examples, but you would have to edit the path and possibly the drive. Fortunately, they are both in the same place, at the top of the file, so you only need to change them once.
Logged
Eh?
Eh!

FluffyToast J

  • Bay Watcher
    • View Profile
Re: Teehee, batch scripts
« Reply #13 on: November 07, 2009, 08:48:51 pm »

Well, that does cut out alot of code. Keep in mind I'm an absolute beginner at this stuff. Very nice, qwerty.
Logged