staging.inyokaproject.org

X-Plane FSE Script

Status: Gelöst | Ubuntu-Version: Ubuntu 12.10 (Quantal Quetzal)
Antworten |

zeroc

Avatar von zeroc

Anmeldungsdatum:
20. September 2008

Beiträge: 131

ich habe die FSE downzeit mal genutzt und ein kleines script für 64bit Ubuntu users (linux xplaner) geschrieben.

was ist FSE? FSE ist eine wirtschaftssimulation für x-plane. man kann sich hier http://www.fseforums.com/ anmelden und bekommt in diesem forum seine zugangsdaten für FSE.

danach kann man mein script hier ausführen und los gehts.

was macht das script? beim ersten start installiert es python2.6 minimal, sowohl als 32 und 64bit version, installiert PythonInterface und den FSE-Client direkt in den x-plane plugins ordner.

danach und bei allen weiteren starts, kann man sich nun aussuchen ob man 32bit oder 64bit haben will. man kann jetzt also hin und her switchen wie man bock hat. hat man gar keinen bock mehr, löscht man einfach das logfile, welches dieses script produziert, antwortet auf alle fragen mit "n" und alles was installiert wurde, ist auch wieder gelöscht.

für wen ist das script? für alle linuxer, die sofort mit xplane und FSE loslegen wollen, ohne lust zu haben sich mit PythonInterface, X-Economy und co. rumzuschlagen und per start zwischen der 32 oder 64 bit version von x-plane wählen möchten.

wenn demnächst weitere x-plane plugins als 64bit version (bisher gibt es keine weiteren?) folgen, baue ich diese hier mit ein und aktualisiere das script.

wie funktioniert es?: copy/ paste, als x-plane.sh abspeichern, settings anpassen, ausführbar machen und ab geht die post!

grüße,

zeroc

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/sh

#python-switch 0.1alpha 32/64bit for x-plane 32/64bit Copyright (c) 2012 Sven Greffenius (zeroc)
#
#you get the python2.6_i386 binary files here: https://launchpad.net/~fkrull/+archive/deadsnakes/+packages
#the pythoninterface for linux 32/64bit comby-package you can download here: http://www.xpluginsdk.org/downloads/latest/Python26/PythonInterface.zip
#
#this script is working with Ubuntu 12.4/ 12.10(64bit) & X-Plane above 10.20b1 
#
#you need superuser permissions and an internet connection! 
#for complete deinstallation or reinstallation, delet the "x-plane_startscript.log" and answer all questions with no!

####settings####

#set path to X-Plane Main-Directory example=/home/<username>/X-Plane
xplane="/home/zeroc/X-Plane"
#set path for needed binary python2.6 32bit-files example=$xplane/Python2.6-Files
pyth="$xplane/04_Python2.6_i368"
#set logfile for example= $xplane/x-plane_startscript.log
logd="/home/zeroc/bin/x-plane_startscript.log"

#download-settings for python2.6_i386 & pythoninterface 32/64bit comby-package & X-economy client
d1=https://launchpad.net/~fkrull/+archive/deadsnakes/+files/libpython2.6_2.6.8-2%2Bquantal1_i386.deb
d2=https://launchpad.net/~fkrull/+archive/deadsnakes/+files/python2.6-minimal_2.6.8-2%2Bquantal1_i386.deb
d3=https://launchpad.net/~fkrull/+archive/deadsnakes/+files/python2.6_2.6.8-2%2Bquantal1_i386.deb
d4=http://www.xpluginsdk.org/downloads/latest/Python26/PythonInterface.zip
d5=http://x-plane.hu/x-economy/PI_xfse.py

####end settings####

#do not change this lines, if you don't know how to

