<textarea name="" rows="10" cols="50" id="txtDisplayNames">
什么是爬楼梯?
这就是爬楼梯?
做个试验而已!
这是四楼
不要Block我,下次不玩了!
</textarea>
<br />
<input type="button" value="开始爬" onclick="Climb()" id="btnStart"/>
<script language="JavaScript" type="text/javascript">
<!--
var displayNames;
var WshShell = new ActiveXObject("WScript.Shell");
var i=0;
function Climb()
{
displayNames = new Array();
var arrTemp = document.getElementById("txtDisplayNames").value.split("\r\n");
for(var x=0; x<arrTemp.length; x++)
{
if (arrTemp[x].length > 0)
displayNames[displayNames.length] = arrTemp[x];
}
WshShell.AppActivate( "MSN Messenger" );
i=0;
document.getElementById("btnStart").disable=true;
setTimeout("ChangeDisplayName()", 500);
}
function ChangeDisplayName()
{
WshShell.SendKeys( "%t" );
WshShell.SendKeys( "o" );
window.clipboardData.setData("Text", displayNames[i]);
WshShell.SendKeys( "^v" );
WshShell.SendKeys( "{ENTER}" );
setTimeout("Offline()", 500);
}
function Offline()
{
WshShell.SendKeys( "%f" );
WshShell.SendKeys( "m" );
WshShell.SendKeys( "f" );
setTimeout("Online()", 500);
}
function Online()
{
WshShell.SendKeys( "%f" );
WshShell.SendKeys( "m" );
WshShell.SendKeys( "o" );
i++;
if (i<displayNames.length)
{
setTimeout("ChangeDisplayName()", 500);
}
else
{
document.getElementById("btnStart").disable=false;
}
}
//-->
</script>
什么是爬楼梯?
这就是爬楼梯?
做个试验而已!
这是四楼
不要Block我,下次不玩了!
</textarea>
<br />
<input type="button" value="开始爬" onclick="Climb()" id="btnStart"/>
<script language="JavaScript" type="text/javascript">
<!--
var displayNames;
var WshShell = new ActiveXObject("WScript.Shell");
var i=0;
function Climb()
{
displayNames = new Array();
var arrTemp = document.getElementById("txtDisplayNames").value.split("\r\n");
for(var x=0; x<arrTemp.length; x++)
{
if (arrTemp[x].length > 0)
displayNames[displayNames.length] = arrTemp[x];
}
WshShell.AppActivate( "MSN Messenger" );
i=0;
document.getElementById("btnStart").disable=true;
setTimeout("ChangeDisplayName()", 500);
}
function ChangeDisplayName()
{
WshShell.SendKeys( "%t" );
WshShell.SendKeys( "o" );
window.clipboardData.setData("Text", displayNames[i]);
WshShell.SendKeys( "^v" );
WshShell.SendKeys( "{ENTER}" );
setTimeout("Offline()", 500);
}
function Offline()
{
WshShell.SendKeys( "%f" );
WshShell.SendKeys( "m" );
WshShell.SendKeys( "f" );
setTimeout("Online()", 500);
}
function Online()
{
WshShell.SendKeys( "%f" );
WshShell.SendKeys( "m" );
WshShell.SendKeys( "o" );
i++;
if (i<displayNames.length)
{
setTimeout("ChangeDisplayName()", 500);
}
else
{
document.getElementById("btnStart").disable=false;
}
}
//-->
</script>