Galactic War Notification Script

Everything about mods can be found here.

Moderator: Morax

Galactic War Notification Script

Postby Duck_42 » 07 Jan 2014, 00:52

Those of you who play Galactic War know that sitting there waiting for a battle can be tedious. If you leave your PC for a bit though, you may miss the start of a fight and lose by default. To help with this problem, I created the following batch script.

Instructions

  1. Copy and paste the code below into a new text file.
  2. Change C:\Users\ProfileName\Music\PathToSomeMediaFile.mp3 to a valid sound/video file that you want to play when FA starts.
  3. Save the text file as GalacticWarNotification.bat
  4. Run (double click) on the batch file that you just saved.
  5. Attack a planet
  6. Wait...

NOTE: You must restart the script after each time it notifies you.

Code: Select all
@ECHO OFF
ECHO FAF Galactic War Notification Script v1.0
ECHO by Duck_42
ECHO -----------------------------------------
ECHO Waiting for Forged Aliance to start...
ECHO Press Ctrl-C to quit

:mainloop

tasklist /FI "IMAGENAME eq ForgedAlliance.exe" 2>NUL | find /I /N "ForgedAlliance.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO PlayAlert

timeout /T 1 /NOBREAK > NUL
goto mainloop

:PlayAlert
ECHO Forged Aliance has started!
ECHO Triggering notification...
ECHO -----------------------------------------
start "C:\Program Files\Windows Media Player\wmplayer.exe" "C:\Users\ProfileName\Music\PathToSomeMediaFile.mp3"

ECHO Script finished!
pause


As always, please post any questions or comments on this thread so I'll be sure to see them.
User avatar
Duck_42
Avatar-of-War
 
Posts: 237
Joined: 29 May 2012, 03:16
Has liked: 5 times
Been liked: 18 times
FAF User Name: Duck_42

Re: Galactic War Notification Script

Postby rockoe10 » 05 Feb 2014, 18:33

Something like this would be nice to have implemented into FAF
ZeP: doesn't matter if it's an avatar, a trophy or a collection of dead cats
ZeP: it's the same code
User avatar
rockoe10
Avatar-of-War
 
Posts: 299
Joined: 05 Jan 2013, 05:09
Has liked: 36 times
Been liked: 17 times
FAF User Name: Rockoe10

Re: Galactic War Notification Script

Postby Kulu » 06 Feb 2014, 19:35

How does it work? Playing a sound or calling your cellphone or what :D ?
User avatar
Kulu
Avatar-of-War
 
Posts: 66
Joined: 08 Oct 2013, 18:18
Location: DEUTSCHLAND
Has liked: 5 times
Been liked: 0 time
FAF User Name: Kulu

Re: Galactic War Notification Script

Postby Duck_42 » 07 Feb 2014, 01:19

It opens Windows Media Player and has it plays whichever file you specify. You could change the script to run vlc or another program if you wanted.

Theoretically, you could have it run a program to send an e-mail/text to your phone. Not sure about actually calling your phone though. :-D
User avatar
Duck_42
Avatar-of-War
 
Posts: 237
Joined: 29 May 2012, 03:16
Has liked: 5 times
Been liked: 18 times
FAF User Name: Duck_42

Re: Galactic War Notification Script

Postby Kulu » 07 Feb 2014, 09:32

Maybe via Skype:D
User avatar
Kulu
Avatar-of-War
 
Posts: 66
Joined: 08 Oct 2013, 18:18
Location: DEUTSCHLAND
Has liked: 5 times
Been liked: 0 time
FAF User Name: Kulu

Re: Galactic War Notification Script

Postby Ze_PilOt » 07 Feb 2014, 10:07

Skype has a very complete API, this is very possible :)
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest