Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Civilization (Non-Windows Systems/Platforms) > Anybody want to write an applescript?
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
CivGroups
Mac (62): Not a Member - Join

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Smash is offline Smash
Emperor
Civ2 Diehard
Jul 1999
time: 21:14
Talking  Old Post 11-10-2000 06:31
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Anybody want to write an applescript? Support Apolyton, buy GURPS/ Alpha Centauri

Cuz I don't know how.And so far,attempts at learning have been highly unsuccessful.

I need one for this.It tells which events.txt to load.They can be loaded manually but it would be nice to have it automated.


@echo off
cls
echo.
echo 2194 Days of War
echo.
echo Loading event files for play as specific nation
echo Please choose from the options below:
echo.
echo 1. Load German event file
echo 2. Load Soviet event file
echo 3. Load American event file
echo 4. Load British event file
echo 5. Load Japanese event file
echo X. Exit without Loading
echo.
choice /c:12345X Enter your selection

if errorlevel 6 goto done
if errorlevel 5 goto japanese
if errorlevel 4 goto british
if errorlevel 3 goto american
if errorlevel 2 goto soviet
if errorlevel 1 goto german

:german
echo.
echo Loading German Game
copy events1.txt events.txt
copy rules1.txt rules.txt
copy sound\Jetbomb.wav sound\Extra2.wav
copy sound\Jetbomb.wav sound\Extra3.wav
copy sound\Mchnguns.wav sound\Swrdhors.wav
copy sound\Extra1.wav sound\Extra6.wav
copy sound\Cavalry.wav sound\Extra8.wav
goto done

:soviet
echo.
echo Loading Soviet Game
copy events2.txt events.txt
copy rules2.txt rules.txt
copy sound\Jetbomb.wav sound\Extra2.wav
copy sound\Jetbomb.wav sound\Extra3.wav
copy sound\Mchnguns.wav sound\Swrdhors.wav
copy sound\Extra1.wav sound\Extra6.wav
copy sound\Cavalry.wav sound\Extra8.wav
goto done

:american
echo.
echo Loading American Game
copy events3.txt events.txt
copy rules2.txt rules.txt
copy sound\Jetbomb.wav sound\Extra2.wav
copy sound\Jetbomb.wav sound\Extra3.wav
copy sound\Mchnguns.wav sound\Swrdhors.wav
copy sound\Extra1.wav sound\Extra6.wav
copy sound\Cavalry.wav sound\Extra8.wav
goto done

:british
echo.
echo Loading British Game
copy events4.txt events.txt
copy rules2.txt rules.txt
copy sound\Jetbomb.wav sound\Extra2.wav
copy sound\Jetbomb.wav sound\Extra3.wav
copy sound\Mchnguns.wav sound\Swrdhors.wav
copy sound\Extra1.wav sound\Extra6.wav
copy sound\Cavalry.wav sound\Extra8.wav
goto done

:japanese
echo.
echo Loading Japanese Game
copy events5.txt events.txt
copy rules1.txt rules.txt
copy sound\Jetbomb.wav sound\Extra2.wav
copy sound\Jetbomb.wav sound\Extra3.wav
copy sound\Mchnguns.wav sound\Swrdhors.wav
copy sound\Extra1.wav sound\Extra6.wav
copy sound\Cavalry.wav sound\Extra8.wav
goto done

:done
echo.
exit
quit

ps..I am holding my breath...

RNF is offline RNF
Settler
Wilton, NH USA
Nov 2000
time: 05:14
Arrow  Old Post 02-11-2000 00:50 Visit RNF's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Increase the size of your Attachments

Ok, here's a try at an Applescript to do what you want.

The batch file above seems to do three things:


  1. It copies one of the files events1.txt, events2.txt, ... events5.txt to events.txt, depending on the country you choose.
  2. It copies one of the files rules1.txt or rules2.txt to rules.txt, depending on whether your'e playing an Axis or Allied country.
  3. It unconditionally copies a bunch of sound files.


It appears that the sound files in use are never actually changed, so the last point seems to be useless, and I didn't bother implementing it. This script just does the first two points.

