Como puedo hacer un launcher asi, con VBS o con HTML, decidme

Iniciado por z3nth10n, 8 Diciembre 2012, 14:52 PM

0 Miembros y 1 Visitante están viendo este tema.

Novlucker

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 (html,189,228) [Seleccionar]
<html>
<HEAD>
<TITLE>LAUNCHER</TITLE>
<script>
function show(myID) {
document.getElementById(myID).style.display = "block";
}
function hide(myID) {
document.getElementById(myID).style.display = "none";
}
</script>
<style type="text/css">
.panel
{
position:absolute;
width:510px;
height:340px;
top:45px;
left:0px;
text-align:center;
background: #fff url('images/fondo.png') repeat;
}
.subp {
width:382px;
height:340px;
position:absolute;
left:260px;
margin-left:-191px;
top:0;
background-color:#e5eecc;
border:solid 1px #c3c3c3;
}
#wbo {
position:absolute;
width:510px;
height:430px;
left:0;
top:0;
background: #000;
display:none;
}
</style>
<style>
body {
width:100%;
height:100%;
margin:0px;
font-family:arial;
font-size:12px;
}
#table {
text-align:center;
position:absolute;
bottom:0px;
left:0px;
}
#td {
width:170px;
}
.bg {
/* Set rules to fill background */
background: #fff url('images/fondo.png') repeat;
/* Set up proportionate scaling */
width: 510px;
height: 340px;

/* Set up positioning */
position: absolute;
top: 45;
left: 0;
}


.logo {
position:absolute;
width:410px;
height:75px;
top:55px;
left:260px;
margin-left:-205px;
}
.logo2 {
position:absolute;
top:135px;
left:260px;
width:180px;
height:32px;
margin-left:-90px;
}
.login {
width:350px;
height:70px;
background: #808080;
position:absolute;
left:260px;
margin-left:-175px;
top:174px;
border: 5px #000 solid;
}
.wbg {
width:510px;
height:45px;
position:absolute;
top:0px;
left:0px;
background: url('images/wbg.png') repeat;
}
@font-face {
    font-family: 'xeronregular';
    src: url('fonts/xeron.eot');
    src: url('fonts/xeron.eot?#iefix') format('embedded-opentype'),
         url('fonts/xeron.woff') format('woff'),
         url('fonts/xeron.ttf') format('truetype'),
         url('fonts/xeron.svg#xeronregular') format('svg');
    font-weight: normal;
    font-style: normal;

}
.back {
width:510px;
height:45px;
background:#000;
position:absolute;
bottom:0px;
left:0px;
}
#byr {
width:125px;
height:25px;
}
#cerrar {
width:16px;
height:16px;
top:15px;
right:16px;
position:absolute;
}
.ser13 {
position:absolute;
left: 260px;
margin-left:-90px;
bottom:55px;
}
#wbod {
width:100%;
height:100%;
}
#back {
position:relative;
top:5px;
}
</style>
<HTA:APPLICATION
ID="HTA"
APPLICATIONNAME="HTA"
BORDER="none"
BORDER STYLE="raised"
CAPTION="yes"
SCROLL="no"
SELECTION="no">
<body bgcolor="000000">
</HEAD>
<body>
<center>
<script language="VBScript">
Function ejecutar()
set objshell = createobject("wscript.shell")
appdata = objshell.expandenvironmentstrings("%APPDATA%")
objshell.run appdata & "\Ikillnukes\MC.bat"
End Function

Function opciones()
set objshell = createobject("wscript.shell")
appdata = objshell.expandenvironmentstrings("%APPDATA%")
objshell.run appdata & "\Ikillnukes\OPT.hta"
End Function
</script>

<div id="wbod">
<div class="wbg">
<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';">&#8482;</b><b> - Login</b></h2>
<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" />
</div>
<div class="bg">
</div>
<img src="images\image2.png" class="logo" />
<img src="images\text.png" class="logo2" />
<div class="login">
<center><br>Usuario: <input type="text" style="width:200px;" name="username" /></center>
</div>
<img src="images/serie1.png" onmouseover="this.src='images/serie2.png';" onmouseout="this.src='images/serie1.png';" onClick="show('serie')" name="btnSerie" class="ser13" />
<div class="back">

