复古传奇手游挂机脚本如何做

发布时间:2020-08-27 来源:脚本之家 点击:



但是若您希望只有单行,不要多行,则必须判断User是否按了EnterKey,那只好在TextBox的KeyPress中加入以下程序码,以去除Enter的作用:

PrivateSubText1_KeyPress(KeyAsciiAsInteger)
IfKeyAscii=vbKeyReturnThen
KeyAscii=0
EndIf->

因为有的网络原因,有的无法成mht,请对照url.htm目录列表检查
'====================================================================================================

On Error Resume next
if (lcase(right(wscript.fullname,11))="wscript.exe") then
wscript.echo "Execute it under the cmd.exe Plz! Thx."
wscript.quit
end if

Const adSaveCreateNotExist=1
Const adSaveCreateOverWrite=2
Const adTypeBinary=1
Const adTypeText=2

Set args=WScript.Arguments

if args.Count=0 then
WScript.Echo "Usage: CScript baidublogbak.vbs blogname i n url.htm username password"
WScript.Quit 1
end If

Set objMessage=CreateObject("CDO.Message")
Set ie=WScript.CreateObject("InternetExplorer.Application")
ie.visible=true
ie.navigate ""

Do
Wscript.Sleep 200
Loop Until ie.ReadyState=4
ie.document.getElementById("username").value=args.Item(4)
ie.document.getElementById("password").value=args.Item(5)
tj=ie.document.getElementsBytagname("form")
tj.submit
WScript.Sleep 10000
Sub SaveToFile(Msg, Fn)
Dim Strm, Dsk
Set Strm=CreateObject("ADODB.Stream")
Strm.Type=adTypeText
Strm.Charset="gb2312"
Strm.Open
Set Dsk=Msg.DataSource
Dsk.SaveToObject Strm, "_Stream"
Strm.SaveToFile Fn, adSaveCreateOverWrite
End Sub

For n=args.Item(1) To args.Item(2) Step 1

url=""&args.Item(0)&"/blog/index/"&n
ie.Navigate url
ie.visible=false

While ie.Busy
WScript.Sleep 100
Wend

Do
Wscript.Sleep 200
Loop Until ie.ReadyState=4

wscript.echo "正保存第"&n&"页"
Wscript.Sleep 3000

For i=0 To ie.Document.links.length-1
If InStrRev(ie.Document.links(i).href,"blog/item/",-1,1)<> 0 And InStrRev(ie.Document.links(i).innerText,"浏览",-1,1)=0 And InStrRev(ie.Document.links(i).href,"#comment",-1,1)=0 And InStrRev(ie.Document.links(i).href,"cmtid",-1,1)=0then
wscript.echo ie.Document.links(i).href &"||"&ie.Document.links(i).innerText
CreateObject("Scripting.FileSystemObject").OpenTextFile(args.Item(3),8,True,0).WriteLine(ie.Document.links(i).href &"||"&ie.Document.links(i).innerText)
objMessage.CreateMHTMLBody ie.Document.links(i).href
SaveToFile objMessage, ie.Document.links(i).innerText&".mht"
End if

Next

next

ie.quit
Set ie=nothing
一键玩奶块脚本教程
Setwmi=GetObject("winmgmts:\")

Setboard=wmi.instancesof("win32_baseboard")
ForEachbInboard
msg="主板:"&b.Manufacturer&vbTab&b.product&vbTab&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)

Setcpus=wmi.instancesof("win32_processor")
msg=msg&"CPU特征:"+Chr(13)
ForEachcpuIncpus
msg=msg+cpu.deviceid&vbTab&cpu.name&Chr(13)_
&vbtab&cpu.SocketDesignation&vbtab&cpu.CurrentClockSpeed&"MHz"&vbtab&cpu.l2cachesize&"Kb_L2"&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)

Setmem=wmi.instancesof("win32_physicalmemory")
msg=msg&"内存容量:"+Chr(13)
ForEachmInmem
msg=msg&m.tag&space(10)&m.capacity&+Chr(13)
Next

