【发布时间】:2011-02-05 10:29:20
【问题描述】:
我正在尝试为 Adium 编写一个简单的聊天机器人,它会发布“lol”和“haha”,并在一些人不断添加我的烦人群聊中回答基本问题。
我已经重复了一些简单的发送和延迟命令,但我还需要进行一些交互。
例如,对任何带有问号的内容回答“是”...
信不信由你,这样一个简单的机器人会通过图灵测试来进行这些对话。
打开 Adium 字典并没有显示任何明显的获取消息的方式,Growl 字典也没有。
我确实发现每次收到消息时我都可以运行一个脚本,有没有办法访问发送的消息?
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
【问题讨论】:
-
这是“图灵测试”,就像在艾伦图灵中一样。我不得不怀疑有多少人会通过图灵测试。另外,在最后一个问题中,您的意思是要访问 received 消息,还是要访问 you 刚刚发送的消息?
-
我会改的。是的,我想访问收到的消息,所以我可以在 Applescript 中编写一个基本的聊天机器人。
-
几年来我自己一直在想这个问题,但从未发现任何有用的东西。我觉得防止这种确切类型的事情发生符合 Adium 开发人员的利益——尽管其他人可以使用它。
-
我不明白发送聊天消息比使用 AppleScript 发送电子邮件更危险。
-
@Kyle 我不明白 Adium 开发人员为什么会关心。如果人们想编写一个聊天机器人,他们可以通过任何协议以几乎任何他们想要的语言来完成。除非您谈论的是恶意脚本接管您的聊天的可能性 - 即便如此,使用 applescript 几乎不可能做到这一点。
标签: applescript adium