1. #!/bin/bash
  2. echo '
  3. Autor ----------------> Inukaze ( Venezuela )
  4. Sitio ----------------> inukaze.wordpress.com
  5. Correo-E -------------> [email protected]
  6. Licensia -------------> GPL 2
  7. ******* Inicio : Acerca de este Script ********
  8. Es un Script sencillo para descargar
  9. instalar y configurar el videojuego
  10. "Ace Of Spades 0.75"
  11. Requiere Tener Instalado : Wine
  12. ******** Fin : Acerca de este Script **********
  13. '
  14. #Variables :
  15. RUTA=$(pwd)
  16. VersionWine=$(wine --version)
  17. WINEIC="$HOME/.wine/drive_c"
  18. MIMESA="$HOME/.local/share/applications/mimeapps.list"
  19. MIMESL=$(cat $HOME/.local/share/applications/mimeapps.list | grep "x-scheme-handler/aos=aos.desktop")
  20. MIMESC="$HOME/.local/share/mime"
  21. ARCHIVO="AceOfSpades075.tar.bz2"
  22. ICONO="AceOfSpades.png"
  23. URL="https://dl.dropboxusercontent.com/u/3164499"
  24. SERVIDORES1="http://www.buildandshoot.com/portal.php"
  25. SERVIDORES2="http://aos.acornserver.com"
  26. CAOS="$HOME/.wine/drive_c/Ace of Spades"
  27. # Comprobrar cosas :
  28. # 1 - Wine instalado
  29. if [ -z $VersionWine ]; then
  30. echo "
  31. No se ha detectado wine instalado
  32. Debes instalar Wine para usarlo"
  33. exit 1
  34. else
  35. echo "
  36. Version de Wine Detectada : $VersionWine"
  37. $(wineboot)
  38. fi
  39. # 2 - Comprar que ya esta preconfigurado
  40. if test -d "$WINEIC"
  41. then
  42. echo "
  43. Wine preconfigurado encontrado"
  44. else
  45. if [ -z "$VersionWine" ]; then
  46. echo "
  47. No se ha detectado wine instalado
  48. Debes instalar Wine para usarlo"
  49. exit 1
  50. else
  51. echo "
  52. Version de Wine Detectada : $VersionWine"
  53. $(wineboot)
  54. fi
  55. if test -f "$HOME/.wine/drive_c/Ace of Spades/Start"
  56. then
  57. rm "$HOME/.wine/drive_c/Ace of Spades/Start"
  58. fi
  59. fi
  60. if test -d "$CAOS"
  61. then
  62. echo "
  63. La carpeta
  64. "'"'"$CAOS"'"'"
  65. sera eliminada
  66. Para descargar e instalar la version 0.75"
  67. rm -rf "$CAOS"
  68. else
  69. echo "
  70. La Carpeta $CAOS no existe, sera creada"
  71. fi
  72. if test -f "$HOME/.local/share/aos.desktop"
  73. then
  74. rm "$HOME/.local/share/aos.desktop"
  75. fi
  76. # Script de Instalacion & Configuracion de "Ace Of Spades"
  77. # Descargar e Instalar
  78. if test -d $WINEIC
  79. then
  80. cd "$WINEIC"
  81. if test -f AceOfSpades075.tar.bz2
  82. then
  83. 2>/dev/null 1>/dev/null tar xfvj "$ARCHIVO" &> /dev/null
  84. else
  85. wget "$URL/Windows/Juego%20Online/$ARCHIVO"
  86. wget "$URL/Linux/Iconos/$ICONO"
  87. 2>/dev/null 1>/dev/null tar xfvj "$ARCHIVO" &> /dev/null
  88. cd "$RUTA"
  89. fi
  90. fi
  91. # 3 - Configurar
  92. if [ -z "$MIMESL" ]; then
  93. sed -i '/\[Default Applications\]/a x-scheme-handler/aos=aos.desktop' "$MIMESA"
  94. else
  95. echo "
  96. Ya esta configurado el tipo Mime"
  97. fi
  98. echo '#!/bin/bash
  99. # Solucion de Resolucion
  100. echo `xrandr --current | grep current | awk '"'{print "'$8'"}'"'` >> /tmp/ancho
  101. echo `xrandr --current | grep current | awk '"'{print "'$10'"}'"'` >> /tmp/alto
  102. cat /tmp/alto | sed -i '"'s/,//g'"' /tmp/alto
  103. ANCHO=$(cat /tmp/ancho)
  104. ALTO=$(cat /tmp/alto)
  105. rm /tmp/ancho /tmp/alto
  106. echo "$ANCHO"'"x"'"$ALTO" >> /tmp/Resolucion
  107. Resolucion=$(cat /tmp/Resolucion)
  108. rm /tmp/Resolucion
  109. # Solucion de Resolucion
  110. BINARIO="$HOME/.wine/drive_c/Ace of Spades/client.exe"
  111. $(wine "$BINARIO" -"$@" "%u") &
  112. xrandr -s 800x600 -r 77
  113. sleep 2
  114. BINARIOPID=$(pidof $BINARIO)
  115. taskset -p 0xFFFFFFFF $BINARIOPID &
  116. while Launchers=$(pidof "client.exe")
  117. do
  118. sleep 1
  119. done
  120. xrandr -s $Resolucion -r 63
  121. exit 0'|tee "$HOME/.wine/drive_c/Ace of Spades/Iniciar" &> /dev/null
  122. chmod a+o+x "$HOME/.wine/drive_c/Ace of Spades/Iniciar"
  123. echo '[Desktop Entry]
  124. Name=Ace Of Spades
  125. Exec=sh "'$HOME'/.wine/drive_c/Ace of Spades/Iniciar" %u
  126. Icon=$HOME/.wine/drive_c/Ace of Spades/AceOfSpades.png
  127. Type=Application
  128. Terminal=false'|tee "$HOME/.local/share/applications/aos.desktop" &> /dev/null
  129. chmod a+o+x "$HOME/.local/share/applications/aos.desktop"
  130. update-mime-database $MIMESC
  131. # Cargar el Navegador en la lista de servidores
  132. xdg-open "$SERVIDORES1"
  133. sleep 5
  134. xdg-open "$SERVIDORES2"
  135. if test -f "$WINEIC/AceOfSpades075.tar.bz2"
  136. then
  137. rm "$WINEIC/AceOfSpades075.tar.bz2"
  138. fi