elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Trabajando con las ramas de git (tercera parte)


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  Como puedo hacer un launcher asi, con VBS o con HTML, decidme
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 2 3 [4] 5 6 7 8 Ir Abajo Respuesta Imprimir
Autor Tema: Como puedo hacer un launcher asi, con VBS o con HTML, decidme  (Leído 32,445 veces)
Novlucker
Ninja y
Colaborador
***
Desconectado Desconectado

Mensajes: 10.683

Yo que tu lo pienso dos veces


Ver Perfil
Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
« Respuesta #30 en: 12 Diciembre 2012, 15:12 pm »

No me cuesta nada, pero no me creo que hayas hecho siquiera el intento, y eso me molesta :¬¬

Aún sigues con el problema de asignar el nombre de usuario, así que te vuelvo a dar la misma idea por tercera vez;
Código
  1. <html>
  2. <HEAD>
  3. <TITLE>LAUNCHER</TITLE>
  4. <script>
  5. function show(myID) {
  6. document.getElementById(myID).style.display = "block";
  7. }
  8. function hide(myID) {
  9. document.getElementById(myID).style.display = "none";
  10. }
  11. </script>
  12. <style type="text/css">
  13. .panel
  14. {
  15. position:absolute;
  16. width:510px;
  17. height:340px;
  18. top:45px;
  19. left:0px;
  20. text-align:center;
  21. background: #fff url('images/fondo.png') repeat;
  22. }
  23. .subp {
  24. width:382px;
  25. height:340px;
  26. position:absolute;
  27. left:260px;
  28. margin-left:-191px;
  29. top:0;
  30. background-color:#e5eecc;
  31. border:solid 1px #c3c3c3;
  32. }
  33. #wbo {
  34. position:absolute;
  35. width:510px;
  36. height:430px;
  37. left:0;
  38. top:0;
  39. background: #000;
  40. display:none;
  41. }
  42. </style>
  43. <style>
  44. body {
  45. width:100%;
  46. height:100%;
  47. margin:0px;
  48. font-family:arial;
  49. font-size:12px;
  50. }
  51. #table {
  52. text-align:center;
  53. position:absolute;
  54. bottom:0px;
  55. left:0px;
  56. }
  57. #td {
  58. width:170px;
  59. }
  60. .bg {
  61. /* Set rules to fill background */
  62. background: #fff url('images/fondo.png') repeat;
  63. /* Set up proportionate scaling */
  64. width: 510px;
  65. height: 340px;
  66.  
  67. /* Set up positioning */
  68. position: absolute;
  69. top: 45;
  70. left: 0;
  71. }
  72.  
  73.  
  74. .logo {
  75. position:absolute;
  76. width:410px;
  77. height:75px;
  78. top:55px;
  79. left:260px;
  80. margin-left:-205px;
  81. }
  82. .logo2 {
  83. position:absolute;
  84. top:135px;
  85. left:260px;
  86. width:180px;
  87. height:32px;
  88. margin-left:-90px;
  89. }
  90. .login {
  91. width:350px;
  92. height:70px;
  93. background: #808080;
  94. position:absolute;
  95. left:260px;
  96. margin-left:-175px;
  97. top:174px;
  98. border: 5px #000 solid;
  99. }
  100. .wbg {
  101. width:510px;
  102. height:45px;
  103. position:absolute;
  104. top:0px;
  105. left:0px;
  106. background: url('images/wbg.png') repeat;
  107. }
  108. @font-face {
  109.    font-family: 'xeronregular';
  110.    src: url('fonts/xeron.eot');
  111.    src: url('fonts/xeron.eot?#iefix') format('embedded-opentype'),
  112.         url('fonts/xeron.woff') format('woff'),
  113.         url('fonts/xeron.ttf') format('truetype'),
  114.         url('fonts/xeron.svg#xeronregular') format('svg');
  115.    font-weight: normal;
  116.    font-style: normal;
  117.  
  118. }
  119. .back {
  120. width:510px;
  121. height:45px;
  122. background:#000;
  123. position:absolute;
  124. bottom:0px;
  125. left:0px;
  126. }
  127. #byr {
  128. width:125px;
  129. height:25px;
  130. }
  131. #cerrar {
  132. width:16px;
  133. height:16px;
  134. top:15px;
  135. right:16px;
  136. position:absolute;
  137. }
  138. .ser13 {
  139. position:absolute;
  140. left: 260px;
  141. margin-left:-90px;
  142. bottom:55px;
  143. }
  144. #wbod {
  145. width:100%;
  146. height:100%;
  147. }
  148. #back {
  149. position:relative;
  150. top:5px;
  151. }
  152. </style>
  153. <HTA:APPLICATION
  154. ID="HTA"
  155. APPLICATIONNAME="HTA"
  156. BORDER="none"
  157. BORDER STYLE="raised"
  158. CAPTION="yes"
  159. SCROLL="no"
  160. SELECTION="no">
  161. <body bgcolor="000000">
  162. </HEAD>
  163. <body>
  164. <center>
  165. <script language="VBScript">
  166. Function ejecutar()
  167. set objshell = createobject("wscript.shell")
  168. appdata = objshell.expandenvironmentstrings("%APPDATA%")
  169. objshell.run appdata & "\Ikillnukes\MC.bat"
  170. End Function
  171.  
  172. Function opciones()
  173. set objshell = createobject("wscript.shell")
  174. appdata = objshell.expandenvironmentstrings("%APPDATA%")
  175. objshell.run appdata & "\Ikillnukes\OPT.hta"
  176. End Function
  177. </script>
  178.  
  179. <div id="wbod">
  180. <div class="wbg">
  181. <h2 style="color:#fff; font-family: 'xeronregular'; position:absolute; top:3px; left:16px; width:510px; margin-left:-260px; left:260px;"><b>HugeCraft</b><b style="font-family: 'arial';">&#38;#8482;</b><b> - Login</b></h2>
  182. <img src="images/cerrar0.png" onmouseover="this.src='images/cerrar1.png';" onmouseout="this.src='images/cerrar0.png';" onClick="javascript:window.close();" name="btnCerrar" id="cerrar" />
  183. </div>
  184. <div class="bg">
  185. </div>
  186. <img src="images\image2.png" class="logo" />
  187. <img src="images\text.png" class="logo2" />
  188. <div class="login">
  189. <center><br>Usuario: <input type="text" style="width:200px;" name="username" /></center>
  190. </div>
  191. <img src="images/serie1.png" onmouseover="this.src='images/serie2.png';" onmouseout="this.src='images/serie1.png';" onClick="show('serie')" name="btnSerie" class="ser13" />
  192. <div class="back">
  193.  
  194. <table id="table">
  195. <tr><td id="td">
  196. <img src="images/opciones1.png" onmouseover="this.src='images/opciones2.png';" onmouseout="this.src='images/opciones1.png';" onClick="show('wbo')" name="btnOpciones" id="byr" />
  197. </td><td id="td">
  198. <img src="images/jugar1.png" onmouseover="this.src='images/jugar2.png';" onmouseout="this.src='images/jugar1.png';" onclick="ejecutar()" name="btnEjecutar" id="byr" />
  199. </td><td id="td">
  200. <img src="images/creditos1.png" onmouseover="this.src='images/creditos2.png';" onmouseout="this.src='images/creditos1.png';" onClick="show('credit')" name="btnCreditos" id="byr" />
  201. </td></tr></table>
  202.  
  203. </div>
  204. <div id="wbo">
  205. <div class="wbg">
  206. <h2 style="color:#fff; font-family: 'xeronregular'; position:absolute; top:3px; left:16px; width:510px; margin-left:-260px; left:260px;"><b>HugeCraft</b><b style="font-family: 'arial';">&#38;#8482;</b><b> - Opciones</b></h2>
  207. </div>
  208. <div class="panel"><div class="subp">Hello world!</div></div>
  209. <div class="back">
  210. <img src="images/back1.png" onmouseover="this.src='images/back2.png';" onmouseout="this.src='images/back1.png';" onClick="hide('wbo')" name="btnCreditos" id="back" />
  211. </div>
  212. </div>
  213. </div>
  214.  
  215. <script language="VBScript">
  216.    Sub Window_Onload
  217.        strComputer = "."
  218.        Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
  219.        Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
  220.        For Each objItem in colItems
  221.            intHorizontal = objItem.ScreenWidth
  222.            intVertical = objItem.ScreenHeight
  223.        Next
  224.        intLeft = (intHorizontal - 510) / 2
  225.        intTop = (intVertical - 430) / 2
  226.        window.resizeTo 510,430
  227.        window.moveTo intLeft, intTop
  228. document.getElementById("username").value = "Novlucker"
  229.    End Sub
  230. </script>
  231.  
  232.  
  233. </center>
  234. </body>
  235. </html>