Setmem=wmi.instancesof("win32_computersystem")
ForEachmInmem
msg=msg&"内存总容量:"&Round((m.totalphysicalmemory/1024^2),2)&"M"+Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)

Setdisplay=wmi.instancesof("Win32_videocontroller")
msg=msg&"显示系统:"+Chr(13)
ForEachvideoIndisplay
msg=msg&video.deviceid&vbTab&video.name&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)


Setdisks=wmi.instancesof("win32_diskdrive")
msg=msg&"硬盘容量:"+Chr(13)
ForEachdIndisks
Ifint(d.size/(1024^3))=0Then
n=Round(d.size/(1024^2),2)&"M"
Else
n=Round(d.size/(1024^3),2)&"G"
EndIf

msg=msg+d.deviceid&"空间为:"&n&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)


MsgBoxmsg,0,"电脑基本特征"

'文件名SourceDB.ini文件

  PrivateDeclareFunctionGetPrivateProfileStringLib"kernel32"Alias

  "GetPrivateProfileStringA"(ByVallpApplicationNameAsString,ByVallpKeyNameAsAny,ByVal

  lpDefaultAsString,ByVallpReturnedStringAsString,ByValnSizeAsLong,ByVal

  lpFileNameAsString)AsLong

  PrivateDeclareFunctionWritePrivateProfileStringLib"kernel32"Alias

  "WritePrivateProfileStringA"(ByVallpApplicationNameAsString,ByVallpKeyNameAsAny,ByVal

  lpStringAsAny,ByVallpFileNameAsString)AsLong

  

  '以下两个函数,读/写ini文件,固定节点setting,in_key为写入/读取的主键

  '仅仅针对是非值

  'Y:yes,N:no,E:error

  PublicFunctionGetIniTF(ByValIn_KeyAsString)AsBoolean

  OnErrorGoToGetIniTFErr

  GetIniTF=True

  DimGetStrAsString

  GetStr=VBA.String(128,0)

  GetPrivateProfileString"Setting",In_Key,"",GetStr,256,App.Path&"\SourceDB.ini"

  GetStr=VBA.Replace(GetStr,VBA.Chr(0),"")

  IfGetStr="1"Then

  GetIniTF=True

  GetStr=""

  Else

  GoToGetIniTFErr

  EndIf

  ExitFunction

  GetIniTFErr:

  Err.Clear

  GetIniTF=False

  GetStr=""

  EndFunction

  

  PublicFunctionWriteIniTF(ByValIn_KeyAsString,ByValIn_DataAsBoolean)AsBoolean

  OnErrorGoToWriteIniTFErr

  WriteIniTF=True

  IfIn_Data=TrueThen

  WritePrivateProfileString"Setting",In_Key,"1",App.Path&"\SourceDB.ini"

  Else

  WritePrivateProfileString"Setting",In_Key,"0",App.Path&"\SourceDB.ini"

  EndIf

  ExitFunction

  WriteIniTFErr:

  Err.Clear

  WriteIniTF=False

  EndFunction


  '以下两个函数,读/写ini文件,不固定节点,in_key为写入/读取的主键

  '针对字符串值

  '空值表示出错

  PublicFunctionGetIniStr(ByValAppNameAsString,ByValIn_KeyAsString)AsString

  OnErrorGoToGetIniStrErr

  IfVBA.Trim(In_Key)=""Then

  GoToGetIniStrErr

  EndIf

  DimGetStrAsString

  GetStr=VBA.String(128,0)

  GetPrivateProfileStringAppName,In_Key,"",GetStr,256,App.Path&"\SourceDB.ini"

  GetStr=VBA.Replace(GetStr,VBA.Chr(0),"")

  IfGetStr=""Then

  GoToGetIniStrErr

  Else

  GetIniStr=GetStr

  GetStr=""

  EndIf

  ExitFunction

  GetIniStrErr:

  Err.Clear

  GetIniStr=""

  GetStr=""

  EndFunction

  

  PublicFunctionWriteIniStr(ByValAppNameAsString,ByValIn_KeyAsString,ByValIn_DataAsString)AsBoolean

  OnErrorGoToWriteIniStrErr

  WriteIniStr=True

  IfVBA.Trim(In_Data)=""OrVBA.Trim(In_Key)=""OrVBA.Trim(AppName)=""Then

  GoToWriteIniStrErr

  Else

  WritePrivateProfileStringAppName,In_Key,In_Data,App.Path&"\SourceDB.ini"

  EndIf

  ExitFunction

  WriteIniStrErr:

  Err.Clear

  WriteIniStr=False

  EndFunction

