Mostrar Temas
Páginas: [1 ]
1
Programación / .NET (C#, VB.NET, ASP) / Jason's MP3 v2.5.1 YouTube mp3 mp4 Downloader C#
en: 25 Marzo 2016, 20:58 pm
Hola gente, a pedido del publico o mejor dicho de elektro les traigo una versión recién salida del horno de Jason.
Mejoras:
° Descarga audio en Mp3 y videos en Mp4.
° Nueva función Reproducir & Descargar (escuchas y a la vez descargas, solo con audios)
° Reproductor multimedia integrado
° Chat ¿?
° Configuraciones
° Vista previa mientras se descarga. (solo audio)
Descarga portable, proyecto y codigo fuente (tienen que descomprimir en archivos de programa y usar arrancador o ejecutar Jason21.exe como administrador.)
2
Programación / .NET (C#, VB.NET, ASP) / Jason's ogg 2.1 YouTube Downloader C#
en: 17 Marzo 2016, 05:24 am
Buenas, les traigo un mini proyecto en fase de pruebas para que lo chequeen.
Jason es un downloader de audio de Youtube, tambien organiza y lista las canciones permitiendo cambiar su ubicacion, calidad, nombre, etc.
Esta programado en C# y utiliza la libreria DevExpress. Para funcionar requiere "Microsoft .Net Framework" y cualquier reproductor OGG. (yo recomiendo VLC) .
NOTA: Jason no crackea ni proporciona audio/video protegido por derechos de autor (los mismos son bloqueados)
Links descargas: (proyecto visual studio, portable y ejecutabbe)
el que quiera participar del proyecto lo puede hacer aca:
http://foro.code-makers.es/viewtopic.php?f=21&t=65 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Web;
using System.Net;
using System.IO;
using System.Diagnostics;
using System.Text.RegularExpressions;
using System.Media;
using System.Globalization;
namespace Jason21
{
public partial class Form1 : Form
{
List<string> Canciones = new List<string>();
List<string> urlCanciones = new List<string>();
List<string> mArchivos = new List<string>();
public bool PrimerCheck = true;
public string input;
public string[] parts1;
public string[] parts2;
public string[] parts3;
public string Titulo;
public string[] ImgP;
public string[] ImgTP;
public string[] ImgTP2;
public string[] ImgT;
public string[] videoID;
// v1.1 Reformas
public int intentoDescarga;
public int maxIntentos;
public string ultimaURL;
public int uU = 0;
// v2.0 Reformas
public string urlADS;
//v2.1 Reformas
public string archivo_Configuracion;
public string CarpetaDescargas;
public float megaBytesGlobal;
public int sDescargas = 0;
public bool Cancelar_Busqueda = false;
public string ultimaPestana = "controlBuscar";
public int tDescargas = 0;
public int fDescargas = 0;
public Form1()
{
InitializeComponent();
webBrowser1.ScriptErrorsSuppressed = true;
webBrowser2.ScriptErrorsSuppressed = true;
listBox1.MouseDoubleClick += new MouseEventHandler(listBox1_DoubleClick);
lista_Biblioteca.MouseDoubleClick += new MouseEventHandler(lista_Biblioteca_DoubleClick);
// Control_Pestanas.SelectedPageChanged += new TabControlCancelEventHandler(Control_Pestanas_Selecting);
}
private void Form1_Load(object sender, EventArgs e)
{
archivo_Configuracion = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Jason\JasonConfig.config");
CheckConfig();
ListarCanciones();
intentoDescarga = 2;
boton_CancelarBusqueda.Enabled = false;
Application.DoEvents();
ListarCanciones();
Application.DoEvents();
webBrowser2.Navigate("http://jason.esy.es/");
}
private void boton_Buscar_Click(object sender, EventArgs e)
{
boton_Buscar.Enabled = false;
boton_CancelarBusqueda.Enabled = true;
Canciones.Clear();
urlCanciones.Clear();
listBox1.Items.Clear();
Cancelar_Busqueda = false;
for (int i = 1; i <= (int)input_pagBusqueda.Value; i++)
{
if (Cancelar_Busqueda)
{
i = 100;
}
else
{
Buscar_Agregar(inputText_Buscar.Text, i);
}
}
}
public void Buscar_Agregar(string Busqueda, int Pagina)
{
Control_Pestanas.SelectedPageIndex= 0;
webBrowser1.Navigate("https://www.youtube.com/results?search_query=" + Busqueda + "&page=" + Pagina);
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
HtmlElementCollection theElementCollection = default(HtmlElementCollection);
theElementCollection = webBrowser1.Document.GetElementsByTagName("a");
foreach (HtmlElement curElement in theElementCollection)
{
if (curElement.GetAttribute("classname") == "yt-uix-sessionlink yt-uix-tile-link yt-ui-ellipsis yt-ui-ellipsis-2 spf-link ")
{
bool esLista = curElement.GetAttribute("href").Contains("list");
if (!esLista)
{
listBox1.Items.Add(curElement.GetAttribute("InnerText"));
urlCanciones.Add(curElement.GetAttribute("href"));
}
}
}
}
private void boton_CancelarBusqueda_Click(object sender, EventArgs e)
{
boton_CancelarBusqueda.Enabled = false;
boton_Buscar.Enabled = true;
Cancelar_Busqueda = true;
}
private void listBox1_DoubleClick(object sender, MouseEventArgs e)
{
if (sDescargas <= 3)
{
ConvertirCancion(sender, e);
}
else
{
MessageBox.Show("The free version does not allow many downloads.");
}
}
public void ConvertirCancion(object sender, MouseEventArgs e)
{
int index = this.listBox1.IndexFromPoint(e.Location);
int urlB = listBox1.SelectedIndex;
label_ArchivosDescargados.Text = tDescargas.ToString();
if (index != System.Windows.Forms.ListBox.NoMatches)
{
tabControl1.SelectedIndex = 1;
lista_Descargas.Items.Add(listBox1.SelectedItem);
label_EstadoDescarga.Text = "It becoming! please, be patient...";
label_LocacionDescarga.Text = urlCanciones[urlB];
webBrowser1.Navigate(urlCanciones[listBox1.SelectedIndex]);
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
try
{
input = webBrowser1.DocumentText;
parts1 = input.Split(new string[] { "type=audio" }, StringSplitOptions.None);
maxIntentos = parts1.Count();
parts2 = parts1[intentoDescarga].Split(new string[] { "url=" }, StringSplitOptions.None);
parts3 = parts2[1].Split(new string[] { "\\" }, StringSplitOptions.None);
Titulo = webBrowser1.Document.Title.Replace(" - YouTube", "");
label_EstadoDescarga.Text = "Successful conversion";
label_NombreDescarga.Text = Titulo + ".ogg";
videoID = urlCanciones[listBox1.SelectedIndex].Split(new string[] { "=" }, StringSplitOptions.None);
webBrowser1.Navigate("about:blank");
Application.DoEvents();
DescargarCancion();
}
catch
{
fDescargas ++;
label_DescargasFallidas.Text = fDescargas.ToString();
label_EstadoDescarga.Text = "Error becoming file - try again later.";
label_NombreDescarga.Text = Titulo + ".ogg\"";
webBrowser1.Navigate("about:blank");
}
}
}
public void DescargarCancion()
{
label_EstadoDescarga.Text = "Downloading...";
WebClient Client = new WebClient();
Client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
Client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
Client.DownloadFileAsync(new Uri((HttpUtility.UrlDecode(parts3[0]))), (CarpetaDescargas + "/" + Titulo + ".ogg").Replace("?", ""));
Application.DoEvents();
sDescargas++;
}
public void FalloDescarga()
{
fDescargas++;
sDescargas--;
label_DescargasFallidas.Text = fDescargas.ToString();
label_NombreDescarga.Text = intentoDescarga.ToString() + " - Error : \"" + Titulo + ".ogg\" is protected by copyright.";
File.Delete(CarpetaDescargas + "/" + Titulo + ".ogg");
Application.DoEvents();
/* System.Threading.Thread.Sleep(2000);
this.intentoDescarga += 1;
if (intentoDescarga > 1)
{
ConvertirCancion(null, null);
}
if (intentoDescarga > maxIntentos - 2)
{
intentoDescarga = 1;
}
*/
}
void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
int Porciento = ((int)e.BytesReceived * 100) / ((int)e.TotalBytesToReceive);
label_ArchivosDescargando.Text = sDescargas.ToString();
try
{
progressBar1.Maximum = (int)e.TotalBytesToReceive / 100;
progressBar1.Value = (int)e.BytesReceived / 100;
double megaBytesT = ((double)e.TotalBytesToReceive / 1024) / (1024);
double megaBytesR = ((double)e.BytesReceived / 1024) / (1024);
}
catch
{
label_EstadoDescarga.Text = " Downloading - " + Titulo;
}
try
{
progressBar1.Maximum = (int)e.TotalBytesToReceive / 100;
progressBar1.Value = (int)e.BytesReceived / 100;
double megaBytesT = ((double)e.TotalBytesToReceive / 1024) / (1024);
megaBytesGlobal = (float)megaBytesT;
double megaBytesR = ((double)e.BytesReceived / 1024) / (1024);
if (megaBytesT <= (float)0.5)
{
FalloDescarga();
}
else
{
label_EstadoDescarga.Text = " Downloading " + Porciento + " %";
label_MBr.Text = megaBytesR.ToString().Substring(0, 4) + "Mb.";
label_MBt.Text = megaBytesT.ToString().Substring(0, 4) + "Mb.";
}
}
catch
{
Application.DoEvents();
}
}
void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
if (e.Error != null)
{
FalloDescarga();
}
else
{
string Cancion = CarpetaDescargas + "\\" + Titulo + ".ogg";
if (megaBytesGlobal <= (float)0.5)
{
label_EstadoDescarga.Text = "Unknow error";
}
else
{
sDescargas--;
tDescargas++;
label_ArchivosDescargando.Text = sDescargas.ToString();
label_ArchivosDescargados.Text = tDescargas.ToString();
label_EstadoDescarga.Text = "Download completed";
}
if (checkBox_AbrirFinal.Checked)
{
Process.Start(CarpetaDescargas); //, string.Format("/select,\"{0}\"", Titulo + ".ogg"));
Application.DoEvents();
SendKeys.Send(Titulo);
}
if (checkBox_PlayFinal.Checked)
{
Process.Start(Cancion);
Application.DoEvents();
}
}
}
public void ListarCanciones()
{
if (!PrimerCheck)
{
mArchivos.Clear();
lista_Biblioteca.Items.Clear();
}
string[] archivos = Directory.GetFiles(CarpetaDescargas, "*.*", SearchOption.TopDirectoryOnly);
if (archivos.Length >= 1)
{
foreach (string nombre in archivos)
{
bool esOGG = nombre.Contains(".ogg");
bool esMP3 = nombre.Contains(".mp3");
bool filtro = nombre.ToLower().Contains(textBox_Library_Filter.Text.ToLower());
if (esOGG && filtro || esMP3 && filtro)
{
mArchivos.Add(nombre);
lista_Biblioteca.Items.Add(nombre.Replace(CarpetaDescargas + "\\", "") + " - Location: " + nombre);
}
}
}
PrimerCheck = false;
}
public void CheckConfig()
{
bool abrirFinal = archivo_Configuracion.Contains("openonfinish=true");
bool playFinal = archivo_Configuracion.Contains("playonfinish=true");
bool usarMyMusic = archivo_Configuracion.Contains("usemymusic=true");
if (abrirFinal)
{
usar_MyMusic.Checked = true;
}
else
{
usar_MyMusic.Checked = false;
}
if (playFinal)
{
usar_OtraCarpeta.Checked = true;
}
else
{
usar_OtraCarpeta.Checked = false;
}
if (usarMyMusic)
{
usar_MyMusic.Checked = true;
usar_OtraCarpeta.Checked = false;
elegir_Carpeta.Enabled = false;
CarpetaDescargas = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
textBox_PathChoice.Text = CarpetaDescargas;
textBox_PathChoice.Enabled = false;
}
else if (!usarMyMusic)
{
usar_MyMusic.Checked = false;
usar_OtraCarpeta.Checked = true;
elegir_Carpeta.Enabled = true;
CarpetaDescargas = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Jason\Downpath.config");
textBox_PathChoice.Text = CarpetaDescargas;
}
}
// FIN FIN FIN FIN
private void checkEdit8_CheckedChanged(object sender, EventArgs e)
{
}
private void groupControl4_Paint(object sender, PaintEventArgs e)
{
}
private void comboBox_Filter_Library_type_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void checkBox_AbrirFinal_CheckedChanged(object sender, EventArgs e)
{
if (checkBox_AbrirFinal.Checked)
{
archivo_Configuracion = archivo_Configuracion.Replace("openonfinish=false", "openonfinish=true");
}
else if (!checkBox_AbrirFinal.Checked)
{
archivo_Configuracion = archivo_Configuracion.Replace("openonfinish=true", "openonfinish=false");
}
}
private void checkBox_PlayFinal_CheckedChanged(object sender, EventArgs e)
{
if (checkBox_PlayFinal.Checked)
{
archivo_Configuracion = archivo_Configuracion.Replace("playonfinish=false", "playonfinish=true");
}
else if (!checkBox_PlayFinal.Checked)
{
archivo_Configuracion = archivo_Configuracion.Replace("playonfinish=true", "playonfinish=false");
}
}
private void usar_MyMusic_CheckedChanged(object sender, EventArgs e)
{
if (usar_MyMusic.Checked && archivo_Configuracion.Contains("usemymusic=false"))
{
archivo_Configuracion = archivo_Configuracion.Replace("usemymusic=false", "usemymusic=true");
usar_OtraCarpeta.Checked = false;
textBox_PathChoice.Enabled = false;
elegir_Carpeta.Enabled = false;
CarpetaDescargas = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
textBox_PathChoice.Text = CarpetaDescargas;
using (StreamWriter ArchivoDownpath = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Jason\Downpath.config"))
{
ArchivoDownpath.Write("");
}
}
}
private void usar_OtraCarpeta_CheckedChanged(object sender, EventArgs e)
{
if (usar_OtraCarpeta.Checked && archivo_Configuracion.Contains("usemymusic=true"))
{
archivo_Configuracion = archivo_Configuracion.Replace("usemymusic=true", "usemymusic=false");
usar_MyMusic.Checked = false;
textBox_PathChoice.Enabled = true;
elegir_Carpeta.Enabled = true;
}
}
private void boton_AplicarConfig_Click(object sender, EventArgs e)
{
using (StreamWriter ArchivoConfig = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Jason\JasonConfig.config"))
{
ArchivoConfig.Write(archivo_Configuracion);
}
if (usar_MyMusic.Checked)
{
Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
}
else
{
CarpetaDescargas = textBox_PathChoice.Text;
}
//continuar
using (StreamWriter ArchivoDownpath = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Jason\Downpath.config"))
{
ArchivoDownpath.Write(CarpetaDescargas);
}
}
private void boton_Reset_Click(object sender, EventArgs e)
{
using (StreamWriter ArchivoConfig = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Jason\JasonConfig.config"))
{
ArchivoConfig.Write("openonfinish=true;playonfinish=false;usemymusic=true;otherpath:();");
archivo_Configuracion = ("openonfinish=true;playonfinish=false;usemymusic=true;otherpath:();");
CarpetaDescargas = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
}
CheckConfig();
using (StreamWriter ArchivoDownpath = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Jason\Downpath.config"))
{
ArchivoDownpath.Write("");
}
}
private void elegir_Carpeta_Click(object sender, EventArgs e)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
textBox_PathChoice.Text = folderBrowserDialog1.SelectedPath;
}
}
private void simpleButton3_Click(object sender, EventArgs e)
{
lista_Descargas.CheckedItems.OfType<string>().ToList().ForEach(lista_Descargas.Items.Remove);
}
private void simpleButton4_Click(object sender, EventArgs e)
{
lista_Descargas.Items.Clear();
}
private void link_AbrirCarpeta_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start(CarpetaDescargas);
}
private void lista_Biblioteca_DoubleClick(object sender, EventArgs e)
{
try {
Process.Start(mArchivos[lista_Biblioteca.SelectedIndex]);
} catch
{
Process.Start(mArchivos[lista_Biblioteca.SelectedIndex]);
}
}
private void lista_Descargas_DoubleClick(object sender, EventArgs e)
{
try
{
textBox_Library_Filter.Text = lista_Biblioteca.SelectedItem.ToString();
}
catch
{
textBox_Library_Filter.Text = lista_Biblioteca.SelectedItem.ToString();
}
}
private void textBox_Library_Filter_TextChanged(object sender, EventArgs e)
{
ListarCanciones();
}
private void control_Biblioteca_Paint(object sender, PaintEventArgs e)
{
// ListarCanciones();
if (ultimaPestana != "controlBiblioteca")
{
ListarCanciones();
} else
{
Application.DoEvents();
}
}
private void lista_Biblioteca_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void label13_Click(object sender, EventArgs e)
{
}
private void lista_Descargas_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}
Bueno, eso es todo! Saludos
3
Programación / Scripting / Invasion Espacial 2.0 en VBScript [VBS + HTA] 100% Notepad!
en: 28 Mayo 2014, 05:49 am
Buenas. Hoy aburrido tome una idea antigua en mi cabeza con los restos de un intento de juego y quedo esto:
No le puse sonido y es muy simple. tambien es un regalo para mi hermana menor.
les dejo el codido..
<HTA:APPLICATION
ID = "SI2"
APPLICATIONNAME="SpaceInvaders2"
BORDER = "Thin"
CAPTION = "Yes"
RESIZE = "No"
ICON = "icono.ico"
SHOWINTASKBAR = "Yes"
SINGLEINSTANCE = "Yes"
SYSMENU = "Yes"
WINDOWSTATE = "Normal"
SCROLL = "No"
SCROLLFLAT = "No"
VERSION = "1.0"
INNERBORDER = "Yes"
SELECTION = "No"
MAXIMIZEBUTTON = "No"
MINIMIZEBUTTON = "Yes"
NAVIGABLE = "Yes"
CONTEXTMENU = "Yes"
BORDERSTYLE = "Normal" ></HTA>
<HTML>
<TITLE>Space Invaders 2.0</TITLE>
<HEAD>
</HEAD>
<BODY BackGround="fondo.png" TopMargin="0" LeftMargin="0" >
<INPUT TYPE ="Hidden" ID="TeclaA" >
<INPUT TYPE ="Hidden" ID="TeclaW" >
<INPUT TYPE ="Hidden" ID="TeclaD" >
<INPUT TYPE ="Hidden" ID="TeclaS" >
<INPUT TYPE ="Hidden" ID="TeclaEspacio" >
<INPUT TYPE ="Hidden" ID="TeclaEnter" >
<INPUT TYPE ="Hidden" ID="TeclaEsc" >
<INPUT TYPE ="Hidden" ID="EstadoJuego" >
<INPUT TYPE ="Hidden" ID="Disparo" >
<DIV ID="Pantalla" >PRESS ENTER</DIV>
<IMG ID="Jugador" >
<IMG ID="OvniUno" >
<IMG ID="OvniDos" >
<IMG ID="OvniTres" >
<IMG ID="OvniCuatro" >
<IMG ID="OvniCinco" >
<IMG ID="MisilUno" >
</BODY>
</HTML>
<SCRIPT LANGUAGE="VBScript" >
Sub Window_OnLoad()
REM Creado por JohnConnor
REM Lobos, Buenos Aires - Argentina
REM Martes 28 Mayo 2014
REM CM | Code Makers NO MURIO!
REM www.fb.me/John1Connor
REM john1connor@facebook.com
Self.ResizeTo 800,600
Self.MoveTo ((Screen.Width - 800) / 2), ((Screen.Height - 600) / 2)
Jugador.Src = "ju.png"
Jugador.Style.Width = 50
Jugador.Style.Height = 50
Jugador.Style.Position = "Absolute"
Jugador.Style.Top = 500
Jugador.Style.Left = 750 / 2
TeclaA.Value = "False"
TeclaW.Value = "False"
TeclaD.Value = "False"
TeclaS.Value = "False"
TeclaEspacio.Value = "False"
TeclaEnter.Value = "False"
TeclaEsc.Value = "False"
Pantalla.Style.Position = "Absolute"
Pantalla.Style.Width = 300
Pantalla.Style.Height = 100
Pantalla.Style.Top = 270
Pantalla.Style.Left = 270
Pantalla.Style.Color = "Lime"
Pantalla.Style.FontSize = "30"
OvniUno.Style.Top = Int((300 - 10 + (Random / 2)) * Rnd + 10)
OvniDos.Style.Top = Int((300 - 10 + (Random / 2)) * Rnd + 10)
OvniTres.Style.Top = Int((300 - 10 + (Random / 2)) * Rnd + 10)
OvniCuatro.Style.Top = Int((300 - 10 + (Random / 2)) * Rnd + 10)
OvniCinco.Style.Top = Int((300 - 10 + (Random / 2)) * Rnd + 10)
OvniUno.Src = "ovni.gif"
OvniDos.Src = "ovni.gif"
OvniTres.Src = "ovni.gif"
OvniCuatro.Src = "ovni.gif"
OvniCinco.Src = "ovni.gif"
MisilUno.Style.Top = 999
MisilUno.Style.Left = 900
MisilUno.Style.Width = cInt(15)
MisilUno.Style.Height = 40
MisilUno.Src = "misil.gif"
MisilUno.Style.zIndex = -2
OvniUno.Style.Width = 55
OvniUno.Style.Left = Int((100 - 10 + (Random / 2)) * Rnd + 10)
OvniDos.Style.Left = Int((100 - 10 + (Random / 2)) * Rnd + 10)
OvniTres.Style.Left = Int((100 - 10 + (Random / 2)) * Rnd + 10)
OvniCuatro.Style.Left = Int((100 - 10 + (Random / 2)) * Rnd + 10)
OvniCinco.Style.Left = Int((100 - 10 + (Random / 2)) * Rnd + 10)
OvniDos.Style.Width = 55
OvniTres.Style.Width = 55
OvniCuatro.Style.Width = 55
OvniCinco.Style.Width = 55
OvniUno.Style.Height = 33
OvniDos.Style.Height = 33
OvniTres.Style.Height = 33
OvniCuatro.Style.Height = 33
OvniCinco.Style.Height = 33
OvniUno.Style.Position = "Absolute"
OvniUno.Title = "Vivo"
OvniDos.Title = "Vivo"
OvniTres.Title = "Vivo"
OvniCuatro.Title = "Vivo"
OvniCinco.Title = "Vivo"
OvniDos.Style.Position = "Absolute"
OvniTres.Style.Position = "Absolute"
OvniCuatro.Style.Position = "Absolute"
OvniCinco.Style.Position = "Absolute"
MisilUno.Style.Position = "Absolute"
Disparo.Value = "OFF"
EstadoJuego.Value = "NoIniciado"
Tiempo = Window.SetInterval("Ciclo()" ,0) : ClearInterval Tiempo
End Sub
Sub Document_OnKeyPress
IF EstadoJuego.Value = "Iniciado" And Window.Event.KeyCode = "13" Then
ClearInterval Tiempo
Pausar()
End If
If Window.Event.KeyCode = "13" And EstadoJuego.Value = "NoIniciado" Then : Iniciar(): End If
If Window.Event.KeyCode = "27" Then : TeclaEsc.Value = "True" : End If
If Window.Event.KeyCode = "13" Then : TeclaEnter.Value = "True" : End If
If Window.Event.KeyCode = "32" Then : TeclaEspacio.Value = "True" : End If
If Window.Event.KeyCode = "119" Then : TeclaW.Value = "True" : End If
If Window.Event.KeyCode = "115" Then : TeclaS.Value = "True" : End If
If Window.Event.KeyCode = "97" Then : TeclaA.Value = "True" : End If
If Window.Event.KeyCode = "100" Then : TeclaD.Value = "True" : End If
End Sub
Sub Document_OnKeyUp
If Window.Event.KeyCode = "27" Then : TeclaEsc.Value = "False" : End If
If Window.Event.KeyCode = "13" Then : TeclaEnter.Value = "False" : End If
If Window.Event.KeyCode = "32" Then : TeclaEspacio.Value = "False" : End If
If Window.Event.KeyCode = "87" Then : TeclaW.Value = "False" : End If
If Window.Event.KeyCode = "83" Then : TeclaS.Value = "False" : End If
If Window.Event.KeyCode = "65" Then : TeclaA.Value = "False" : End If
If Window.Event.KeyCode = "68" Then : TeclaD.Value = "False" : End If
End Sub
Sub Iniciar()
EstadoJuego.Value = "Iniciado" : Tiempo = Window.SetInterval("Ciclo()" ,1) : Pantalla.InnerHTML = ""
End Sub
Sub Pausar()
EstadoJuego.Value = "Pausado" : ClearInterval Tiempo : Pantalla.InnerHTML = "Paused"
End Sub
Sub Ciclo()
If EstadoJuego.Value = "NoIniciado" Then : Msgbox "Error de ejecución" & Chr(13) & "FATAL RUN" ,16,"ERROR" : Self.Close : End If
If EstadoJuego.Value = "Perdido" Then : Exit Sub : End If
If TeclaW.Value = "True" Then : Call MoverV("-2" ) : End If
If TeclaS.Value = "True" Then : Call MoverV("+2" ) : End If
If TeclaA.Value = "True" Then : Call MoverH("-2" ) : End If
If TeclaD.Value = "True" Then : Call MoverH("+2" ) : End If
If TeclaEspacio.Value = "True" Then : Call Disparar() : End If
If Disparo.Value = "ON" Then : MisilUno.Style.Top = Limpiar(MisilUno.Style.Top) - (cInt(2)) : End If
If Limpiar(MisilUno.Style.Top) < (0) Then : Disparo.Value = "OFF" : MisilUno.Style.Top = cInt(900) : END IF
If OvniUno.Title = "Vivo" And Coliciones(Limpiar(Jugador.Style.Left), Limpiar(Jugador.Style.WIdth) - 10, Limpiar(Jugador.Style.Top), Limpiar(Jugador.Style.Height) - 10,Limpiar(OvniUno.Style.Left), Limpiar(OvniUno.Style.Height) - 10, Limpiar(OvniUno.Style.Top), Limpiar(OvniUno.Style.WIdth) - 10) = "True" Then : Call Perdiste() : End If
If OvniDos.Title = "Vivo" And Coliciones(Limpiar(Jugador.Style.Left), Limpiar(Jugador.Style.WIdth) - 10, Limpiar(Jugador.Style.Top), Limpiar(Jugador.Style.Height) - 10,Limpiar(OvniDos.Style.Left), Limpiar(OvniDos.Style.Height) - 10, Limpiar(OvniDos.Style.Top), Limpiar(OvniDos.Style.WIdth) - 10) = "True" Then : Call Perdiste() : End If
If OvniTres.Title = "Vivo" And Coliciones(Limpiar(Jugador.Style.Left), Limpiar(Jugador.Style.WIdth) - 10, Limpiar(Jugador.Style.Top), Limpiar(Jugador.Style.Height) - 10,Limpiar(OvniTres.Style.Left), Limpiar(OvniTres.Style.Height) - 10, Limpiar(OvniTres.Style.Top), Limpiar(OvniTres.Style.WIdth) - 10) = "True" Then : Call Perdiste() : End If
If OvniCuatro.Title = "Vivo" And Coliciones(Limpiar(Jugador.Style.Left), Limpiar(Jugador.Style.WIdth) - 10, Limpiar(Jugador.Style.Top), Limpiar(Jugador.Style.Height) - 10,Limpiar(OvniCuatro.Style.Left), Limpiar(OvniCuatro.Style.Height) - 10, Limpiar(OvniCuatro.Style.Top), Limpiar(OvniCuatro.Style.WIdth) - 10) = "True" Then : Call Perdiste() : End If
If OvniCinco.Title = "Vivo" And Coliciones(Limpiar(Jugador.Style.Left), Limpiar(Jugador.Style.WIdth) - 10, Limpiar(Jugador.Style.Top), Limpiar(Jugador.Style.Height) - 10,Limpiar(OvniCinco.Style.Left), Limpiar(OvniCinco.Style.Height) - 10, Limpiar(OvniCinco.Style.Top), Limpiar(OvniCinco.Style.WIdth) - 10) = "True" Then : Call Perdiste() : End If
If Coliciones(Limpiar(MisilUno.Style.Left), Limpiar(MisilUno.Style.Width) , Limpiar(MisilUno.Style.Top), Limpiar(MisilUno.Style.Height), Limpiar(OvniUno.Style.Left), Limpiar(OvniUno.Style.Height), Limpiar(OvniUno.Style.Top), Limpiar(OvniUno.Style.Width)) = "True" Then
OvniUno.Src = "explocion.gif" : OvniUno.Title = "Muerto" : Call RestaurarMisil() : TimeOff = Window.SetTimeOut("ChauOvniUno()" ,1000)
End If
If Coliciones(Limpiar(MisilUno.Style.Left), Limpiar(MisilUno.Style.Width) , Limpiar(MisilUno.Style.Top), Limpiar(MisilUno.Style.Height), Limpiar(OvniDos.Style.Left), Limpiar(OvniDos.Style.Height), Limpiar(OvniDos.Style.Top), Limpiar(OvniDos.Style.Width)) = "True" Then
OvniDos.Src = "explocion.gif" : OvniDos.Title = "Muerto" : Call RestaurarMisil() : TimeOff = Window.SetTimeOut("ChauOvniDos()" ,1000)
End If
If Coliciones(Limpiar(MisilUno.Style.Left), Limpiar(MisilUno.Style.Width) , Limpiar(MisilUno.Style.Top), Limpiar(MisilUno.Style.Height), Limpiar(OvniTres.Style.Left), Limpiar(OvniTres.Style.Height), Limpiar(OvniTres.Style.Top), Limpiar(OvniTres.Style.Width)) = "True" Then
OvniTres.Src = "explocion.gif" : OvniTres.Title = "Muerto" : Call RestaurarMisil() : TimeOff = Window.SetTimeOut("ChauOvniTres()" ,1000)
End If
If Coliciones(Limpiar(MisilUno.Style.Left), Limpiar(MisilUno.Style.Width) , Limpiar(MisilUno.Style.Top), Limpiar(MisilUno.Style.Height), Limpiar(OvniCuatro.Style.Left), Limpiar(OvniCuatro.Style.Height), Limpiar(OvniCuatro.Style.Top), Limpiar(OvniCuatro.Style.Width)) = "True" Then
OvniCuatro.Src = "explocion.gif" : OvniCuatro.Title = "Muerto" : Call RestaurarMisil() : TimeOff = Window.SetTimeOut("ChauOvniCuatro()" ,1000)
End If
If Coliciones(Limpiar(MisilUno.Style.Left), Limpiar(MisilUno.Style.Width) , Limpiar(MisilUno.Style.Top), Limpiar(MisilUno.Style.Height), Limpiar(OvniCinco.Style.Left), Limpiar(OvniCinco.Style.Height), Limpiar(OvniCinco.Style.Top), Limpiar(OvniCinco.Style.Width)) = "True" Then
OvniCinco.Src = "explocion.gif" : OvniCinco.Title = "Muerto" : Call RestaurarMisil() : TimeOff = Window.SetTimeOut("ChauOvniCinco()" ,1000)
End If
If OvniUno.Title = "Muerto" And OvniDos.Title = "Muerto" And OvniTres.Title = "Muerto" And OvniCuatro.Title = "Muerto" And OvniCinco.Title = "Muerto" Then
Pantalla.InnerHTML = "GANASTE!"
End If
Call IA()
End Sub
Sub ChauOvniUno()
OvniUno.Style.Top = 9999
End Sub
Sub ChauOvniDos()
OvniDos.Style.Top = 9999
End Sub
Sub ChauOvniTres()
OvniTres.Style.Top = 9999
End Sub
Sub ChauOvniCuatro()
OvniCuatro.Style.Top = 9999
End Sub
Sub ChauOvniCinco()
OvniCinco.Style.Top = 9999
End Sub
Sub Perdida()
Jugador.Src = "vacio.png"
End Sub
Sub Perdiste
EstadoJuego.Value = "Perdido" : Jugador.Src = "explocion.gif" : TimeOff = Window.SetTimeOut("Perdida()" ,1000) : Pantalla.InnerHtml = "GAME OVER! <br> Powered By JohnConnor"
End Sub
Sub RestaurarMisil()
Disparo.Value = "OFF" : MisilUno.Style.Top = 999
End Sub
Sub MoverV(nro)
Jugador.Style.Top = cInt(Limpiar(Jugador.Style.Top)) + cInt(nro)
End Sub
Sub MoverH(nro)
Jugador.Style.Left = cInt(Limpiar(Jugador.Style.Left)) + cInt(nro)
End Sub
Sub Disparar()
If Disparo.Value = "OFF" Or Limpiar(MisilUno.Style.Top) < (-30) Then
MisilUno.Style.Top = Jugador.Style.Top : MisilUno.Style.Left = Limpiar(Jugador.Style.Left) + 15
Disparo.Value = "ON"
End If
End Sub
Sub IA()
If OvniUno.Title = "Vivo" Then
If Limpiar(OvniUno.Style.Top) >= Limpiar(Jugador.Style.Top) Then : OvniUno.Style.Top = Limpiar(OvniUno.Style.Top) - cInt(1) : End If
If Limpiar(OvniUno.Style.Top) =< Limpiar(Jugador.Style.Top) Then : OvniUno.Style.Top = Limpiar(OvniUno.Style.Top) + cInt(1) : End If
If Limpiar(OvniUno.Style.Left) =< Limpiar(Jugador.Style.Left) Then : OvniUno.Style.Left = (Limpiar(OvniUno.Style.Left) + cInt(1)) : End If
If Limpiar(OvniUno.Style.Left) >= Limpiar(Jugador.Style.Left) Then : OvniUno.Style.Left = (Limpiar(OvniUno.Style.Left) - cInt(1)) : End If
End If
If OvniDos.Title = "Vivo" Then
If Limpiar(OvniDos.Style.Top) >= Limpiar(Jugador.Style.Top) Then : OvniDos.Style.Top = Limpiar(OvniDos.Style.Top) - cInt(1) : End If
If Limpiar(OvniDos.Style.Top) =< Limpiar(Jugador.Style.Top) Then : OvniDos.Style.Top = Limpiar(OvniDos.Style.Top) + cInt(1) : End If
If Limpiar(OvniDos.Style.Left) =< Limpiar(Jugador.Style.Left) Then : OvniDos.Style.Left = (Limpiar(OvniDos.Style.Left) + cInt(1)) : End If
If Limpiar(OvniDos.Style.Left) >= Limpiar(Jugador.Style.Left) Then : OvniDos.Style.Left = (Limpiar(OvniDos.Style.Left) - cInt(1)) : End If
End If
If OvniTres.Title = "Vivo" Then
If Limpiar(OvniTres.Style.Top) >= Limpiar(Jugador.Style.Top) Then : OvniTres.Style.Top = Limpiar(OvniTres.Style.Top) - cInt(1) : End If
If Limpiar(OvniTres.Style.Top) =< Limpiar(Jugador.Style.Top) Then : OvniTres.Style.Top = Limpiar(OvniTres.Style.Top) + cInt(1) : End If
If Limpiar(OvniTres.Style.Left) =< Limpiar(Jugador.Style.Left) Then : OvniTres.Style.Left = (Limpiar(OvniTres.Style.Left) + cInt(1)) : End If
If Limpiar(OvniTres.Style.Left) >= Limpiar(Jugador.Style.Left) Then : OvniTres.Style.Left = (Limpiar(OvniTres.Style.Left) - cInt(1)) : End If
End If
If OvniCuatro.Title = "Vivo" Then
If Limpiar(OvniCuatro.Style.Top) >= Limpiar(Jugador.Style.Top) Then : OvniCuatro.Style.Top = Limpiar(OvniCuatro.Style.Top) - cInt(1) : End If
If Limpiar(OvniCuatro.Style.Top) =< Limpiar(Jugador.Style.Top) Then : OvniCuatro.Style.Top = Limpiar(OvniCuatro.Style.Top) + cInt(1) : End If
If Limpiar(OvniCuatro.Style.Left) =< Limpiar(Jugador.Style.Left) Then : OvniCuatro.Style.Left = (Limpiar(OvniCuatro.Style.Left) + cInt(1)) : End If
If Limpiar(OvniCuatro.Style.Left) >= Limpiar(Jugador.Style.Left) Then : OvniCuatro.Style.Left = (Limpiar(OvniCuatro.Style.Left) - cInt(1)) : End If
ENd If
If OvniCinco.Title = "Vivo" Then
If Limpiar(OvniCinco.Style.Top) >= Limpiar(Jugador.Style.Top) Then : OvniCinco.Style.Top = Limpiar(OvniCinco.Style.Top) - cInt(1) : End If
If Limpiar(OvniCinco.Style.Top) =< Limpiar(Jugador.Style.Top) Then : OvniCinco.Style.Top = Limpiar(OvniCinco.Style.Top) + cInt(1) : End If
If Limpiar(OvniCinco.Style.Left) =< Limpiar(Jugador.Style.Left) Then : OvniCinco.Style.Left = (Limpiar(OvniCinco.Style.Left) + cInt(1)) : End If
If Limpiar(OvniCinco.Style.Left) >= Limpiar(Jugador.Style.Left) Then : OvniCinco.Style.Left = (Limpiar(OvniCinco.Style.Left) - cInt(1)) : End If
End If
End Sub
Function Limpiar(Objeto)
Limpiar = Replace(Objeto,"px" ,"" )
End Function
Function Coliciones(PosXUno, AnchoUno, PosYUno, LargoUno,PosXDos, LargoDos, PosYDos, AnchoDos)
If (CInt(PosXUno) + CInt(AnchoUno)) >= (CInt(PosXDos)) And (CInt(PosXUno)) < (CInt(PosXDos) + CInt(AnchoDos)) And (CInt(PosYUno) + CInt(LargoUno)) > (CInt(PosYDos)) And (CInt(PosYUno)) < (CInt(PosYDos) + CInt(AnchoDos)) Then
Coliciones = "True"
Else
Coliciones = "False"
End If
End Function
Function Random ()
RandomA = Replace(Time,":" ,"" )
RandomB = Replace(RandomA,"." ,"" )
RandomC = Replace(RandomB,"pm" ,"" )
RandomD = Replace(RandomC,"am" ,"" )
Random = Mid(RandomD,4)
End Function
</SCRIPT>
Saludos
4
Programación / Scripting / VBScript: Angry Birds Pong in VBScript [HTA + VBS] (100% Notepad) by JohnConnor
en: 4 Marzo 2013, 03:02 am
Juego programado en VBScript y HTML (hta) con el Notepad.
by JohnConnor : Facundo Rinaldi 2 Code-Makers.com
Hola gente, les dejo el ultimo juego que hice, es un PONG . en realidad es el mismo que el anterior pero con algunas mejoras y nuevos graficos. Tambien agregue sonidos y publicidades.
Las teclas igual al anterior.
Un video de muestra:
VIDEO Aca en codigo:
Sub Window_OnLoad
Cargando.Style.Display = "None"
If Screen.Width < 800 or Screen.Height < 600 Then
Msgbox "Error: 0x1028 " & Chr(13) & "Su resolucion de patalla no permite la ejecucion de la aplicacion."
End If
Self.ResizeTo 800,600
Pantalla_De_Juego.Style.Display = "None"
Pantalla_Ganador.Style.Display = "None"
Menu_Principal.Style.Color = "Gray"
Menu_Principal.Style.FontSize = "12"
Menu_Principal.Style.Position = "Absolute"
Menu_Principal.Style.Top = "70"
Menu_Principal.Style.Left = "45"
JugadorUnoP.Style.Position = "Absolute"
JugadorDosP.Style.Position = "Absolute"
JugadorUnoP.Style.fontSize = "50"
JugadorDosP.Style.fontSize = "50"
JugadorUnoP.Style.Top = "10"
JugadorDosP.Style.Top = "10"
JugadorUnoP.Style.Left = 300
JugadorDosP.Style.Left = 500
' --- Configuracion JugadorDos --- *
JugadorUno.Style.Position = "Absolute"
JugadorUno.Style.Width = "60"
JugadorUno.Style.Height = "60"
JugadorUno.Style.Top = "40"
JugadorUno.Style.Left = "10"
' --- Configuracion de JugadorDos --- *
JugadorDos.Style.Position = "Absolute"
JugadorDos.Style.Width = "60"
JugadorDos.Style.Height = "60"
JugadorDos.Style.Top = "90"
JugadorDos.Style.Left = "740"
' --- Configuracion de Pelota --- *
Pelota.Style.Position = "Absolute"
Pelota.Style.Width = "30"
Pelota.Style.Height = "30"
Pelota.Style.Top = "100"
Pelota.Style.Left = "100"
LD.Style.Position = "Absolute"
LD.Style.Width = "3"
LD.Style.Height = "600"
LD.Style.Left = "400"
LD.Style.Display = "None"
VolumenIMG.Style.Position = "Absolute"
VolumenIMG.Style.Bottom = "15"
VolumenIMG.Style.Right = "5"
VolumenIMG.Style.ZIndex = "999"
FacebookIMG.Style.Position = "Absolute"
FacebookIMG.Style.Bottom = "16"
FacebookIMG.Style.Left = "5"
FacebookIMG.Style.ZIndex = "999"
TwitterIMG.Style.Position = "Absolute"
TwitterIMG.Style.Bottom = "15"
TwitterIMG.Style.Left = "50"
TwitterIMG.Style.ZIndex = "999"
Publicidad.Style.Position = "Absolute"
Publicidad.Style.Bottom = "5"
Publicidad.Style.Left = "160"
Publicidad.Style.Width = "468"
Publicidad.Style.Height = "60"
Publicidad.Style.ZIndex = "9999"
Publicidad.Style.OverFlow = "Hidden"
PublicidadDos.Style.Position = "Absolute"
PublicidadDos.Style.Top = "170"
PublicidadDos.Style.Left = "110"
PublicidadDos.Style.Width = "300"
PublicidadDos.Style.Height = "250"
PublicidadDos.Style.ZIndex = "9999"
PublicidadDos.Style.OverFlow = "Hidden"
FondoGanador.Style.Position = "Absolute"
FondoGanador.Style.Top = "100"
FondoGanador.Style.Left = "70"
IMGanador.Style.Position = "Absolute"
IMGanador.Style.Top = "220"
IMGanador.Style.Left = "500"
Imganador.Style.Width = "150"
Imganador.Style.Height = "150"
Piso.Style.Position = "Absolute"
Piso.Style.Width = "800"
Piso.Style.Height = "87"
Piso.Style.Bottom = "0"
Piso.Style.BackgroundImage = "Url(Imagenes/Piso.png)"
JugadorUnoPTXT.Value = "0" : JugadorDosPTXT.Value = "0"
JugadorUnoP.InnerHtml = "<img src=" "Imagenes/p" & JugadorUnoPTXT.Value & ".png" ">" : JugadorDosP.InnerHtml = "<img src=" "Imagenes/p" & JugadorDosPTXT.Value & ".png" ">"
End Sub
Sub Document_OnKeyPress
If Window.Event.KeyCode = "27" Then : Salir : End If
If Window.Event.KeyCode = "13" Then : Comenzar : Volver : If E.Value = "0" Then : MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = " "Sonidos/BotonOk.wav" "" ,1) : Movimiento_Pelota : E.Value = "1" : End If : End If
If Window.Event.KeyCode = "119" Then : JUArriba.Value = "-4" : End If
If Window.Event.KeyCode = "115" Then : JUAbajo.Value = "4" : End If
If Window.Event.KeyCode = "105" Then : JDArriba.Value = "-4" : End If
If Window.Event.KeyCode = "107" Then : JDAbajo.Value = "4" : End If
End Sub
Sub Document_OnKeyUp
If Window.Event.KeyCode = "87" Or Window.Event.KeyCode = "83" Then : JUArriba.Value = "0" : JUAbajo.Value = "0" : End If
If Window.Event.KeyCode = "73" Or Window.Event.KeyCode = "75" Then : JDArriba.Value = "0" : JDAbajo.Value = "0" : End If
End Sub
Sub BotonArrancar_OnMouseOver
MusicaMaestro = Window.SetTimeOut("SonidosAmbiente.Src = " "Sonidos/BotonArriba.wav" "" ,1)
BotonArrancar.SRC= "Imagenes/startbd.png"
End Sub
Sub BotonArrancar_OnMouseOut
If E.Value = "0" Then
MusicaMaestro = Window.SetTimeOut("SonidosAmbiente.Src = " "Sonidos/Menu_Principal.mp3" "" ,1)
BotonArrancar.SRC= "Imagenes/startb.png"
End If
End Sub
Sub BotonArrancar_OnClick
MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = " "Sonidos/BotonOk.wav" "" ,1)
Comenzar : Movimiento_Pelota : E.Value = "1"
End Sub
Sub Comenzar
Menu_Principal.Style.Display = "None"
Pantalla_De_Juego.Style.Display = "InLine"
MusicaMaestro = Window.SetTimeOut("SonidosAmbiente.Src = " "Sonidos/AmbienteJuego.mp3" "" ,400)
SonidosAmbiente.Volume = "0"
End Sub
Sub MoverJugadorUno(Mov)
JugadorUno.Style.Top = CInt(Replace(JugadorUno.Style.Top,"px" ,"" )) + CInt(Mov)
End Sub
Sub MoverJugadorDos(Mov)
JugadorDos.Style.Top = CInt(Replace(JugadorDos.Style.Top,"px" ,"" )) + CInt(Mov)
End Sub
Sub Movimiento_Pelota
If JugadorUnoPTXT.Value > 9 Then
MusicaMaestro = Window.SetTimeOut("SonidosAmbiente.Src = " "Sonidos/Juego_Ganado.mp3" "" ,1)
Pantalla_Ganador.Style.Display = "Inline"
IMGanador.SRC = "Imagenes/JU.png"
Exit Sub
End If
If JugadorDosPTXT.Value > 9 Then
MusicaMaestro = Window.SetTimeOut("SonidosAmbiente.Src = " "Sonidos/Juego_Ganado.mp3" "" ,1)
Pantalla_Ganador.Style.Display = "Inline"
IMGanador.SRC = "Imagenes/JD.png"
Exit Sub
End If
If Replace(Pelota.Style.Top,"px" ,"" ) > 463 Then
DireccionPelotaX.Value = CInt(-4)
MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = " "Sonidos/Pajaro_Rebotando.wav" "" ,1)
End If
If Replace(Pelota.Style.Top,"px" ,"" ) < 1 Then
DireccionPelotaX.Value = CInt(+4)
MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = " "Sonidos/Pajaro_Rebotando.wav" "" ,1)
End If
If Replace(Pelota.Style.Left,"px" ,"" ) > 780 Then
Pelota.Style.Left = "760"
DireccionPelotaY.Value = CInt(-4)
MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = " "Sonidos/Festejo.wav" "" ,1)
IMGP.SRC = "Imagenes/1.png"
JugadorUnoPTXT.Value = JugadorUnoPTXT.Value + Cint(1)
JugadorUnoP.InnerHtml = "<img src=" "Imagenes/p" & JugadorUnoPTXT.Value & ".png" ">"
End If
If Replace(Pelota.Style.Left,"px" ,"" ) < 0 Then
Pelota.Style.Left = "0"
DireccionPelotaY.Value = CInt(+4)
MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = " "Sonidos/Festejo.wav" "" ,1)
IMGP.SRC = "Imagenes/0.png"
JugadorDosPTXT.Value = JugadorDosPTXT.Value + Cint(1)
JugadorDosP.InnerHtml = "<img src=" "Imagenes/p" & JugadorDosPTXT.Value & ".png" ">"
End If
If Coliciones(Replace(JugadorUno.Style.Left,"px" ,"" ), Replace(JugadorUno.Style.Width,"px" ,"" ), Replace(JugadorUno.Style.Top,"px" ,"" ),Replace(JugadorUno.Style.Height,"px" ,"" ), Replace(Pelota.Style.Left,"px" ,"" ), Replace(Pelota.Style.Width,"px" ,"" ), Replace(Pelota.Style.Top,"px" ,"" ), Replace(Pelota.Style.Height,"px" ,"" )) = "Verdadero" Then
'Pelota.Style.BackgroundColor = "Yellow"
MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = " "Sonidos/Tiro.wav" "" ,1)
MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = " "Sonidos/Pajaro_Volando.wav" "" ,300)
DireccionPelotaY.Value = CInt(+ Int((8 - 5 + 1) * RND + 5))
If DireccionPelotaX.Value > 0 Then
DireccionPelotaX.Value = CInt(+ Int((10 - 1 + 1) * RND + 1))
Else
DireccionPelotaX.Value = CInt(- Int((10 - 1 + 1) * RND + 1))
End If
IMGP.SRC = "Imagenes/0.png"
Else
'Pelota.Style.BackgroundColor = "White"
End If
If Coliciones(Replace(JugadorDos.Style.Left,"px" ,"" ), Replace(JugadorDos.Style.Width,"px" ,"" ), Replace(JugadorDos.Style.Top,"px" ,"" ),Replace(JugadorDos.Style.Height,"px" ,"" ), Replace(Pelota.Style.Left,"px" ,"" ), Replace(Pelota.Style.Width,"px" ,"" ), Replace(Pelota.Style.Top,"px" ,"" ), Replace(Pelota.Style.Height,"px" ,"" )) = "Verdadero" Then
'Pelota.Style.BackgroundColor = "Yellow"
MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = " "Sonidos/Tiro.wav" "" ,1)
MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = " "Sonidos/PajaroVolando.wav" "" ,300)
DireccionPelotaY.Value = CInt(- Int((8 - 5 + 1) * RND + 5))
If DireccionPelotaX.Value < 0 Then
DireccionPelotaX.Value = CInt(- Int((10 - 1 + 1) * RND + 1))
Else
DireccionPelotaX.Value = CInt(+ Int((10 - 1 + 1) * RND + 1))
End If
IMGP.SRC = "Imagenes/1.png"
Else
'Pelota.Style.BackgroundColor = "White"
End If
Pelota.Style.Top = Cint(Replace(Pelota.Style.Top,"px" ,"" )) + Cint(DireccionPelotaX.Value)
Pelota.Style.Left = Cint(Replace(Pelota.Style.Left,"px" ,"" )) + Cint(DireccionPelotaY.Value)
If Replace(JugadorUno.Style.Top,"px" ,"" ) < 2 Then : JugadorUno.Style.Top = 2 : End If
If Replace(JugadorUno.Style.Top,"px" ,"" ) > 433 Then : JugadorUno.Style.Top = 433 : End If
If Replace(JugadorDos.Style.Top,"px" ,"" ) < 2 Then : JugadorDos.Style.Top = 2 : End If
If Replace(JugadorDos.Style.Top,"px" ,"" ) > 433 Then : JugadorDos.Style.Top = 433 : End If
MoverJugadorUno(JUArriba.value) : MoverJugadorDos(JDArriba.value) : MoverJugadorUno(JUAbajo.Value) : MoverJugadorDos(JDAbajo.Value)
MP = Window.SetTimeOut("Movimiento_Pelota" ,1)
End Sub
Function Coliciones(x1, width1, y1, height1,x2, width2, y2, height2)
If (CInt(x1) + CInt(width1)) > (CInt(x2)) and (CInt(x1)) < (CInt(x2) + CInt(width2)) And (CInt(y1) + CInt(height1)) > (CInt(y2)) and (CInt(y1)) < (CInt(y2) + CInt(height2)) Then
Coliciones = "Verdadero"
Else
Coliciones = "Falso"
End If
End Function
Sub IniMSJPre
If IniMSJV.Value = "A" then
Ini_MSJ.Style.Display = "None"
IniMSJV.Value = "B"
Else
Ini_MSJ.Style.Display = "Inline"
IniMSJV.Value = "A"
End If
End Sub
Sub Salir
Set WshShell = CreateObject ("WScript.Shell" )
Return = WshShell.Run("http://angrybirds.hol.es/pong/Comparte.php" , 1,False )
Self.Close
End Sub
Sub TwitterIMG_OnMouseOver
TwitterIMG.SRC = "Imagenes/Twitter0.png"
End Sub
Sub FacebookIMG_OnMouseOver
FacebookIMG.SRC = "Imagenes/Facebook0.png"
End Sub
Sub TwitterIMG_OnMouseOut
TwitterIMG.SRC = "Imagenes/Twitter1.png"
End Sub
Sub FacebookIMG_OnMouseOut
FacebookIMG.SRC = "Imagenes/Facebook1.png"
End Sub
Sub TwitterIMG_OnClick
Set WshShell = CreateObject ("WScript.Shell" )
Return = WshShell.Run("http://www.twitter.com/AngryBirdsPong" , 1,False )
End Sub
Sub FacebookIMG_OnClick
Set WshShell = CreateObject ("WScript.Shell" )
Return = WshShell.Run("http://fb.me/AngryBirdsPong" , 1,False )
End Sub
Sub VolumenIMG_OnMouseOver
VolumenIMG.SRC = "Imagenes/Volumen1.png"
End Sub
Sub VolumenIMG_OnMouseOut
VolumenIMG.SRC = "Imagenes/Volumen0.png"
End Sub
Sub VolumenIMG_OnClick
If Vol.Value = "si" then
SonidosAmbiente.Volume = "-10000"
SonidosJuego.Volume = "-10000"
Vol.Value = "no"
Else
SonidosAmbiente.Volume = "0"
SonidosJuego.Volume = "0"
Vol.Value = "si"
End If
End Sub
Sub Volver
Set WshShell = CreateObject ("WScript.Shell" )
If JugadorUnoPTXT.Value > 9 or JugadorDosPTXT.value > 9 Then
Return = WshShell.Run("VolverAJugar.vbs" , 1, False )
Self.Close
End If
End Sub
FUENTE:
FORO CODE-MAKERS http://www.twitter.com/FTRinaldi http://www.Facebook.com/John1Connor http://foro.code-makers.com
5
Programación / Scripting / PONG Game - Simple Juego "Pong" [VBScript + HTA] (100% Notepad)
en: 22 Febrero 2013, 19:07 pm
Pong Game en VBScript y HTA (Juego VBS) Hola foreros, les traigo una versión simple Script de VB del juego PONG escrita 100% con Bloc de Notas.
Teclas:
W = Jugador 1
(Arriba) S = Jugador 1
(Abajo) I = Jugador 2
(Arriba) K = Jugador 2
(Abajo) Link de Descarga (Mediafire) ---->
http://www.mediafire.com/?tz80qo23lgz194l Y aca el codigo:
<Title>Pong VBScript by JohnConnor</Title>
<HTA:APPLICATION
ID = "PONGVBS"
APPLICATIONNAME="Pong Game in VBScript"
BORDER = "Dialog"
CAPTION = "Yes"
RESIZE = "no"
ICON = "icono.ico"
SHOWINTASKBAR = "No"
SINGLEINSTANCE = "Yes"
SYSMENU = "No"
WINDOWSTATE = "normal"
SCROLL = "no"
SCROLLFLAT = "no"
VERSION = "1.0"
INNERBORDER = "no"
SELECTION = "yes"
MAXIMIZEBUTTON = "no"
MINIMIZEBUTTON = "no"
NAVIGABLE = "yes"
CONTEXTMENU = "yes"
BORDERSTYLE = "normal" ></HTA>
<BODY TOPMARGIN="0" LEFTMARGIN="0" BGColor="Black" >
<DIV ID="Menu_Principal" Style="" >Pong Game VBScript<DIV ID="Ini_MSJ" Style="Display: InLine;" >Pulse (ENTER) para comenzar.</DIV></DIV>
<DIV ID="Pantalla_De_Juego" Width="100%" Height="100%" >
<DIV ID="JugadorUno" Style="Background-Color: White;" >0</DIV>
<DIV ID="JugadorDos" Style="Background-Color: White;" >0</DIV>
<DIV ID="Pelota" Style="Background-Color: White;" ></DIV>
</DIV>
<Input Type ="Hidden" ID="IniMSJV" Value="A" >
<Input Type ="Hidden" ID="DireccionPelotaX" Value="1" >
<Input Type ="Hidden" ID="DireccionPelotaY" Value="1" >
</BODY>
<Script Language="VBScript" >
Sub Window_OnLoad
Self.ResizeTo 350,250
Pantalla_De_Juego.Style.Display = "None"
Menu_Principal.Style.Color = "White"
Menu_Principal.Style.FontSize = "30"
Menu_Principal.Style.Position = "Absolute"
Menu_Principal.Style.Top = "70"
Menu_Principal.Style.Left = "45"
Ini_MSJ.Style.FontSize = "12"
Ini_MSJ.Style.Position = "Absolute"
Ini_MSJ.Style.Top = "80"
Ini_MSJ.Style.Left = "60"
IniMSJ = Window.SetInterval("IniMSJPre" ,700)
' --- Configuracion JugadorDos --- *
JugadorUno.Style.Position = "Absolute"
JugadorUno.Style.Width = "15"
JugadorUno.Style.Height = "60"
JugadorUno.Style.Top = "40"
JugadorUno.Style.Left = "10"
' --- Configuracion de JugadorDos --- *
JugadorDos.Style.Position = "Absolute"
JugadorDos.Style.Width = "15"
JugadorDos.Style.Height = "60"
JugadorDos.Style.Top = "90"
JugadorDos.Style.Left = "320"
IniMSJ = Window.SetInterval("IniMSJPre" ,700)
' --- Configuracion de Pelota --- *
Pelota.Style.Position = "Absolute"
Pelota.Style.Width = "15"
Pelota.Style.Height = "10"
Pelota.Style.Top = "100"
Pelota.Style.Left = "100"
End Sub
Sub Document_OnKeyPress
If Window.Event.KeyCode = "27" Then : Self.Close : End If
If Window.Event.KeyCode = "13" Then : Comenzar : Movimiento_Pelota() : End If
If Window.Event.KeyCode = "119" Then : MoverJugadorUno(-5) : End If
If Window.Event.KeyCode = "115" Then : MoverJugadorUno(5) : End If
If Window.Event.KeyCode = "105" Then : MoverJugadorDos(-5) : End If
If Window.Event.KeyCode = "107" Then : MoverJugadorDos(5) : End If
End Sub
Sub Comenzar
Menu_Principal.Style.Display = "None"
Pantalla_De_Juego.Style.Display = "InLine"
End Sub
Sub MoverJugadorUno(Mov)
JugadorUno.Style.Top = CInt(Replace(JugadorUno.Style.Top,"px" ,"" )) + CInt(Mov)
End Sub
Sub MoverJugadorDos(Mov)
JugadorDos.Style.Top = CInt(Replace(JugadorDos.Style.Top,"px" ,"" )) + CInt(Mov)
End Sub
Sub Movimiento_Pelota
If Replace(Pelota.Style.Top,"px" ,"" ) > 200 Then
DireccionPelotaX.Value = CInt(-1)
End If
If Replace(Pelota.Style.Top,"px" ,"" ) < 1 Then
DireccionPelotaX.Value = CInt(+1)
End If
If Replace(Pelota.Style.Left,"px" ,"" ) > 330 Then
DireccionPelotaY.Value = CInt(-1)
JugadorUno.InnerHtml = JugadorUno.InnerHtml + CInt(1)
End If
If Replace(Pelota.Style.Left,"px" ,"" ) < 0 Then
DireccionPelotaY.Value = CInt(+1)
JugadorDos.InnerHtml = JugadorDos.InnerHtml + CInt(1)
End If
If Coliciones(Replace(JugadorUno.Style.Left,"px" ,"" ), Replace(JugadorUno.Style.Width,"px" ,"" ), Replace(JugadorUno.Style.Top,"px" ,"" )+2,Replace(JugadorUno.Style.Height,"px" ,"" ), Replace(Pelota.Style.Left,"px" ,"" ), Replace(Pelota.Style.Width,"px" ,"" ), Replace(Pelota.Style.Top,"px" ,"" ), Replace(Pelota.Style.Height,"px" ,"" )) = "Verdadero" Then
Pelota.Style.BackgroundColor = "Yellow"
DireccionPelotaY.Value = CInt(+1)
Else
Pelota.Style.BackgroundColor = "White"
End If
If Coliciones(Replace(JugadorDos.Style.Left,"px" ,"" ), Replace(JugadorDos.Style.Width,"px" ,"" ), Replace(JugadorDos.Style.Top,"px" ,"" )+2,Replace(JugadorDos.Style.Height,"px" ,"" ), Replace(Pelota.Style.Left,"px" ,"" ), Replace(Pelota.Style.Width,"px" ,"" ), Replace(Pelota.Style.Top,"px" ,"" ), Replace(Pelota.Style.Height,"px" ,"" )) = "Verdadero" Then
Pelota.Style.BackgroundColor = "Yellow"
DireccionPelotaY.Value = CInt(-1)
Else
Pelota.Style.BackgroundColor = "White"
End If
Pelota.Style.Top = Cint(Replace(Pelota.Style.Top,"px" ,"" )) + Cint(DireccionPelotaX.Value)
Pelota.Style.Left = Cint(Replace(Pelota.Style.Left,"px" ,"" )) + Cint(DireccionPelotaY.Value)
MP = Window.SetTimeOut("Movimiento_Pelota" ,1)
End Sub
Function Coliciones(x1, width1, y1, height1,x2, width2, y2, height2)
If (CInt(x1) + CInt(width1)) > (CInt(x2)) and (CInt(x1)) < (CInt(x2) + CInt(width2)) And (CInt(y1) + CInt(height1)) > (CInt(y2)) and (CInt(y1)) < (CInt(y2) + CInt(height2)) Then
Coliciones = "Verdadero"
Else
Coliciones = "Falso"
End If
End Function
Sub IniMSJPre
If IniMSJV.Value = "A" then
Ini_MSJ.Style.Display = "None"
IniMSJV.Value = "B"
Else
Ini_MSJ.Style.Display = "Inline"
IniMSJV.Value = "A"
End If
End Sub
</Script>
He modificado un poco el codigo, tiene mejoras en los eventos del teclado, tambien corrijo problemas de puntuacion y le agregue mas velocidad y mas pantalla de juego. por lo demas es igual. aca dejo el code pero solo el VBSCript
Sub Window_OnLoad
Self.ResizeTo 450,350
Pantalla_De_Juego.Style.Display = "None"
Menu_Principal.Style.Color = "White"
Menu_Principal.Style.FontSize = "30"
Menu_Principal.Style.Position = "Absolute"
Menu_Principal.Style.Top = "70"
Menu_Principal.Style.Left = "45"
Ini_MSJ.Style.FontSize = "12"
Ini_MSJ.Style.Position = "Absolute"
Ini_MSJ.Style.Top = "80"
Ini_MSJ.Style.Left = "60"
IniMSJ = Window.SetInterval("IniMSJPre" ,700)
JugadorUnoP.Style.Position = "Absolute"
JugadorDosP.Style.Position = "Absolute"
JugadorUnoP.Style.fontSize = "24"
JugadorDosP.Style.fontSize = "24"
JugadorUnoP.Style.Bottom = "10"
JugadorDosP.Style.Bottom = "10"
JugadorUnoP.Style.Left = 225 - 30
JugadorDosP.Style.Left = 225 + 20
' --- Configuracion JugadorDos --- *
JugadorUno.Style.Position = "Absolute"
JugadorUno.Style.Width = "15"
JugadorUno.Style.Height = "60"
JugadorUno.Style.Top = "40"
JugadorUno.Style.Left = "10"
' --- Configuracion de JugadorDos --- *
JugadorDos.Style.Position = "Absolute"
JugadorDos.Style.Width = "15"
JugadorDos.Style.Height = "60"
JugadorDos.Style.Top = "90"
JugadorDos.Style.Left = "420"
IniMSJ = Window.SetInterval("IniMSJPre" ,700)
' --- Configuracion de Pelota --- *
Pelota.Style.Position = "Absolute"
Pelota.Style.Width = "15"
Pelota.Style.Height = "10"
Pelota.Style.Top = "100"
Pelota.Style.Left = "100"
LD.Style.Position = "Absolute"
LD.Style.Width = "3"
LD.Style.Height = "500"
LD.Style.Left = "225"
End Sub
Sub Document_OnKeyPress
If Window.Event.KeyCode = "27" Then : Self.Close : End If
If Window.Event.KeyCode = "13" Then : Comenzar : If E.Value = "0" Then : Movimiento_Pelota : E.Value = "1" : End If : End If
If Window.Event.KeyCode = "119" Then : JUArriba.Value = "-8" : End If
If Window.Event.KeyCode = "115" Then : JUAbajo.Value = "8" : End If
If Window.Event.KeyCode = "105" Then : JDArriba.Value = "-8" : End If
If Window.Event.KeyCode = "107" Then : JDAbajo.Value = "8" : End If
End Sub
Sub Document_OnKeyUp
If Window.Event.KeyCode = "87" Or Window.Event.KeyCode = "83" Then : JUArriba.Value = "0" : JUAbajo.Value = "0" : End If
If Window.Event.KeyCode = "73" Or Window.Event.KeyCode = "75" Then : JDArriba.Value = "0" : JDAbajo.Value = "0" : End If
End Sub
Sub Comenzar
Menu_Principal.Style.Display = "None"
Pantalla_De_Juego.Style.Display = "InLine"
End Sub
Sub MoverJugadorUno(Mov)
JugadorUno.Style.Top = CInt(Replace(JugadorUno.Style.Top,"px" ,"" )) + CInt(Mov)
End Sub
Sub MoverJugadorDos(Mov)
JugadorDos.Style.Top = CInt(Replace(JugadorDos.Style.Top,"px" ,"" )) + CInt(Mov)
End Sub
Sub Movimiento_Pelota
If Replace(Pelota.Style.Top,"px" ,"" ) > 300 Then
DireccionPelotaX.Value = CInt(-6)
End If
If Replace(Pelota.Style.Top,"px" ,"" ) < 1 Then
DireccionPelotaX.Value = CInt(+6)
End If
If Replace(Pelota.Style.Left,"px" ,"" ) > 430 Then
Pelota.Style.Left = "430"
DireccionPelotaY.Value = CInt(-6)
JugadorUnoP.InnerHtml = JugadorUnoP.InnerHtml + CInt(1)
End If
If Replace(Pelota.Style.Left,"px" ,"" ) < 0 Then
Pelota.Style.Left = "0"
DireccionPelotaY.Value = CInt(+6)
JugadorDosP.InnerHtml = JugadorDosP.InnerHtml + CInt(1)
End If
If Coliciones(Replace(JugadorUno.Style.Left,"px" ,"" ), Replace(JugadorUno.Style.Width,"px" ,"" ), Replace(JugadorUno.Style.Top,"px" ,"" ),Replace(JugadorUno.Style.Height,"px" ,"" ), Replace(Pelota.Style.Left,"px" ,"" ), Replace(Pelota.Style.Width,"px" ,"" ), Replace(Pelota.Style.Top,"px" ,"" ), Replace(Pelota.Style.Height,"px" ,"" )) = "Verdadero" Then
Pelota.Style.BackgroundColor = "Yellow"
DireccionPelotaY.Value = CInt(+6)
Else
Pelota.Style.BackgroundColor = "White"
End If
If Coliciones(Replace(JugadorDos.Style.Left,"px" ,"" ), Replace(JugadorDos.Style.Width,"px" ,"" ), Replace(JugadorDos.Style.Top,"px" ,"" ),Replace(JugadorDos.Style.Height,"px" ,"" ), Replace(Pelota.Style.Left,"px" ,"" ), Replace(Pelota.Style.Width,"px" ,"" ), Replace(Pelota.Style.Top,"px" ,"" ), Replace(Pelota.Style.Height,"px" ,"" )) = "Verdadero" Then
Pelota.Style.BackgroundColor = "Yellow"
DireccionPelotaY.Value = CInt(-6)
Else
Pelota.Style.BackgroundColor = "White"
End If
Pelota.Style.Top = Cint(Replace(Pelota.Style.Top,"px" ,"" )) + Cint(DireccionPelotaX.Value)
Pelota.Style.Left = Cint(Replace(Pelota.Style.Left,"px" ,"" )) + Cint(DireccionPelotaY.Value)
If Replace(JugadorUno.Style.Top,"px" ,"" ) < 2 Then : JugadorUno.Style.Top = 2 : End If
If Replace(JugadorUno.Style.Top,"px" ,"" ) > 260 Then : JugadorUno.Style.Top = 260 : End If
If Replace(JugadorDos.Style.Top,"px" ,"" ) < 2 Then : JugadorDos.Style.Top = 2 : End If
If Replace(JugadorDos.Style.Top,"px" ,"" ) > 260 Then : JugadorDos.Style.Top = 260 : End If
MoverJugadorUno(JUArriba.value) : MoverJugadorDos(JDArriba.value) : MoverJugadorUno(JUAbajo.Value) : MoverJugadorDos(JDAbajo.Value)
MP = Window.SetTimeOut("Movimiento_Pelota" ,1)
End Sub
Function Coliciones(x1, width1, y1, height1,x2, width2, y2, height2)
If (CInt(x1) + CInt(width1)) > (CInt(x2)) and (CInt(x1)) < (CInt(x2) + CInt(width2)) And (CInt(y1) + CInt(height1)) > (CInt(y2)) and (CInt(y1)) < (CInt(y2) + CInt(height2)) Then
Coliciones = "Verdadero"
Else
Coliciones = "Falso"
End If
End Function
Sub IniMSJPre
If IniMSJV.Value = "A" then
Ini_MSJ.Style.Display = "None"
IniMSJV.Value = "B"
Else
Ini_MSJ.Style.Display = "Inline"
IniMSJV.Value = "A"
End If
End Sub
Fuente:
www.code-makers.com/Scripting-by-JohnConnor Saludos
6
Programación / Scripting / TT Generator 4 Twitter (VBSript + HTA)
en: 5 Febrero 2013, 16:42 pm
Hola gente. aca les dejo una pequeña aplicacion hta y vbscript para hacer spam o generar TTs en Twitter.
Creo que no hay mucho que explicar. deja bien claro el uso de Internet Explorer para hacer aplicaciones y es muy parecido al VB (cada vez me gusta mas el script que el vb).
Una muestra:
Aca para descargar: http://www.mediafire.com/?xv2b7a5c99fk896
Aca pueden ver el codigo de su foro original:
http://johnconnor.net.ms/redirect.php Saludos
7
Programación / Scripting / Dificultad VBScript [MSXML2.XMLHTTP + RESPONSE.TEXT + TEXT AREA)]
en: 16 Enero 2013, 12:37 pm
Buenas. Estoy tratando de hacer un chat mediante el uso de XMLHTTP con vbscript.
el unico problema es que no me lee el txt que escribe y no lo actualiza en el textarea, aunque el txt es escrito y sobreescriot correctamente. alguien puede decirme donde esta el error? y que solucion o alternativa en caso de no poder mediante este metodo.
Es mejor con iExplorer Navigate?
Aca el code:
Sub actel()
nomvar = int(rnd * 888888)
Set nomvar = CreateObject ("MSXML2.XMLHTTP" )
nomvar.open "GET" , "http://localhost/msnvbs/conv83472980093.txt" , FALSE
nomvar.send
el.value = nomvar.ResponseText
el.scrollTop=9999999
set nomvar = nothing
MOTORD = WINDOW.SETTIMEOUT("actel()" , 5000)
End Sub
Sub Document_onKeyPress()
If window.event.keyCode="13" Then
nomvar = int(rnd * 888888)
Set nomvar = CreateObject ("MSXML2.XMLHTTP" )
nomvar.open "POST" , "http://localhost/msnvbs/enviar.php?contrasena=" &contrasena.value& "&nombre=" & nombre.value & "&mensaje=" &yo.value&"" , False
nomvar.send
yo.value = ""
el.scrollTop=9999999
set nomvar = nothing
actel()
end if
end sub
Saludos!
PD: Utilizo un nombre random para la variable porque etsaba probando pero no creo que eso cambie nada.
8
Programación / Programación C/C++ / Error codeblocks (build)
en: 8 Junio 2012, 17:53 pm
Instale la version completa de codeblock pero cuando quiero compilar me sale el siguiente error: Execution of 'mingw32-g++.exe -o bin\Debug\queande.exe obj\Debug\main.o' in 'C:\Users\JohnConnor\Desktop\queande' failed. Tengo windows 7. Saludos!
9
Programación / Scripting / Colisiones simples en VBScript + HTA
en: 3 Mayo 2012, 10:06 am
Hola, este es mi primer post y les quiero mostrar un "intento de juego" que no tiene como objetivo el entretenimiento sino que es un ejemplo de colisiones básicas en vbscript.
Dejo el link de .rar ---> http://www.mediafire.com/?dcje4xhf7z48445
y aca el codigo:
<HTML><HEAD><SCRIPT LANGUAGE="VBScript" >
REM -----------------------------------------------------------------------------
REM ***************POWERED By JohnConnor************
REM * Buenos Aires - Argentina. 30/05/2012 *
REM * All code is typed in Notepad++ *
REM ************************************************
REM .............................................................................
REM WEB: WWW.JUEGOMANIA.WEB44.NET
REM .............................................................................
Sub Window_OnLoad()
self.resizeto 400,400 : obstacle.style.left = 100 : obstacle.style.top = 200
TECLAW.value = "0" : TECLAS.value = "0" : TECLAD.value = "0" : TECLAA.value= "0" : TIEMPO_REFRESH = 100 : MOTOR()
MovimientoE()
End Sub
Sub Document_onKeyPress()
if estado.value = "muerto" then
exit sub
end if
If (UCase(Chr(window.event.keyCode)) = "W" ) Then
TECLAW.value = "1"
end if
If (UCase(Chr(window.event.keyCode)) = "S" ) Then
TECLAS.value = "1"
end if
If (UCase(Chr(window.event.keyCode)) = "D" ) Then
TECLAD.value = "1"
end if
If (UCase(Chr(window.event.keyCode)) = "A" ) Then
TECLAA.value = "1"
end if
End Sub
Sub Document_onKeyUp()
If (UCase(Chr(window.event.keyCode)) = "W" ) Then
TECLAW.value = "0"
end if
If (UCase(Chr(window.event.keyCode)) = "S" ) Then
TECLAS.value = "0"
end if
If (UCase(Chr(window.event.keyCode)) = "D" ) Then
TECLAD.value = "0"
end if
If (UCase(Chr(window.event.keyCode)) = "A" ) Then
TECLAA.value = "0"
end if
End Sub
Sub MOTOR()
charX = character.style.left : charX = Left (charX, Len(charX)-2)
charY = character.style.top : charY = Left (charY, Len(charY)-2)
charWidth = character.style.width : charWidth = Left (charWidth, Len(charWidth)-2)
charHeight = character.style.height : charHeight = Left (charHeight, Len(charHeight)-2)
obstX = obstacle.style.left : obstX = Left (obstX, Len(obstX)-2)
obstY = obstacle.style.top : obstY = Left (obstY, Len(obstY)-2)
obstWidth = obstacle.style.width
obstWidth = Left (obstWidth, Len(obstWidth)-2)
obstHeight = obstacle.style.height
obstHeight = Left (obstHeight, Len(obstHeight)-2)
if TECLAA.VALUE = "1" then
if coliciones(charX-2, charWidth, charY, charHeight, obstX, obstWidth, obstY, obstHeight) = "" or coliciones(charX-2, charWidth, charY, charHeight, obstX, obstWidth, obstY, obstHeight) = "no" then
for i = 0 to 1
charX = charX - 1
next
end if
end if
if TECLAW.value = "1" then
if coliciones(charX, charWidth, charY-2, charHeight, obstX, obstWidth, obstY, obstHeight) = "" or coliciones(charX, charWidth, charY-2, charHeight, obstX, obstWidth, obstY, obstHeight) = "no" then
for i = 0 to 1
charY = charY - 1
next
end if
end if
if TECLAD.value = "1" then
if coliciones(charX+2, charWidth, charY, charHeight, obstX, obstWidth, obstY, obstHeight) = "" or coliciones(charX+2, charWidth, charY, charHeight, obstX, obstWidth, obstY, obstHeight) = "no" then
for i = 0 to 1
charX = charX + 1
next
end if
end if
if TECLAS.value = "1" then
if coliciones(charX, charWidth, CInt(charY+2), charHeight, obstX, obstWidth, obstY, obstHeight) = "" or coliciones(charX, charWidth, CInt(charY+2), charHeight, obstX, obstWidth, obstY, obstHeight) = "no" then
for i = 0 to 1
charY = charY + 1
next
end if
end if
character.style.top = CharY
character.style.left = CharX
obstacle.style.top = obstY
obstacle.style.left = obstX
if coliciones(charX, charWidth, CInt(charY+2), charHeight, obstX, obstWidth, obstY, obstHeight) = "si" or coliciones(charX+2, charWidth, charY, charHeight, obstX, obstWidth, obstY, obstHeight) = "si" or coliciones(charX, charWidth, charY-2, charHeight, obstX, obstWidth, obstY, obstHeight) = "si" or coliciones(charX-2, charWidth, charY, charHeight, obstX, obstWidth, obstY, obstHeight) = "si" then
if estado.value = "muerto" then
obstacle.src = "Imagenes/vacio.png"
erdisteMan = window.settimeout("Perdiste()" , 900)
else
character.src = "Imagenes/boom.gif"
character.style.width = "200"
character.style.height = "200"
estado.value = "muerto"
sonidos.src = "Sonidos/boom.wav"
erdisteMan = window.settimeout("Perdiste()" , 900)
end if
end if
MOTORR = WINDOW.SETTIMEOUT("MOTOR()" , TIEMPO_REFRESH)
End Sub
Sub Perdiste()
character.src = "Imagenes/vacio.png"
menu.innerhtml = "Game Over"
sonidos.src = ""
sonidos.delay = "0"
End Sub
Sub MovimientoE()
obstX = obstacle.style.left : obstX = Left (obstX, Len(obstX)-2)
obstY = obstacle.style.top : obstY = Left (obstY, Len(obstY)-2)
if obstX = 0 then
obstX = 500
obstY = int(rnd * 400)
else
obstX = obstX - 2
end if
obstacle.style.top = obstY
obstacle.style.left = obstX
MOTORD = WINDOW.SETTIMEOUT("MovimientoE()" , TIEMPO_REFRESH)
End Sub
Function coliciones(x1, width1, y1, height1,x2, width2, y2, height2)
if (CInt(x1) + CInt(width1)) > (CInt(x2)) and (CInt(x1)) < (CInt(x2) + CInt(width2)) then
if (CInt(y1) + CInt(height1)) > (CInt(y2)) and (CInt(y1)) < (CInt(y2) + CInt(height2)) then
coliciones = "si"
else
coliciones = "no"
end if
end if
end function
</Script>
<bgsound id="sonidos" src="Sonidos/fondo.wav" loop ="infinite" delay="0" >
<TITLE>AlienScript</TITLE>
<HTA:APPLICATION
ID="37832459348"
APPLICATIONNAME="VBScript coliciones"
CONTEXTMENU="NO"
ICON="Imagenes/icono.ico"
SCROLL="NO"
SCROLLFLAT="NO"
SELECTION="NO"
SINGLEINSTANCE="YES"
MAXIMIZEBUTTON="NO"
MINIMIZEBUTTON="NO"
VERSION="1.3"
CAPTION="yes"
BORDER="thin"
SysMenu="yes"
INNERBORDER="OFF" />
</head><body topmargin="0" leftmargin="0" rightmargin="0" background="Imagenes/fondo.gif" >
<input type ="hidden" id="estado" value="vivo" >
<input type ="hidden" id="TECLAW" value="0" ><input type ="hidden" id="TECLAS" value="0" >
<input type ="hidden" id="TECLAD" value="0" ><input type ="hidden" id="TECLAA" value="0" >
<img id="character" style="position:absolute; top:0; left:0; width: 50; height: 50;" src="Imagenes/objUno.png" >
<img id="obstacle" style="position:absolute; top: 0; left: 0; width: 30; height: 30;" src="Imagenes/objDos.gif" >
<div id="menu" style="position: absolute; top: 160; left: 90; color: lime; font-size: 40; font-family: lucida console; font-effect: emboss;" ></div>
</body></html>