echo
echo "$(tput setab 2)X-Plane configuration for 32/64bit script-support...$(tput sgr0)"
notify-send X-Plane " is starting up..."
if [ ! -e "$logd" ]; then echo first time start...; ftime=1; echo "cleanup and removing any files from pre-installations..."; rm -rf $pyth; rm -rf $xplane/Resources/plugins/PythonScripts/; rm -rf $xplane/Resources/plugins/*ython*face/; echo " "; echo "reinstalling python2.6_64bit files. if you don't need anymore use: sudo apt-get purge python2.6 python2.6-minimal libpython2.6";sleep 15s; sudo apt-get --reinstall install python2.6 python2.6-minimal libpython2.6 | tee $logd; echo " "; echo "done";
else ftime=0
fi
if [ "$ftime" != "0" ]; then echo " "; echo downloading and extracting python2.6_i386 [4,8MB] into your X-Plane maindirectory? y/n
				read answer
					if [ "$answer" = "y" ] 
						then logfirst="x-plane_startscript_firsttimesetup_$(date +%y-%m-%d).log" 
						echo; date > $logfirst; echo " " >> $logfirst; echo; rm -rf *ython*deb* | tee >> $logfirst; wget $d1 $d2 $d3 | tee >> $logfirst
						mkdir temp | tee >> $logfirst; ar -x libpython2.6* data.tar.gz; mv data.tar.gz temp/; cd temp/; tar xfz data.tar.gz; rm data.tar.gz; cd ..; ar -x python2.6_* data.tar.gz; mv data.tar.gz temp/; cd temp/; tar xfz data.tar.gz; rm data.tar.gz; cd ..; ar -x python2.6-* data.tar.gz; mv data.tar.gz temp/; cd temp/; tar xfz data.tar.gz; rm data.tar.gz; mkdir $pyth | tee >> $logfirst; mv -v usr/lib/* $pyth/ | tee >> $logfirst; cd ..; rm -rf *ython*deb* | tee >> $logfirst; rm -rf temp/ | tee >> $logfirst; echo "downloading and extracting python2.6_i386 done.." | tee >> $logfirst; echo " "; echo "copy also python2.6_64bit version to $pyth"; sudo cp -v /var/cache/apt/archives/*python2.6*amd64.deb $pyth/ | tee >> $logfirst; echo "done";  
							echo " "; echo downloading and extracting PythonInterface 32/64bit [2,1MB] into your X-Plane plugin-directory? y/n
							read answer
							if [ "$answer" = "y" ]
								then logfirst="x-plane_startscript_firsttimesetup_$(date +%y-%m-%d).log" 
								echo " " >> $logfirst; wget $d4 | tee >> $logfirst; unzip *ython*face*.zip | tee >> $logfirst; mv -v *ython*face/ $xplane/Resources/plugins/ | tee >> $logfirst; rm *ython*face*.zip | tee >> $logfirst; echo; echo "done";

									echo " "; echo downloading and extracting X-Economy Client [34,7kb] into your X-Plane plugin-directory? y/n
									read answer
									if [ "$answer" = "y" ]
										then logfirst="x-plane_startscript_firsttimesetup_$(date +%y-%m-%d).log" 
										echo; wget $d5 | tee >> $logfirst; mkdir $xplane/Resources/plugins/PythonScripts/ | tee >> $logfirst; mv -v PI_xfse.py $xplane/Resources/plugins/PythonScripts/ | tee >> $logfirst; xini="$xplane/Resources/plugins/PythonScripts/x-economy.ini"; echo insert your FSE username; read username; echo $username > $xini; echo " "; echo insert your FSE password; read password; echo $password >> $xini; echo; echo "done" | tee >> $logfirst;
									else ftime=1

									fi
								
							else ftime=1; echo; echo downloading and extracting X-Economy Client [34,7kb] into your X-Plane plugin-directory? y/n
									read answer
									if [ "$answer" = "y" ]
										then logfirst="x-plane_startscript_firsttimesetup_$(date +%y-%m-%d).log" 
										echo; date > $logfirst; wget $d5 | tee >> $logfirst; mkdir $xplane/Resources/plugins/PythonScripts/ | tee >> $logfirst; mv -v PI_xfse.py $xplane/Resources/plugins/PythonScripts/ | tee >> $logfirst; xini="$xplane/Resources/plugins/PythonScripts/x-economy.ini"; echo insert your FSE username; read username; echo $username > $xini; echo " "; echo insert your FSE password; read password; echo $password >> $xini; echo; echo "done" | tee >> $logfirst;
									else ftime=0

									fi
							fi
						
					else ftime=1; echo; echo downloading and extracting PythonInterface 32/64bit [2,1MB] into your X-Plane plugin-directory? y/n
							read answer
							if [ "$answer" = "y" ]
								then logfirst="x-plane_startscript_firsttimesetup_$(date +%y-%m-%d).log" 
								echo; date > $logfirst; echo " " >> $logfirst; wget $d4 | tee >> $logfirst; unzip *ython*face*.zip | tee >> $logfirst; mv -v *ython*face/ $xplane/Resources/plugins/ | tee >> $logfirst; rm *ython*face*.zip | tee >> $logfirst; echo; echo "done"

									echo " ";echo downloading and extracting X-Economy Client [34,7kb] into your X-Plane plugin-directory? y/n
									read answer
									if [ "$answer" = "y" ]
										then logfirst="x-plane_startscript_firsttimesetup_$(date +%y-%m-%d).log" 
										echo; wget $d5 | tee >> $logfirst; mkdir $xplane/Resources/plugins/PythonScripts/ | tee >> $logfirst; mv -v PI_xfse.py $xplane/Resources/plugins/PythonScripts/ | tee >> $logfirst; xini="$xplane/Resources/plugins/PythonScripts/x-economy.ini"; echo insert your FSE username; read username; echo $username > $xini; echo " "; echo insert your FSE password; read password; echo $password >> $xini; echo; echo "done" | tee >> $logfirst;
									else ftime=1

									fi
								
							else ftime=1; echo; echo downloading and extracting X-Economy Client [34,7kb] into your X-Plane plugin-directory? y/n
									read answer
									if [ "$answer" = "y" ]
										then logfirst="x-plane_startscript_firsttimesetup_$(date +%y-%m-%d).log" 
										echo; date > $logfirst; wget $d5 | tee >> $logfirst; mkdir $xplane/Resources/plugins/PythonScripts/ | tee >> $logfirst; mv -v PI_xfse.py $xplane/Resources/plugins/PythonScripts/ | tee >> $logfirst; xini="$xplane/Resources/plugins/PythonScripts/x-economy.ini"; echo insert your FSE username; read username; echo $username > $xini; echo " "; echo insert your FSE password; read password; echo $password >> $xini; echo; echo "done" | tee >> $logfirst;
									else ftime=1

									fi
							fi
					

					fi
fi
echo
echo " " > $logd; date >> $logd; echo " " >> $logd
echo
echo You will run X-Plane with [1]32bit oder [2]64bit mode?
echo
read answer
if [ "$answer" = "1" ]
		# dirty copy to python2.6 32bit
	then sudo cp -vR $pyth/* /usr/lib/ | tee >> $logd
		echo
		$xplane/X-Plane-i386 &
		echo " " >> $logd; echo "32bit done..." >> $logd
	else 	echo
		# switching back to original ubuntu python2.6 64bit
		sudo dpkg -i $pyth/*amd64.deb | tee $logd
		echo		
		$xplane/X-Plane-x86_64 &
		echo " " >> $logd; echo "64bit done..." >> $logd
fi
echo
echo "$(tput setab 2)END$(tput sgr0)"
echo
notify-send Script "Have a good flight and kiss the soil when you land..."
exit 0

Moderiert von V for Vortex:

Eher ein Projekt als eine Frage zu Spielen. Daher verschoben.

march Team-Icon

Avatar von march

Anmeldungsdatum:
12. Juni 2005

Beiträge: 17329

Du kannst gerne einen Wikiartikel zu X-Plane anlegen - der fehlt noch. ☺ Dort kannst du dein Skript hinterlegen. Im Forum geht so etwas irgendwann unter.

zeroc

(Themenstarter)
Avatar von zeroc

Anmeldungsdatum:
20. September 2008

Beiträge: 131

das würde ich sogar gerne tun, nur leider habe ich keine erfahrungen mit wikis.

wenn das jemand vorbereiten könnte, würde ich mich da mit einbringen.

grüße,

zeroc

march Team-Icon

Avatar von march

Anmeldungsdatum:
12. Juni 2005

Beiträge: 17329

Super. 👍

Ich habe dir unter Baustelle/Spiele/X-Plane eine Baustelle eingerichtet. Hier kannst du den Inhalt beisteuern (Text, Screenshots, ...). Um die Syntax kann ich mich später kümmern. Unter Spiele kannst du ja nachschauen wie solche Artikel generell aufgebaut sind. ☺

Antworten |