VBA解決Windows空當接龍的617局

2022-09-26 01:00:13 字數 1261 閱讀 8436

windows的自帶遊戲空當接龍,其中第617局是比較難解的,需要嘗試的次數比較多,而且經常忘記解法和步驟。

原本希望使用autoit或autohotkey、aauto一類的工具,寫一段自動化指令碼快速解www.cppcns.com決這一局,但這些工具需要安裝,而且容易被當做病毒。通過office中的vba呼叫windows的api,對遊戲視窗傳送按鍵訊息,可以快速演示解法。

declare function findwindow lib "user32" alias _

"findwindowa" (byval lpclassname as strinzvgaymxg, byval lpwindowname as string) as long

declare function sendmessage lib "user32" alias _

"sendmessagea" (byval hwnd as long, byval wmsg as long, byval wparam as long, byval lparam as long) as long

const wm_char = &h102

sub f()

s = "83 80 83 81 80 " & _

"20 27 72 " & _

"48 46 41 48 42 " & _

"89 48 70 74 78 07 40 27 " & _程式設計客棧

"1zvgaymx0 14 004 10 01 16 19 " & _

"20 002 42 21 20 " & _

"32 34 24 32 42 34 30 38 " & _

"58 53 63 57 56 50 " & _

"10 10 13 15 35 13 12 18"

h = findwindow("freewclass", "空當接龍遊戲 #617")

for i = 1 to len(s)

c = mid(s, i, 1)

m = 0.1

if c >= "0" and c <= "9" twww.cppcns.comhen

a = sendmessage(h, wm_char, asc(c), 0)

else

m = 0.3

end if

m = m + timer: do while timer < m: doevents: loop

next

end sub

本文標題: vba解決windows空當接龍的617局

本文位址:

CentOS 連線Windows共享的橋接網路

解決的問題 有一台centos 7.6 linux台式計算機,沒有無線網路 想共享筆記本連線的無線網路,筆記本配置無線和有線乙太網。解決方法 筆記本連線好wifi 筆記本乙太網設定自動獲得ip,自動獲得dns伺服器 選中wifi和乙太網,建立橋接,結果如下圖所示 用網線連線linux主機與筆記本 重...

Virtualbox橋接無網路解決

virtualbox網路設定為橋接方式,linux虛擬機器沒有網路。即使手動設定ip 子掩碼也沒有網路。2.1 設定virtualbox連線方式為橋接網絡卡,介面名選擇為當前電腦使用的網絡卡驅動。如果是網線有線連線則選擇有線網絡卡,如果是無線連線則選擇無線網絡卡,如圖。進入網路和共享中心中的介面卡設...

Windows網絡卡故障解決

netsh winsock reset 這個命令作用是重置 winsock 目錄。如果一台機器上的winsock協議配置有問題的話將會導致網路連線等問題,就需要用netsh winsock reset命令來重置winsock目錄藉以恢復網路。這個命令的好處是可以重新初始化網路環境,以解決由於軟體衝突...