The script is located at http://www.jlc.net/~faiman/update_events.sit . If you're lucky, you can just click on the link and your browser will automatically download the file and unstuff it for you, leaving you with an Applescript applet file named "Update 2194 Days Events". If your browser tries to display the link as a bunch of gibberish instead of downloading, you'll have to control click, click-and-hold, or whatever you do in your particular browser to get a contextual menu that lets you say "download this file to disk". If you get update_events.sit on your disk, but it isn't automatically expanded, then you'll need to drag it onto your copy of Stuffit Expander.

Once you have the applet on your system, you can just run it by double clicking it like any other program. The first time you run it, it will bring up a dialog to ask you to locate the 2194 Days of War scenario folder (the folder that contains the rules and events files). After the first time, it will remember how to find the folder and you won't have to tell it again, even if you move the folder around on your disk. However, if it ever "loses" the folder, just drag any file or folder onto the applet icon to "reset" it, and the next time you run the script, it will ask you to locate the scenario folder again.

Once the applet has located the scenario folder, it will a display dialog box asking the user what country he wants to play as, will choose the appropriate events and rules files in the scenario folder, and will make copies of them to replace the events.txt and rules.txt files in the scenario folder.

If this isn't what you had in mind, or if you have problems getting it to work, please let me know. If you want to play with the script yourself, you can open it in the Apple Script Editor application.

Smash is offline Smash
Emperor
Civ2 Diehard
Jul 1999
time: 21:14
Post  Old Post 02-11-2000 07:57
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Remove this text

Whoa!bloody lovely.This exactly what I wanted.

However

I got this

???

Smash is offline Smash
Emperor
Civ2 Diehard
Jul 1999
time: 21:14
Post  Old Post 02-11-2000 12:10
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Tired of ads?

Oh heck.I misplaced the sound files.Have to get em again.Is this the problem?

nope.it doesn't do anything with sounds duh
[This message has been edited by Smash (edited November 02, 2000).]

RNF is offline RNF
Settler
Wilton, NH USA
Nov 2000
time: 05:14
  Old Post 02-11-2000 20:51 Visit RNF's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Full PM-box? Change here!

Odd. I guess the first question would be what MacOS version you're running.

The Finder doesn't let you copy one file right on top of another one, so the script deletes the original events.txt, makes a copy of the selected events file, and then renames the copy. Can you check what events files are in your scenario folder after the script dies? I would expect that there would *not* be a file named events.txt, and that there *would* be a file named "events1.txt copy" (or events2.txt, or whichever one is appropriate for your selected country).

(I do hope you made a copy of the whole scenario folder to play with before you started trying this out. :-)

Perhaps you could use Stuffit to package up your scenario folder as a .sit file and put it somewhere I could copy it, and I could try my script on your folder and see if I can reproduce the problem here.

It might simplify things if you could send me your email address so that we can work on this more directly than by exchanging messages here in the forum. I'm at faiman@jlc.net .
[This message has been edited by RNF (edited November 02, 2000).]

MacUser is offline MacUser
Prince
Olathe, KS, USA
Jul 1999
time: 23:14
Thumbs up  Old Post 03-11-2000 09:34
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

RNF - Thanks for helping with this script! I'm sure that all the Mac-Civers will benifit from this exercise in the not too distant future!

------------------
"And now for something completely different..."
- John Cleese

Smash is offline Smash
Emperor
Civ2 Diehard
Jul 1999
time: 21:14
Post  Old Post 03-11-2000 11:14
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Help yourself to an AD-FREE life

Yes its worth repeating this greatly appreciated.

8.5.1-I know,I know but if ain't broke don't fix it.Could this be the problem?

Yes I do get an events1.txt copy.It seems to be working properly up to this point then I get the message I posted above.

For some reason I couldn't upload the scenario so I sent a compressed copy to your e-mail.1034kb-hope it makes it.

to be continued......

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:14.
Apolyton Time is 00:14.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0314 seconds (88.25% PHP - 11.75% MySQL) with 36 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net