Ejemplo simple del método random en Visual Basic Script.
Dim max,min,x,na,res
Randomize
Set objRandom = CreateObject( "System.Random" )
na= objRandom.Next_2( 1, 100 )
res=2+na
wscript.echo(""&na&""&res)
for (cont=0;cont<=30;cont++)
{
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.AppActivate ("Google Earth");
WshShell.Sendkeys ("{TAB}");
var cor1=Math.floor(Math.random()* 40);
var cor2=Math.floor(Math.random()* 50);
var cor3=Math.floor(Math.random()* 50);
var cor4=Math.floor(Math.random()* 50);
var cor5=Math.floor(Math.random()* 50);
var cor6=Math.floor(Math.random()* 50);
WshShell.Sendkeys (""+cor1+"°"+cor2+"'"+cor3+", "+cor4+"° "+cor5+"'"+cor6+"");
WScript.Sleep ("2000");
WshShell.sendkeys ("~");
WScript.Sleep ("7000");
WshShell.Sendkeys ("^(%s)");
WScript.Sleep ("3000");
WshShell.Sendkeys (""+cor1+"°"+cor2+"'"+cor3+",");
WScript.Sleep ("1000");
WshShell.Sendkeys (""+cor4+"° "+cor5+"'"+cor6+"'"+cont+"");
WScript.sleep ("3000");
WshShell.Sendkeys ("~")
WScript.Sleep ("3000");
WshShell.sendkeys ("+({TAB})");
WScript.Sleep ("2000");
if (cont==7) {
VoiceObj = new ActiveXObject("Sapi.SpVoice");
VoiceObj.Speak("intermedio");
WScript.sleep ("9000");
}
}
Dim max,min,x,na,res
Randomize
Set objRandom = CreateObject( "System.Random" )
na= objRandom.Next_2( 1, 100 )
res=2+na
wscript.echo(""&na&""&res)
Ejemplo método random en Java script, cálculos de coordenadas en Google Earth.
for (cont=0;cont<=30;cont++)
{
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.AppActivate ("Google Earth");
WshShell.Sendkeys ("{TAB}");
var cor1=Math.floor(Math.random()* 40);
var cor2=Math.floor(Math.random()* 50);
var cor3=Math.floor(Math.random()* 50);
var cor4=Math.floor(Math.random()* 50);
var cor5=Math.floor(Math.random()* 50);
var cor6=Math.floor(Math.random()* 50);
WshShell.Sendkeys (""+cor1+"°"+cor2+"'"+cor3+", "+cor4+"° "+cor5+"'"+cor6+"");
WScript.Sleep ("2000");
WshShell.sendkeys ("~");
WScript.Sleep ("7000");
WshShell.Sendkeys ("^(%s)");
WScript.Sleep ("3000");
WshShell.Sendkeys (""+cor1+"°"+cor2+"'"+cor3+",");
WScript.Sleep ("1000");
WshShell.Sendkeys (""+cor4+"° "+cor5+"'"+cor6+"'"+cont+"");
WScript.sleep ("3000");
WshShell.Sendkeys ("~")
WScript.Sleep ("3000");
WshShell.sendkeys ("+({TAB})");
WScript.Sleep ("2000");
if (cont==7) {
VoiceObj = new ActiveXObject("Sapi.SpVoice");
VoiceObj.Speak("intermedio");
WScript.sleep ("9000");
}
}
Publicar un comentario