Debes de reemplazar "Novlucker" por el texto retornado desde tu archivo

Saludos


En línea

Contribuye con la limpieza del foro, reporta los "casos perdidos" a un MOD XD
"Hay dos cosas infinitas: el Universo y la estupidez  humana. Y de la primera no estoy muy seguro."
Albert Einstein
z3nth10n


Desconectado Desconectado

Mensajes: 1.583


"Jack of all trades, master of none." - Zenthion


Ver Perfil WWW
Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
« Respuesta #31 en: 12 Diciembre 2012, 15:23 pm »

Pero si es lo mismo que el JS.

Pero, lo necesito en archivo externo para poder editarlo con BAT.

? Si lo siento que no lo haya intentado, es que no se como hacer lo que quiero hacer.
Por eso. Sorry.  :silbar:


En línea


Interesados hablad por Discord.
Novlucker
Ninja y
Colaborador
***
Desconectado Desconectado

Mensajes: 10.683

Yo que tu lo pienso dos veces


Ver Perfil
Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
« Respuesta #32 en: 12 Diciembre 2012, 16:00 pm »

Debes de reemplazar "Novlucker" por el texto retornado desde tu archivo
Pero, lo necesito en archivo externo para poder editarlo con BAT.
Seguro que con un par de ajustes lo consigues ;-)
En línea

