|
Answer» Hi im not too familiar with coding in .bat files just in general i havent done coding in a long time not since my school days. Anyways ive GOT a batch file running that basically hosts a dedicated server for a game i play at the time being and since the games is still being developed theres some things that havent been put in yet. Right well the batch file i have runs the dedicated server and people are connecting fine etc, i have it on a timer which restarts the server every so often, ive also managed to GET it to pop out a message but the issue is i cant get it to play a sound with it nothing spectacular of a sound just a sound which will get my attention so i know when the server will restart so therefore i can tell players on the server to log out before server automatically restarts? if anyone knows the coding for this it would be much appreciated thanks.
p.s i can also post the coding for the batch file i have at the moment if needed, could do with some opinions and tweaks etc cheers Here is a solution I had squirreled away from a post on a web site:
Code: [Select]echo off set "file=c:\Windows\Media\Windows Shutdown.wav" ( echo Set Sound = CreateObject("WMPlayer.OCX.7"^) echo Sound.URL = "%file%" echo Sound.Controls.play echo do while Sound.currentmedia.duration = 0 echo wscript.sleep 100 echo loop echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000 ) >"%temp%\sound.vbs" start "" /min "%temp%\sound.vbs" how would i IMPLEMENT that into this?
:loop echo (%time%) Loot Resetting... start /high Unturned.exe -nographics -pei -bambi -nosync -pve -port:25444 -pass:razorpanda -players:24 -sv echo (%time%) Loot Reset. echo (%time%) Server is online. echo (%time%) Loot Resetting in 2 hours. timeout /t 5400 >null echo (%time%) Loot Resetting in 15 seconds timeout /t 15 >null echo msgbox "Server Restart 15 secs" > %tmp%\tmp.vbs wscript %tmp%\tmp.vbs del %tmp%\tmp.vbs echo (%time%) Server is ONLINE! Watching for crash... start sndvol.exe start /high Unturned.exe -nographics -pei -bambi -nosync -pve -port:25444 -pass:razorpanda -players:24 -sv echo (%time%) Server CRASHED/CLOSED. Restarting...
taskkill /f /im "Unturned.exe"
goto loop
thats my coding for the server i host though im trying to tweak it so that the button doesnt reset the server only warns me that theres 5 minutes etc and the sound to be played when the message pops outalso i tried changing the sound from shutdown to tada but it doesnt play? nvm got it to change. Ive got it to work in my own coding but just wondering if i can increase the volume ?
BTW MANY MANY THANKS cant emphasis how much this has helped
Quote from: razorpanda on July 28, 2014, 08:43:19 AM Ive got it to work in my own coding but just wondering if i can increase the volume ?
BTW MANY MANY THANKS cant emphasis how much this has helped
Bewdy.
The volume depends on your current volume setting and I don't have a script to set a specific volume level. oh ok thanks my systems volumes at max but the windows sound is still fairly quiet for the pop up meh its cool but again many many thanks
Quote from: razorpanda on July 28, 2014, 09:30:35 AMoh ok thanks my systems volumes at max but the windows sound is still fairly quiet for the pop up meh its cool but again many many thanks
Try a different sound file - some are recorded at lower level - and you can normalize the sound file with the free Audacity.
OTOH are your computer sounds normally low in volume?
Quote from: foxidrive on July 28, 2014, 09:45:28 AMTry a different sound file - some are recorded at lower level - and you can normalize the sound file with the free Audacity.
OTOH are your computer sounds normally low in volume?
yea had a seperate sound file i USED much louder Nope my computer sounds are always at 100% max and i can FREELY change it with my speakers as my mic doesnt pick up my speakers so i dont bother with a headset just now that i have it all working its fantastic and the help was great. Just wondering now if im able to inject some messages into the program it starts up which i heard it was done or someone was able to send messages from the CMD to the game so that all players in the dedicated server was able to see the message so i think thats my next step but no idea how >.<
|