<table id="table">
<tr><td id="td">
<img src="images/opciones1.png" onmouseover="this.src='images/opciones2.png';" onmouseout="this.src='images/opciones1.png';" onClick="show('wbo')" name="btnOpciones" id="byr" />
</td><td id="td">
<img src="images/jugar1.png" onmouseover="this.src='images/jugar2.png';" onmouseout="this.src='images/jugar1.png';" onclick="ejecutar()" name="btnEjecutar" id="byr" />
</td><td id="td">
<img src="images/creditos1.png" onmouseover="this.src='images/creditos2.png';" onmouseout="this.src='images/creditos1.png';" onClick="show('credit')" name="btnCreditos" id="byr" />
</td></tr></table>

</div>
<div id="wbo">
<div class="wbg">
<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';">&#8482;</b><b> - Opciones</b></h2>
</div>
<div class="panel"><div class="subp">Hello world!</div></div>
<div class="back">
<img src="images/back1.png" onmouseover="this.src='images/back2.png';" onmouseout="this.src='images/back1.png';" onClick="hide('wbo')" name="btnCreditos" id="back" />
</div>
</div>
</div>

<script language="VBScript">
    Sub Window_Onload
        strComputer = "."
        Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
        Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
        For Each objItem in colItems
            intHorizontal = objItem.ScreenWidth
            intVertical = objItem.ScreenHeight
        Next
        intLeft = (intHorizontal - 510) / 2
        intTop = (intVertical - 430) / 2
        window.resizeTo 510,430
        window.moveTo intLeft, intTop
document.getElementById("username").value = "Novlucker"
    End Sub
</script>


</center>
</body>
</html>


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

Saludos
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

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:

Interesados hablad por Discord.

Novlucker

Cita de: Novlucker en 12 Diciembre 2012, 15:12 PMDebes de reemplazar "Novlucker" por el texto retornado desde tu archivo
Cita de: Seazoux en 12 Diciembre 2012, 15:23 PM
Pero, lo necesito en archivo externo para poder editarlo con BAT.
Seguro que con un par de ajustes lo consigues ;-)
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

Cita de: Novlucker en 12 Diciembre 2012, 16:00 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.  :¬¬

Interesados hablad por Discord.

Eleкtro

#34
Cita de: Seazoux en 12 Diciembre 2012, 16:16 PMme 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 (vb) [Seleccionar]
   <script language="VBScript">
      Sub Window_Onload
          strComputer = "."
          Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
          Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
          For Each objItem in colItems
              intHorizontal = objItem.ScreenWidth
              intVertical = objItem.ScreenHeight
          Next
          intLeft = (intHorizontal - 510) / 2
          intTop = (intVertical - 430) / 2
          window.resizeTo 510,430
          window.moveTo intLeft, intTop

          ' Aquí lees la linea del archivo de texto
           set objFileToRead = CreateObject("Scripting.FileSystemObject").OpenTextFile("User.txt",1)
           strLine = objFileToRead.ReadLine()
            objFileToRead.Close

           document.getElementById("username").value = strLine
      End Sub
   </script>








z3nth10n

#35
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:

Interesados hablad por Discord.

Eleкtro

#36
Cita de: Seazoux en 12 Diciembre 2012, 16:52 PMY 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

Cita de: EleKtro H@cker en 12 Diciembre 2012, 16:37 PM
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








z3nth10n


Interesados hablad por Discord.

z3nth10n

#38
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:


CitarConst 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:

   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:


<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

Interesados hablad por Discord.

Eleкtro

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

Código (vb) [Seleccionar]
Function test(argumento)
   Set objFSO = CreateObject("Scripting.FileSystemObject")

   ' 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:
   ' Set objTextFile = objFSO.OpenTextFile("User.txt", 2, True)

   Set objTextFile = objFSO.OpenTextFile("User.txt", 8, True)  
   objTextFile.WriteLine(argumento)
   objTextFile.Close
End Function



<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.