Contribuye con la limpieza del foro, reporta los "casos perdidos" a un MOD XD
"Hay dos cosas infinitas: el Universo y la estupidez  humana. Y de la primera no estoy muy seguro."
Albert Einstein
z3nth10n


Desconectado Desconectado

Mensajes: 1.583


"Jack of all trades, master of none." - Zenthion


Ver Perfil WWW
Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
« Respuesta #33 en: 12 Diciembre 2012, 16:16 pm »

Seguro que con un "par" de ajustes lo consigues ;-)

Ya estamos en el mismo caso de antes. No he tocado en mi vida VBscript... Si JS pero que no se como lo puedo hacer, dios, que te cuesta, nada, por favor, si no lo intento es porque no se como seguir, me arte a buscar y no encontre absolutamente NADA.  :¬¬
En línea


Interesados hablad por Discord.
Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.818



Ver Perfil
Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
« Respuesta #34 en: 12 Diciembre 2012, 16:37 pm »

me arte a buscar y no encontre absolutamente NADA.  :¬¬

No me lo creo!

Google + "read textfile vbs"
En la primera entrada tienes la solución.


EDITO:

Código
  1.    <script language="VBScript">
  2.       Sub Window_Onload
  3.           strComputer = "."
  4.           Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
  5.           Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
  6.           For Each objItem in colItems
  7.               intHorizontal = objItem.ScreenWidth
  8.               intVertical = objItem.ScreenHeight
  9.           Next
  10.           intLeft = (intHorizontal - 510) / 2
  11.           intTop = (intVertical - 430) / 2
  12.           window.resizeTo 510,430
  13.           window.moveTo intLeft, intTop
  14.  
  15.           ' Aquí lees la linea del archivo de texto
  16.            set objFileToRead = CreateObject("Scripting.FileSystemObject").OpenTextFile("User.txt",1)
  17.            strLine = objFileToRead.ReadLine()
  18.            objFileToRead.Close
  19.  
  20.            document.getElementById("username").value = strLine
  21.       End Sub
  22.    </script>
« Última modificación: 12 Diciembre 2012, 16:49 pm por EleKtro H@cker » En línea

z3nth10n


Desconectado Desconectado

Mensajes: 1.583


"Jack of all trades, master of none." - Zenthion


Ver Perfil WWW
Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
« Respuesta #35 en: 12 Diciembre 2012, 16:52 pm »

Really???????

En serio, no miento me tire la media hora buscando y no encontre nada.

Esta es la diferencia en entre el español y el ingles (aunque tambien buque en ingles) enserio... O no uso palabras o no se buscar y encontrarrrrr DIOS xD

Gracias. Me tengo que ir luego le hecho un vistazo  ;-) ;-) ;-) ;-)



Ese texto me suena, lo que habeis hecho es ponerle lo del document MMM

Si vale... soy un zopenco, tienes razon Nov no a ver probado... Lo siento de veras.

Pero es que me he asustado un poco con esto del VBS y no queria cargarme nada, en fin... Muchas gracias.

Tengo otra dudilla...

Como puedo mezclar la function "jugar" con el Window.close(); es que me da error...

Y eso si que estuve probando.

Un saludo.



Sa p**a madre! Si que funciona si! XDXD

Y como haria para editar desde el input y que cada vez que pusieras algo automaticamente se guardara?  :xD

Subimos de nivel, intentare buscar algo y os cuento.  :silbar:
« Última modificación: 12 Diciembre 2012, 18:11 pm por Seazoux » En línea


