[-AI-] bbs 自動貼字(原始碼)

看板EzHotKey作者 (-.-)時間15年前 (2010/03/03 19:32), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
┌─────────────────────────────────────┐ │ 文章代碼(AID): #1BXbYMrT (EZsoft) [ptt.cc] [推薦] P幣是三小 我只知道打 │ │ 文章網址: http://www.ptt.cc/bbs/EZsoft/M.1267095702.A.D5D.html │ │ │ └─────────────────────────────────────┘ 此篇文章就是,上面那程式的原始碼,有興趣的可以自己修改使用 前幾行是我改成彩色發文的樣子 ;==============正文開始============= #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $Form1 = GUICreate("Form1", 501, 370, 192, 124) GUISetFont(10) $Input1 = GUICtrlCreateInput("200", 8, 16, 121, 24) $Button1 = GUICtrlCreateButton("Button1", 408, 16, 75, 25, $WS_GROUP) $Edit1=GUICtrlCreateEdit("",8, 56, 481, 305,BitOR($ES_WANTRETURN,$WS_VSCROLL)) _GUICtrlEdit_SetMargins($Edit1,BitOR($EC_LEFTMARGIN, $EC_RIGHTMARGIN),10,10) GUICtrlSetData(-1, "Edit1") $Label1 = GUICtrlCreateLabel("Label1", 140, 16, 200) GUISetState(@SW_SHOW) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Input1 Case $Button1 ClipPut(GUICtrlRead ( $Edit1 )) ;將編輯區的文字複製 $ClipText = StringSplit(StringReplace(ClipGet(), @CR, ""), @LF) For $i = 1 To $ClipText[0] $ClipTextLine = StringSplit($ClipText[$i], "") For $j = 1 To $ClipTextLine[0] If $ClipTextLine[$j] = Chr(0x1B) Then ControlSend("[CLASS:PCMan]" , "", 1, "^u") Else ClipPut($ClipTextLine[$j]) ControlSend("[CLASS:PCMan]" , "", 1, "^u") ControlSend("[CLASS:PCMan]" , "", 1, "[1;") ControlSend("[CLASS:PCMan]" , "", 1, Random(31,37,1)) ControlSend("[CLASS:PCMan]" , "", 1, "m") ControlSend("[CLASS:PCMan]" , "", 1, "!p") ; 貼上 ControlSend("[CLASS:PCMan]" , "", 1, "^c") EndIf Sleep(GUICtrlRead ( $Label1 )) ;讀入延遲秒數 Next ControlSend("[CLASS:PCMan]" , "", 1, "{ENTER}") Sleep(100) Next MsgBox(0, "", "貼文完成") Case $Edit1 EndSwitch $len =StringLen(GUICtrlRead ( $Edit1 )) $llss = GUICtrlRead($Input1) $T_sec = $llss/1000*$len GUICtrlSetData($Label1, "ms "& $len& "字,所需時間約"&$T_sec &"秒") Sleep(50) WEnd ;================正文結束=============== -- 都說看不到我了 ╱ ̄ ̄ ̄╲ │>////<│ 你硬是要開燈 │▼▼▼▼│╯ 你看不到我… ◥ ▲▲▲▲ ◤ 難不成貪戀我的美色?│ ˙ ˙ │ 你看不到我… ╲╴╴╴╴◤ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.66.168.38 ※ 編輯: wait999 來自: 210.66.168.38 (03/03 19:33)

03/05 16:46, , 1F
測式之後,發現遇到控制碼很容易漏字。
03/05 16:46, 1F
文章代碼(AID): #1BZaYti9 (EzHotKey)
文章代碼(AID): #1BZaYti9 (EzHotKey)