0
我想做一个点击机器人,但我不明白为什么他不工作。运行子作品,但其他没有。 zou能帮助我解释你如何将对象传递给一个过程吗?非常感谢,非常感谢。VBScipt对象内部过程
Sub run()
set wshshell = wscript.CreateObject("wscript.shell")
wshshell.run "chrome.exe"
wscript.sleep (5000)
WshShell.Sendkeys "https://scrap.tf/raffles"
WshShell.Sendkeys "{ENTER}"
End Sub
Sub find()
wscript.sleep (5000)
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{ENTER}"
End Sub
Sub enter()
wscript.sleep (5000)
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{ENTER}"
End Sub
Sub back()
wscript.sleep (5000)
WshShell.Sendkeys "%{LEFT}"
wscript.sleep (5000)
End Sub
Call run
Call find
Call enter
Call back
你必须从另一个子内调用你的其他潜艇。 vbscript只是运行您的第一个列出的子。它忽略了“Call”语句。 –
@ jbarker2160,我不同意 - 脚本全局范围内的代码和使用'call'语句都可以很好地处理VBS。 – omegastripes
@omegastripes,那么你有一个更好的答案,为什么它不工作在这个特定的情况下? –