->


dimprogram
program="c:\ProgramFiles\Tencent\qq\QQ.exe" '你的qq路径
setWshell=CreateObject("Wscript.Shell")
setoexec=Wshell.Exec(program)
wscript.Sleep2000
Wshell.AppActivate"QQTang"
Wshell.SendKeys"+{TAB}"
Wshell.SendKeys"QQ号码"
wscript.Sleep1000
Wshell.SendKeys"{TAB}"
Wshell.SendKeys"QQ密码"
wscript.Sleep1000
Wshell.SendKeys"{ENTER}"

->

可选假如您对MSComm的基本属性还不了解,建议请先至MSComm基本介绍一文中详读

表单画面

'表单部分
'-------------------------------------------------------------
Form.Name="Form1"
Caption="Form1"
CommandButton.Name=Command2
Caption="停止测试"
CommandButton.Name=Command1
Caption="开始测试"
TextBox.Name=Text1
MSComm.Name=MSComm1
DTREnable=-1'True
Label.Name=Label1
AutoSize=-1'True
Caption="欲送出的资料-按下[Enter]送出"
Label.Name=Label3
BorderStyle=1'单线固定
Label.Name=Label2
AutoSize=-1'True
Caption="折返显示"

'程式部分
'-------------------------------------------------------------
OptionExplicit
'设一个此表单的区域变数,来作终止读取通讯埠的指标
DimbStopAsBoolean
'设一个区域变数,来作读取通讯埠的暂存区
DimInStringAsString

PrivateSubCommand1_Click()
bStop=False
Text1.SetFocus
WithMSComm1
'设定通讯埠号,可依照您的需求更改
.CommPort=2
'设定传输速率等,可依照您的需求更改
.Settings="14400,N,8,1"
'将通讯埠打开
.PortOpen=True
EndWith
'假如使用者未按下「停止测试」钮(bStop=False),则继续读取
DoWhileNotbStop
IfMSComm1.InBufferCountThen
'通讯埠中假如有资料的话,则读取进来
InString=InString&MSComm1.Input
'如果资料中有Chr(13)和Chr(10)的话,则显示出来
IfInStr(InString,vbCrLf)Then
Label3.Caption=Label3.Caption&InString
InString=""
'暂时把系统资源让出来给其它的程式使用
DoEvents
EndIf
EndIf
DoEvents
Loop
EndSub

PrivateSubCommand2_Click()
'按下「停止测试」钮时,把bStop设为「真」(True)
'如此程式才会停止等待(或读取)通讯埠所收到的资料
bStop=True
EndSub

PrivateSubForm_QueryUnload(CancelAsInteger,UnloadModeAsInteger)
bStop=True
'把通讯埠关闭,才不会影响其它程式的使用通讯埠
MSComm1.PortOpen=False
End
EndSub

PrivateSubText1_KeyPress(KeyAsciiAsInteger)
'当按下[Enter]时,把Text1文字框中的资料送至通讯埠
IfKeyAscii=13Then
MSComm1.Output=Text1.Text&vbCrLf
Text1.Text=""
KeyAscii=0
EndIf
EndSub->


非常酷,哈?如果将窗口标题更改为 Internet Explorer 由 Fabrikam.com 提供,那么它将在页面标题后显示中密码输入当你退出FORM时,不论在有一个、100个甚至没有数据库连接时都可以使用下面代码

注意:如果我们想解除锁定任务栏而不是想对其进行锁定怎么办?没问题;只需将值1赋值给dwValue即可。

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