Back to Index Page generated: Nov 12, 2024, 11:02:04 PM

Expansion Hyperradio

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Your personal tool for playing music in the game. Depends on Cabal Common Library and Snoopers, suggests Musicpacks. Your personal tool for playing music in the game. Depends on Cabal Common Library and Snoopers, suggests Musicpacks.
Identifier oolite.oxp.Svengali.Hyperradio oolite.oxp.Svengali.Hyperradio
Title Hyperradio Hyperradio
Category Equipment Equipment
Author Svengali Svengali
Version 1.26.1 1.26.1
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
  • oolite.oxp.Svengali.CCL:1.7
  • oolite.oxp.Svengali.Snoopers:2.4
  • oolite.oxp.Svengali.CCL:1.7
  • oolite.oxp.Svengali.Snoopers:2.4
  • Optional Expansions
    Conflict Expansions
    Information URL http://wiki.alioth.net/index.php/Hyperradio_js_OXP n/a
    Download URL https://wiki.alioth.net/img_auth.php/b/b2/Hyperradio_1.26.1.oxz n/a
    License CC BY-NC-SA 3 CC BY-NC-SA 3
    File Size n/a
    Upload date 1610873446

    Documentation

    Also read http://wiki.alioth.net/index.php/Hyperradio

    Hyperradio1.26.1 Readme.rtf

    {\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fswiss\fprq2\fcharset0 Helvetica;}{\f1\fnil\fcharset0 Helvetica;}{\f2\fnil\fcharset238 Helvetica;}}
    {\colortbl ;\red128\green128\blue128;\red128\green0\blue128;\red0\green0\blue0;}
    {\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\lang1031\ul\b\f0\fs24 HYPERRADIO v1.26.1\ulnone\b0  for Oolite\par
    \cf1\f1\fs18 Copyright 2008-2013, Svengali\par
    \f0 License: CC-by-nc-sa-3.0\par
    \cf0\fs20\par
    \ul\fs24 OVERVIEW:\ulnone\par
    \fs22 Trading goods between worlds is an extremely dangerous and hard job and a commander will need\par
    some relaxing moments. Listen to your radio station and enjoy Jazz, Folk, Rock or whatever you like.\par
    \par
    Use one station for all systems or expand it, so you will get different programs in different systems.\par
    It is even encouraged to add your own music to the playlist.\par
    \par
    So rip your CDs, download songs, or install one or more of the available musicpacks. Everything\par
    is possible - and travelling will be much more fun - even 'milkruns' won't be boring business anymore.\par
    And the capacity to be expanded by other users creating their own musicpacks it is a flexible toy.\par
    \fs20\par
    \ul\fs24 HANDLING:\par
    \ulnone\fs22 Adding own songs to the main playlist is simple. Please note that only \b ogg-vorbis\b0  is supported.\fs20\par
    \fs22 1. Just place your soundfiles in the \b OXPs\b0  \b Music-folder\b0 .\par
    2. Open \b hyperradio.js \b0 in the \b OXPs Scripts-folder \b0 (you can use a simple text-editor)\par
        and add your filenames to the array.\par
    \cf1 Example:\par
    \tab this.hyperradio_playListOriginal = [\par
    \tab\tab "Rage-Back_in_time.ogg",\par
    \tab\tab "Stevie_Ray_Vaughan-Voodoo_Child.ogg"\par
    \tab ];\par
    \cf0     Save your additions. That's it.\par
    \par
    Ingame:\par
    Fire up Oolite and buy the Hyperradio license (it is not everywhere available).\par
    - Launch from the station and select it via priming key (Shift + N).\par
    - Select the station via activation key (n). You can cycle through the available stations.\par
    - To start a station press the mode key (b).\par
    \fs20\par
    \ul\fs24 MUSICPACKS:\b\fs22\par
    \ulnone\b0 To get some more fun it is possible to use different 'stations' with different playlists.\par
    There are already some station-musicpacks with different musicstyles available for you:\par
    \cf2 http://wiki.alioth.net/index.php/Hyperradio_Musicpacks\cf0 .\par
    \par
    If you are using one or more of the available musicpacks the Hyperradio preselects one of them\par
    or the main list.\par
    \par
    Documentation about creating own stations is available:\par
    \cf2 http://wiki.alioth.net/index.php/Hyperradio_Howto_Musicpacks\ul\par
    \cf0\fs20\par
    \fs24 REQUIREMENTS:\b\par
    \ulnone\b0\fs22 - Oolite v1.77.\par
    - Cabal_Common_Library1.7.\par
    - If Snoopers2.4 or musicpacks installed extra features are enabled.\par
    \par
    \ul\f1\fs24 PROBLEMS:\par
    \ulnone\fs22 In case of problems, please report it: \cf2 http://aegidian.org/bb/viewtopic.php?f=4&t=4067.\par
    \cf0 Include the following infos:\par
    - Oolites version (and if trunk or nightly is used the revision number)\par
    - OS, Graphics card (and driver version)\par
    - Fullscreen/Windowed mode\par
    - Shader mode\par
    - List of used OXPs (incl. versions)\f0\par
    \cf3\f1\fs24 _________________________________________________________________________\par
    \fs20\par
    Thanks to:\par
      - \ul The development team\ulnone\par
      Giles Williams (aegidian), Jens Ayton (Ahruman), Nikos Barkas (another_commander), David Taylor (dajt),\par
      Chris Crowther (hikari), James (cmdrjames), Darren Salt (dsalt), Eddy Petri\f2\'baor\f1  (\f2 eddyp\f1 ), \f2 Erich Ritz\f1  (\f2 eritz\f1 ),\par
      \f2 Konstantinos Sykas\f1  (\f2 getafix\f1 ),  K\f2 aks\f1 , \f2 Nic \f1 (\f2 nic_asdf\f1 ), \f2 Michael Werle\f1  (\f2 mwerle\f1 ), \f2 Dave Hughes\f1  (s\f2 elezen\f1 ),\par
      Eric Walch, \f2 Dylan Smith\f1  (\f2 winston\f1 ).\f2\par
    \f1\par
    Special thanks to:\par
      - Thargoid for adding this equipment to his RepairBots.oxp\par
      - vebfilm.net for the backgroundmusic used for the escapepod-sequence (CC-by-nc-sa)\ul\par
    \ulnone\fs24 _________________________________________________________________________\par
    \fs20\par
    This OXP is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.\par
     To view a copy of this license, visit \cf2 http://creativecommons.org/licenses/by-nc-sa/3.0/\cf3  or send a letter to\par
     Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.\par
    \par
    DISCLAIMER:\par
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY\par
    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\par
    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\par
    SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\par
    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\par
    OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\par
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\par
    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\par
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\par
    \par
    A SMALL PERCENTAGE OF USERS MAY EXPERIENCE EPILEPTIC SEIZURES WHEN EXPOSED TO\par
    CERTAIN LIGHT PATTERNS OR BACKGROUNDS ON A COMPUTER SCREEN OR WHILE USING THIS OXP.\par
    CERTAIN CONDITIONS MAY INDUCE PREVIOUSLY UNDETECTED EPILEPTIC SYMPTOMS EVEN IN USERS\par
    WHO HAVE NO HISTORY OF PRIOR SEIZURES OR EPILEPSY. IF YOU, OR ANYONE IN YOUR FAMILY,\par
    HAVE AN EPILEPTIC CONDITION, CONSULT YOUR PHYSICIAN PRIOR TO USING THIS OXP. IMMEDIATELY\par
    DISCONTINUE USE OF THIS OXP AND CONSULT YOUR PHYSICIAN IF YOU EXPERIENCE ANY OF THE\par
    FOLLOWING SYMPTOMS WHILE USING THIS OXP: DIZZINESS, ALTERED VISION, EYE OR MUSCLE\par
    TWITCHES, LOSS OF AWARENESS, DISORIENTATION, ANY INVOLUNTARY MOVEMENT, OR CONVULSIONS.\par
    \fs24 _________________________________________________________________________\par
    \fs20\par
    \par
    \par
    \par
    }
    

    Equipment

    Name Visible Cost [deci-credits] Tech-Level
    HyperRadio™ yes 12000 8+
    HyperRadio™ yes 8000 100+
    HyperRadio™ Social yes 1000 100+

    Ships

    This expansion declares no ships.

    Models

    This expansion declares no models.

    Scripts

    Path
    Scripts/hyperradio.js
    "use strict";
    this.name = "hyperradio";
    this.author = "Svengali";
    this.copyright = "(C)2008-2013, License:CC-by-nc-sa-3.0";
    this.description = "Musicplayer. Expandable by musicpacks.";
    this.version = "1.26.1";
    
    /* *** CHANGE ONLY THIS PART - Add new or override the following entries to use it as playList *** */
    this.hyperradio_playListOriginal = [
    	"hyperradio-exampleA.ogg",
    	"hyperradio-exampleB.ogg"
    ];
    /* *** END OF CHANGES *** */
    this.stationList = ['hyperradio_playListOriginal'];
    this.stationDesc = ['GalaxyRadio 1.26.1'];
    
    this.startUp = function()
    {
    	delete this.startUp;
    	if(!worldScripts.Cabal_Common_Functions || typeof(worldScripts.Cabal_Common_Functions.Cabal_Common)==='undefined'){this.killSelf(" -> Cabal_Common_Library is missing."); return;}
    	this.helper = new worldScripts.Cabal_Common_Functions.Cabal_Common();
    	if(this.helper.internalVersion<15){this.killSelf(" -> Cabal_Common_Functions is too old."); return;}
    	var requires = ["snoopers","2.4"];
    	this.news = 0;
    	this.vNews = 31;
    	this.showNews = false;
    	if(this.helper.oxpVersionTest(this.name,requires)){
    		this.showNews = true;
    		if(missionVariables.hyperradio_news){
    			var tmp = missionVariables.hyperradio_news.split('|');
    			this.news = parseInt(tmp[0],null);
    			this.sysA = tmp[1];
    			this.sysB = tmp[2];
    			this.vNews = 15+parseInt(this.news,null);
    		}
    	} else log(this.name,this.name+" - deactivating all specials");
    	/* Via OXPConfig2 configurable settings */
    	this.logging = false;
    	this.mergePacks = true;
    	this.podMusic = true;
    	this.onlyMain = false;
    	// Other settings
    	this.canPlay = false; // false if EQ not installed, docked, EQ damaged, in interstallar space or tempDisabled
    	this.tempDisabled = false; // used to temp disable the HyperRadio, reset on witchspacing
    	this.hyperRadio = false; // true if installed and license is valid
    	if(missionVariables.hyperradio_last) this.hyperradioDuration = parseInt(missionVariables.hyperradio_last,null);
    	else this.hyperradioDuration = 0;
    	this.current = 'start'; // current song
    	this.next = 'start'; // next selected song
    	this.currentStation = ''; // musicpack or main
    	this.currentList = []; // playlist
    	this.selectable = [[],[],[],[],[],[],[],[]];
    	this.cleanMVs();
    	delete this.killSelf;
    };
    this.killSelf = function(desc)
    {
    	if(desc!==1){
    		player.consoleMessage(this.name+" - Check your Latest.log.",10);
    		log(this.name,this.name+" - Shutting down."+desc);
    	}
    	for(var prop in this){if(prop!=='name' && prop!=='version' && prop!=='stationList') delete this[prop];}
    	this.deactivated = true;
    	return;
    };
    this.playerWillSaveGame = function()
    {
    	missionVariables.hyperradio_last = this.hyperradioDuration;
    	if(this.news) missionVariables.hyperradio_news = this.news+'|'+this.sysA+'|'+this.sysB;
    	this.saved = true;
    };
    this.cleanMVs = function()
    {
    	missionVariables.hyperradio_last = null;
    	missionVariables.hyperradio_news = null;
    	delete this.saved;
    	return;
    };
    this.distribution = function(P)
    {
    	var K = Math.random()%1;
    	for(var j=0;j<P.length;j++){
    		if(P[j]>K){
    			return(j);
    		}
    	}
    	return(0);
    };
    this.doInit = function()
    {
    	this.stations = this.stationList.length;
    	if(this.logging) log(this.name,this.name+': Stations found:'+this.stations);
    	if(this.stations>1){
    		if(this.mergePacks){
    			var lname = "",outL = this.stationList.length,inL = 0;
    			while(outL--){
    				inL = worldScripts.hyperradio[this.stationList[outL]].length;
    				while(inL--){
    					lname = this.stationList[outL];
    					this.hyperradio_playListOriginal.push(worldScripts.hyperradio[lname][inL]);
    				}
    				if(outL===1) break;
    			}
    			this.hyperradio_playListOriginal = this.helper.arrRemoveByValue(this.hyperradio_playListOriginal,'hyperradio-exampleA.ogg');
    			this.hyperradio_playListOriginal = this.helper.arrRemoveByValue(this.hyperradio_playListOriginal,'hyperradio-exampleB.ogg');
    			if(this.logging) log(this.name,this.name+': Main Playlist contains '+this.hyperradio_playListOriginal.length+' songs. Examples files removed.');
    		}
    		for(var de=1;de<this.stations;de++){
    			var sDesc = this.stationList[de];
    			var test = sDesc.replace(/(^hyperradio_|playList|[0-9])/g,'');
    			test += " "+this.helper.randSpan(100,999)+"."+this.helper.rand(99);
    			this.stationDesc.push(test);
    			if(this.logging) log(this.name,"Desc: "+test);
    		}
    		var Given = [],j,k,A = [],Probs = [],S = "",Q = 1,Total = 8;
    		for(var c=0;c<this.stations;c++){Given.push(1);}
    		for(j=Given.length-1;j>=0;j--){A[j] = 0; Probs[j] = Q; Q -= Given[j]/Total;}
    		for(j=0;j<64;j++){k = this.distribution(Probs); S += k; A[k]++;}
    		var g=8,ii,c=Given.length-1;
    		while(g--){
    			ii =Given.length;
    			if(c>0) this.selectable[g].push(c);
    			c--;
    			while(ii--){
    				if((S[g+ii]&ii)) this.selectable[g].push((S[g+ii]&ii));
    				else this.selectable[g].push(0);
    			}
    			this.selectable[g] = this.helper.arrUnique(this.selectable[g]);
    		}
    		if(this.logging){for(var o=0;o<8;o++){log(this.name,this.selectable[o]);}}
    	} else this.selectable = [[0],[0],[0],[0],[0],[0],[0],[0]];
    	delete this.doInit;
    	delete this.helper;
    	delete this.distribution;
    	return;
    };
    this.playerBoughtEquipment = function(equipmentKey)
    {
    	switch(equipmentKey){
    		case 'EQ_HYPER_RADIO':
    			this.hyperRadio = true;
    			this.hyperradioDuration = Math.floor(20+clock.days);
    			EquipmentInfo.infoForKey('EQ_HYPER_RADIO_ADD').effectiveTechLevel = 7;
    			break;
    		case 'EQ_HYPER_RADIO_ADD':
    			this.hyperRadio = true;
    			this.hyperradioDuration += 20;
    			player.ship.removeEquipment('EQ_HYPER_RADIO_ADD');
    			missionVariables.TL_FOR_EQ_HYPER_RADIO_ADD = null;
    			break;
    		case 'EQ_HYPER_RADIO_PIRATE':
    			player.ship.removeEquipment('EQ_HYPER_RADIO_PIRATE');
    			this.hyperRadio = true;
    			player.ship.awardEquipment('EQ_HYPER_RADIO');
    			missionVariables.TL_FOR_EQ_HYPER_RADIO_PIRATE = null;
    			this.hyperradioDuration += Math.ceil(20/Math.log(system.government+2.1));
    			this.news = 0;
    			break;
    	}
    };
    this.equipmentDamaged = this.equipmentDestroyed = function(equipmentKey)
    {
    	if(equipmentKey==='EQ_HYPER_RADIO'){
    		this.canPlay = false;
    		this.failPlay(1);
    	}
    };
    this.shipWillDockWithStation = function()
    {
    	this.failPlay();
    	this.canPlay = false;
    	this.CheckHyperradioLicence();
    };
    this.shipWillLaunchFromStation = function()
    {
    	missionVariables.TL_FOR_EQ_HYPER_RADIO_ADD = null;
    	if(player.ship.equipmentStatus('EQ_HYPER_RADIO')==='EQUIPMENT_OK'){
    		if(system.isInterstellarSpace || this.tempDisabled){
    			this.canPlay = false;
    			return;
    		}
    		this.hyperRadio = true;
    		this.SelectHyperradioStation();
    	}
    };
    this.shipLaunchedFromStation = function()
    {
    	if(this.hyperRadio && !system.isInterstellarSpace){
    		this.current = 'start';
    		this.next = 'start';
    		if(!this.tempDisabled) this.canPlay = true;
    		if(this.logging) log(this.name,this.name+': Duration:'+this.hyperradioDuration+' tmp:'+this.tempDisabled);
    	}
    };
    this.shipExitedWitchspace = function()
    {
    	if(this.logging) log(this.name,this.name+': clock:'+(clock.days&31)+' vNews:'+this.vNews);
    	this.tempDisabled = false;
    	if(this.hyperRadio){
    		if(system.isInterstellarSpace){
    			this.failPlay(1);
    			player.consoleMessage("HyperRadio deactivated. Could not transfer data.",8);
    			this.canPlay = false;
    			return;
    		} else this.SelectHyperradioStation();
    		this.canPlay = true;
    	}
    	if(!this.showNews || system.isInterstellarSpace) return;
    	if(this.news){
    		if(this.news===4){
    			var a = System.systemIDForName(this.sysA);
    			var b = System.systemIDForName(this.sysB);
    			if(!missionVariables.TL_FOR_EQ_HYPER_RADIO_PIRATE && (system.ID===a || system.ID===b)){
    				EquipmentInfo.infoForKey('EQ_HYPER_RADIO_PIRATE').effectiveTechLevel = 1;
    				this.news = 0;
    				return;
    			} else missionVariables.TL_FOR_EQ_HYPER_RADIO_PIRATE = null;
    		} else if(this.news===3){
    			this.news = 0;
    			return;
    		}
    	}
    	if(this.news) return;
    	if((clock.days&31)===this.vNews){
    		missionVariables.TL_FOR_EQ_HYPER_RADIO_PIRATE = null;
    		var a = Math.random();
    		if(a>0.5){
    			this.sysA = System.systemNameForID(Math.floor(Math.random()*255));
    			this.sysB = System.systemNameForID(Math.floor(Math.random()*255));
    			var obj;
    			if(this.hyperRadio){
    				if(a>0.9){
    					this.news = 2;
    					obj = {Message:'[HYPERRADIO_NEWSA]',Pic:'hyperradio_news.png',Music:'snoopers_gcnews.ogg',Model:'snoopers_gcnewsA1',Pos:[57,36,170]};
    				} else if(a>0.8){
    					this.news = 3;
    					obj = {Message:'[HYPERRADIO_NEWSD]',Agency:1};
    				} else {
    					this.news = 4;
    					obj = {Message:'[HYPERRADIO_NEWSE] '+this.sysA+' and '+this.sysB+' [HYPERRADIO_NEWSE2]',Agency:3};
    				}
    			} else {
    				if(a>0.7){
    					if(a>0.9){
    						this.news = 1;
    						obj = {Message:'[HYPERRADIO_NEWSB]',Pic:'hyperradio_news.png',Music:'snoopers_gcnews.ogg',Model:'snoopers_gcnewsA1',Pos:[57,36,170]};
    					} else {
    						this.news = 4;
    						obj = {Message:'[HYPERRADIO_NEWSE] '+this.sysA+' and '+this.sysB+' [HYPERRADIO_NEWSE2]',Agency:3};
    					}
    				} else {
    					this.news = 5;
    					obj = {Message:'[HYPERRADIO_NEWSC] '+this.sysA+' and '+this.sysB+' in this sector. [HYPERRADIO_NEWSC2]',Agency:2};
    				}
    			}
    			if(this.logging) log(this.name,this.name+': New event:'+this.news);
    			obj.ID = this.name;
    			var b = worldScripts.snoopers.insertNews(obj);
    			if(b) this.news = 0;
    			else this.vNews ^= this.news+15;
    		}
    	}
    };
    this.alertConditionChanged = function(condition)
    {
    	if(this.doInit) this.doInit();
    	if(this.hyperRadio){
    		if(condition===3) this.failPlay();
    		else if(!player.ship.docked && !system.isInterstellarSpace && !this.tempDisabled) this.canPlay = true;
    	}
    };
    this.shipLaunchedEscapePod = function()
    {
    	this.failPlay();
    	if(this.podMusic) Sound.playMusic('hyperradio-escapepod.ogg');
    };
    this.SelectHyperradioStation = function(next)
    {
    	if(system.isInterstellarSpace){
    		player.consoleMessage("HyperRadio deactivated. Could not transfer data.",8);
    		return;
    	}
    	if(this.onlyMain || this.stations<2) this.stationSelect = 0;
    	else {
    		var currentAvail = this.selectable[system.government];
    		if(this.logging && !next) log(this.name,"Subset:"+currentAvail);
    		if(next){
    			this.cycle++;
    			if(this.cycle>currentAvail.length-1) this.cycle = 0;
    			this.stationSelect = currentAvail[this.cycle];
    		} else {
    			this.stationSelect = currentAvail[Math.floor(Math.random()*currentAvail.length)];
    			this.cycle = this.stationSelect;
    		}
    	}
    	if(next) player.consoleMessage("Channel : "+this.stationDesc[this.stationSelect]);
    	if(this.logging) log(this.name,"Selected: "+this.stationSelect);
    	return;
    };
    this.GetHyperradioSongName = function()
    {
    	var listName = this.stationList[this.stationSelect];
    	var i = worldScripts.hyperradio[listName].length;
    	if(listName===this.currentStation){
    		if(!this.currentList.length){
    			while(i--) this.currentList.push(worldScripts.hyperradio[listName][i]);
    		}
    	} else {
    		this.currentStation = listName;
    		this.currentList = [];
    		while(i--) this.currentList.push(worldScripts.hyperradio[listName][i]);
    	}
    	if(this.currentList.length) this.currentList.sort(function(){return 0.5-Math.random();});
    	var songName = this.currentList[0];
    	if(!listName || !songName || !songName.match('.ogg')){
    		player.consoleMessage("HyperRadio: NO VALID ENTRY FOUND! See Logfile for Details.",8);
    		log(this.name,this.name+': WARNING. NO VALID ENTRY IN PLAYLIST FOUND. Error in:'+listName+' '+songName+' Station:'+this.stationSelect);
    		return(false);
    	}
    	this.next = songName;
    	this.currentList.shift();
    	if(this.logging) log(this.name,this.name+': Station:'+listName+' Song:'+songName+' remaining #'+this.currentList.length+' in this list.');
    	return(true);
    };
    this.CheckHyperradioLicence = function()
    {
    	if(this.hyperRadio && clock.days>=this.hyperradioDuration){
    		player.ship.removeEquipment('EQ_HYPER_RADIO');
    		this.hyperRadio = false;
    		this.canPlay = false;
    		this.hyperradioDuration = 0;
    		player.consoleMessage("Your HyperRadio license expired. Buy a new one at your local dealer.",6);
    		return(false);
    	}
    	if(system.isInterstellarSpace) return(false);
    	if(player.ship.equipmentStatus('EQ_HYPER_RADIO')==='EQUIPMENT_DAMAGED'){
    		this.canPlay = false;
    		player.consoleMessage("Can't connect to HyperRadio station. Device damaged.",6);
    		return(false);
    	}
    	if(player.ship.equipmentStatus('EQ_HYPER_RADIO')==='EQUIPMENT_OK') this.canPlay = true;
    	return(true);
    };
    this.guiScreenChanged = function()
    {
    	if(this.doInit) this.doInit();
    	if(this.saved) this.cleanMVs();
    };
    this.startMusic = function()
    {
    	if(player.ship.status==='STATUS_IN_FLIGHT'){
    		if(this.tempDisabled){
    			player.consoleMessage("HyperRadio signal interrupted.");
    			this.failPlay();
    		} else if(this.hyperRadio && this.CheckHyperradioLicence() && this.canPlay){
    			if(this.current!=='start') Sound.stopMusic(this.current);
    			if(!this.GetHyperradioSongName() || this.next===this.stationList[this.stationSelect]){
    				this.canPlay = false;
    				return;
    			} else {
    				this.current = this.next;
    				player.consoleMessage("Connection to "+this.stationDesc[this.stationSelect]+" established. Days left: "+(this.hyperradioDuration-clock.days));
    				Sound.playMusic(this.current);
    			}
    		}
    	}
    	return;
    };
    this.shipDied = function()
    {
    	this.failPlay(1);
    };
    this.failPlay = function(mode)
    {
    	if(this.current!=='start'){
    		Sound.stopMusic(this.current);
    		if(mode) Sound.playMusic('hyperradio-fail.ogg');
    	}
    	return;
    };
    // Callback from Snoopers
    this.newsDisplayed = function()
    {
    	switch(this.news){
    		case 3: this.tempDisabled = true; break;
    		case 4: break;
    		default: this.news = 0; break;}
    };
    // OXPConfig2 settings
    this.oxpcSettings = {
    	Info: {Name:this.name,Display:"Hyperradio",EarlyCall:true,EarlySet:true,
    		InfoB:"If musicpacks are installed channel lists are generated. Switching is done via primed EQ activation key. mergePacks removes the example files, onlyMain uses only the main playlist. Changes to mergePack needs restart to take effect."},
    	Bool0: {Name:"logging",Def:false,Desc:"Logging functions."},
    	Bool1: {Name:"mergePacks",Def:true,Desc:"Copy Packs in mainlist."},
    	Bool2: {Name:"podMusic",Def:true,Desc:"Escapepod music."},
    	Bool3: {Name:"onlyMain",Def:false,Desc:"Use only mainlist."}
    };
    
    Scripts/hyperradio_eq.js
    "use strict";
    this.name = "hyperradio_eq";
    this.author = "Svengali";
    this.copyright = "(C)2008-2013, License:CC-by-nc-sa-3.0";
    this.description = "Musicplayer. EQ script.";
    this.version = "1.26.1";
    
    this.activated = function()
    {
    	worldScripts.hyperradio.SelectHyperradioStation(1);
    };
    this.mode = function()
    {
    	worldScripts.hyperradio.startMusic();
    };