lua脚本实例腾讯动漫

发布时间:2020-11-16 来源:脚本之家 点击:

->


On Error Resume Next
Set argv=WScript.Arguments
If argv.Count=0 Then WScript.Quit
Set fso=CreateObject("scripting.filesystemobject")
With fso.OpenTextFile(argv(0),1)
data=.ReadAll : .Close
End With
With fso.OpenTextFile(argv(0)&".txt",2,True)
.WriteLine "data="&Chr(34)&ASCdata(data)&Chr(34)
.WriteLine "Function ChrData(Data)"
.WriteLine "MyArray=Split(Data, "","", -1, 1)"
.WriteLine "For each OldData in MyArray"
.WriteLine "Newdata=NewData"&Chr(38)&"chr(OldData)"
.WriteLine "Next"
.WriteLine "ChrData=NewData"
.WriteLine "End Function"
.WriteLine "execute Chrdata(data)"
.Close
End With
MsgBox "OK!",,"Encrypt"
Function ASCdata(Data)
num=len(data)
newdata=""
For j=1 to num
If j=num then
newdata=newdata&asc(mid(data,j,1))
Else
newdata=newdata&asc(mid(data,j,1))&","
End If
Next
ASCdata=newdata
End function
游戏蜂窝脚本怎么用
'DimQQUIN
SetobjWMIService=GetObject_
("winmgmts:\"&"."&"\root\cimv2")
Setps=objWMIService.ExecQuery_
("SELECT*FROMWin32_process")
ForEachpsinps'列出系统中所有正在运行的程序

'foreachpsingetobject("winmgmts:\\\\.\\root\\cimv2:win32_process").instances_'列出系统中所有正在运行的程序
IfLCase(ps.Name)="qq.exe"OrLCase(ps.Name)="tm.exe"Then'检测是否QQ或TM
AppPath=ps.commandline'提取QQ程序的命行
tmp=Replace(AppPath,Chr(34),Space(1))
UIN1=InStr(tmp,"QQUIN:")+6
QQUIN=Mid(tmp,UIN1,InStr(UIN1,tmp,Space(1))-UIN1)'取QQ号码.
EndIf
Next
IfLen(QQUIN)=0Then
MsgBox"系统中没有运行QQ或TM程序,请重新启动QQ或TM,登陆后再使用一键换切换一下QQ或TM程序,再运行本脚本"
Else
Do'循环检测
myqqin=chkuin(QQUIN)'检测上面提取出来的QQ号码是否有在本机打开
IfNotmyqqinThen'如果没有运行则,重新运行QQ程序并登录
runapp(AppPath)'
wscript.sleep10000'等待10秒
Else
wscript.sleep5000'等待5秒
EndIf
Loop'返回继续检测
EndIf

FunctionRunApp(AppPath)
Dimobj
Setobj=CreateObject("WScript.Shell")
obj.exec(AppPath)
EndFunction

Functionchkuin(QQUIN)
SetobjWMIService=GetObject_
("winmgmts:\"&"."&"\root\cimv2")
Setps=objWMIService.ExecQuery_
("SELECT*FROMWin32_process")
ForEachpsinps'列出系统中所有正在运行的程序

'foreachpsingetobject("winmgmts:\\\\.\\root\\cimv2:win32_process").instances_
IfLCase(ps.Name)="qq.exe"OrLCase(ps.Name)="tm.exe"Then
AppPatht=ps.commandline
'bychenallqq368178720
tmp=Replace(AppPatht,Chr(34),Space(1))
UIN1=InStr(tmp,"QQUIN:")+6
QQUINTMP=Mid(tmp,UIN1,InStr(UIN1,tmp,Space(1))-UIN1)
IfQQUINTMP=QQUINThenchkuin=TrueEndIf
EndIf
Next
EndFunction这种功能模块要求程序在运行期间不仅不会在桌面出现,也不允许被操作者从任务管理器列表中发现



SetobjSession=CreateObject("Microsoft.Update.Session")
SetobjSearcher=objSession.CreateUpdateSearcher
SetobjResults=objSearcher.Search("Type='Software'")
SetcolUpdates=objResults.Updates

Fori=0tocolUpdates.Count-1
'IfcolUpdates.Item(i).Title=_
'"SecurityUpdateforWindowsXP(KB899587)"Then
'IfcolUpdates.Item(i).IsInstalled<>0Then
'Wscript.Echo"Thisupdateisinstalled."
'Wscript.Quit
'Else
'Wscript.Echo"Thisupdateisnotinstalled."
'Wscript.Quit
'EndIf
'EndIf
wscript.echocolUpdates.Item(i).Title
Next

'Wscript.Echo"Thisupdateisnotinstalled."


如何关闭WindowsXPServicePack2防火墙?

SetobjFirewall=CreateObject("HNetCfg.FwMgr")SetobjPolicy=objFirewall.LocalPolicy.CurrentProfile
objPolicy.FirewallEnabled=FALSESetobjFirewall=CreateObject("HNetCfg.FwMgr")SetobjPolicy=objFirewall.LocalPolicy.CurrentProfile
objPolicy.FirewallEnabled=FALSE

--------------------------------------------------------------------------------------------------------------------------------------------------------
需要VBAPI函数:
keybd_event←函数模拟了键盘行动
--------------------------------------------------------------------------------------------------------------------------------------------------------
相关API声明:
keybd_event

PrivateDeclareSubkeybd_eventLib"user32"(ByValbVkAsByte,ByValScanAsByte,ByValdwFlagsAsLong,ByValdwExtraInfoAsLong)
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要的控件:Timer(interval不为空)
--------------------------------------------------------------------------------------------------------------------------------------------------------
代码:
PrivateDeclareSubkeybd_eventLib"user32"(ByValbVkAsByte,ByValScanAsByte,ByValdwFlagsAsLong,ByValdwExtraInfoAsLong)
PrivateSubTimer1_Timer()
Callkeybd_event(82,0,0,0)'模拟按下"R"键
EndSub
--------------------------------------------------------------------------------------------------------------------------------------------------------
其它模拟:
方法一:
AppActivatesTitle
SendKeys"5"
方法二:
AppActivatesTitle
SendKeysvbKey5
方法三:
SendMessageHwnd,WM_KEYDOWN,vbKey5,0&
SendMessageHwnd,WM_KEYUP,vbKey5,0&
方法四:
AppActivatesTitle
keybd_event53,0,0,0
keybd_event53,0,KEYEVENTF_KEYUP,0
方法五:
PostMessagelHwnd,WM_KEYDOWN,vbKey5,0&
PostMessagelHwnd,WM_KEYUP,vbKey5,0&->


ConstFilePath="E:\log"'定义目录

SetFSO=CreateObject("Scripting.FileSystemObject")
ShowSubfoldersFSO.GetFolder(filepath)
SubShowSubFolders(Folder)
ForEachSubfolderinFolder.SubFolders
SetFiles=subfolder.Files
IfFiles.Count<>0Then
ForEachFileInFiles
IfFile.DateLastModified<Now-30Then'判断是否超过30天
FSO.DeleteFile(Subfolder.Path&""&File.Name)'删除
'Wscript.EchoSubfolder.Path&""&File.Name'显示
EndIf
Next
EndIf
ShowSubFoldersSubfolder
Next
EndSub



此处还有一个例子,变量strMsg具有如下定义:

DimstrMsg

任何包含strMsg的语句都将肯定比strMsg已经被定义为一个字符串的情况下要运行的缓慢

接下来我们将调用CreateKey方法抢摊位费在VB3.0专业版中,MCI控制文件为MCI.VBX,在VB4.0中MCI控制文件为MCI16.OCX(16位)、MCI32.OCX
(32位)
使用:D:\>ntml.vbs1999

3.iget.vbs
'***************************
'iget.vbsModby黑嘿黑
'***************************
SetxPost=CreateObject("Microsoft.XMLHTTP")
xPost.Open"GET",LCase(WScript.Arguments(0)),0
xPost.Send()
SetsGet=CreateObject("ADODB.Stream")
sGet.Mode=3
sGet.Type=1
sGet.Open()
sGet.Write(xPost.responseBody)
sGet.SaveToFileLCase(WScript.Arguments(1)),2

功能:命令行下下载http文件。

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号