我正在嘗試爲Adium寫一個簡單的聊天機器人,它會發布「哈哈」和「哈哈」,並回答一些人在不斷添加我的煩人羣聊中的基本問題。在Applescript中接收Adium消息
我已經用一些簡單的發送和延遲命令覆蓋了「lol」部分,但我還需要做一些交互。
對任何帶問號的問題回答「是」,例如...
相信我或不信,這樣一個簡單的機器人會通過一個圖靈測試來進行這些對話。
打開Adium詞典並沒有顯示任何明顯的獲取消息的方式,也沒有咆哮詞典。
我確實發現每次收到郵件時我都可以運行腳本,有沒有辦法訪問發送的郵件?
Adium pref http://media.ruk.ca/images/adiumpreferences.png
我的代碼:
tell application "Adium"
activate
set theChat to the active chat
send theChat message "Hi"
delay 5
send theChat message "How's life?"
delay 10
repeat 10 times
send theChat message "Realy?"
delay 5
send theChat message "Lol :P"
delay 15
send theChat message "Haha XD"
delay 15
send theChat message "Yes1!!1"
delay 20
send theChat message "I like it! :D"
delay 10
end repeat
send theChat message "Bye!"
tell theChat to close
end tell
與Alan Turing一樣,它是「圖靈測試」。我不得不想知道有多少人會通過圖靈測試。另外,在最後一個問題中,你的意思是你想要訪問* received *消息,還是你剛剛發送的消息? – 2010-01-24 18:01:56
我會改變它。 是的,我想訪問收到的消息,所以我可以在Applescript中編寫一個基本的聊天機器人。 – Pepijn 2010-01-24 19:39:15
我一直在想這個我自己幾年,從來沒有發現任何使用。我有一種感覺,它符合Adium開發者的利益,以防止這種確切類型的事情發生 - 儘管其他人可以使用它。 – 2010-06-04 17:18:56