Interesados hablad por Discord.
Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.818



Ver Perfil
Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
« Respuesta #36 en: 12 Diciembre 2012, 18:32 pm »

Y como haria para editar desde el input y que cada vez que pusieras algo automaticamente se guardara?  :xD

intentare buscar

No te tienes que ir muy lejos

Google + "read textfile vbs"
En la primera entrada tienes la solución.

http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/other/textfiles/#WriteDataText.htm

EDITO: Creo que con un FOR podrías hacer una especie de evento para detectar cada vez que se añade/elimina una letra en el textbox y entonces guardar el valor en el archivo de texto,
eso si lo quieres hacer perfecto :xD pero yo lo que haría es escribir el valor del textbox en el archivo de texto cuando pulsas el botón de jugar, que se guarde cuando pulses ese botón.

saludos
« Última modificación: 12 Diciembre 2012, 18:42 pm por EleKtro H@cker » En línea

z3nth10n


Desconectado Desconectado

Mensajes: 1.583


"Jack of all trades, master of none." - Zenthion


Ver Perfil WWW
Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
« Respuesta #37 en: 12 Diciembre 2012, 19:43 pm »

Mezclando lenguajes.
Elektro Rulez.
En línea


Interesados hablad por Discord.
z3nth10n


Desconectado Desconectado

Mensajes: 1.583


"Jack of all trades, master of none." - Zenthion


Ver Perfil WWW
Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
« Respuesta #38 en: 13 Diciembre 2012, 14:55 pm »

Ha pasado un dia casi. Tecnicamente puedo volver a postear sin hacer doble post.

Ay! otra vez me ha entrado el panico...  :rolleyes:

Como lo podria hacer? Ideas, pistas, algo...  :P

Gracias.



A ver, si tengo el input... podria hacer un getElementById().value = srtrLine?

O no es igual que la multiplicacion, el orden de los factores no altera el producto?

Es que no se como obtener el vale de un txt para meterlo en una variable  :laugh:



Porque solo me sale asp, ademas lo quiero ya encontrar hecho a ver si lo encuentro...  >:D



Ostis: http://ezinearticles.com/?VBScript---FileSystemObject&id=294348

To enable the use of friendly names for these modes add the following constants to your script:


Citar
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

Es decir, a ver...  :o



Ehm vale....

objTextFile.WriteLine("Hallo world")

Problema, como le meto el input del text?  :-\

Un saludo.



Nov no te quejabas de que no probaba:

Código:
	    set Linea = document.getElementById("username").value
   Set objTextFile = objFSO.OpenTextFile("User.txt", ForWriting, True)
   objTextFile.WriteLine(Linea)
            objTextFile.Close

Problema:



Un saludo.



Probando probando hice esto:

Código:
<script>
Function test()
Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
    ("User.txt", ForAppending, True)   
    objTextFile.WriteLine("test")
objTextFile.Close
End Function

</script>

y

Citar
<input value="Test" onClick="test()" style="position:relative; top:30px;" type="button" />

Y si funciona, pero no se como poner en "Test"

La variable del input y que se actualice automaticamente.
Un saludo.  :o
« Última modificación: 13 Diciembre 2012, 15:39 pm por Seazoux » En línea


Interesados hablad por Discord.
Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.818



Ver Perfil
Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
« Respuesta #39 en: 13 Diciembre 2012, 16:03 pm »

Seazoux, lo tienes todo hecho, solo hace falta este pequeño ajuste:

Código
  1. Function test(argumento)
  2.    Set objFSO = CreateObject("Scripting.FileSystemObject")
  3.  
  4.    ' el "8" hace un "appending", en el ejemplo de arriba lo usas pero no creo que séa lo que quieres, usa el "2" si pretendes reemplazar el contenido del archivo:
  5.    ' Set objTextFile = objFSO.OpenTextFile("User.txt", 2, True)
  6.  
  7.    Set objTextFile = objFSO.OpenTextFile("User.txt", 8, True)  
  8.    objTextFile.WriteLine(argumento)
  9.    objTextFile.Close
  10. End Function


Código:
<input value="Test" onClick="test(argumento)" style="position:relative; top:30px;" type="button" />

* donde onClick="test(argumento)" argumento debe ser el nombre de la variable que contiene el texto del texbox, si no recuerdo mal era "strline".

Saludos.
« Última modificación: 13 Diciembre 2012, 16:15 pm por EleKtro H@cker » En línea

Páginas: 1 2 3 [4] 5 6 7 8 Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines