-- Metaplace Chat System v1.0 Web Functionality Extension -- Dictionary Chat Feature -- Author: Jeff The Intern -- Revision History -- 06/17/08 J.McNab - New script -- Define Base Properties Define Properties() -- Include chat_utility script IncludeScript('11302:12') chat_dictionary= { sender_name = '', message = ''} end Trigger attach() --/define: SendTo(self, 'chat_system_register_command', 0, 'define', 'Lookup the definition of a word', 0, 0) SendTo(self, 'chat_system_register_alias', 0, 'def', 'define') end Trigger detach() SendTo(self, 'chat_system_unregister_command', 0, 'define') end Trigger chat_msg_define(sender, word_to_define) local channel = chat_system_channel_name('user', sender.name) if (word_to_define ~= '') then local url = "http://services.aonaware.com/DictService/DictService.asmx/DefineInDict?dictId=wn&word=" .. word_to_define local method = "GET" local body = "" local message = 'Looking up ' .. word_to_define .. '...' chat_system_send_to_subscribers(self, sender, channel, message , 'define') SendTo(sender, 'chat_web_tools_trigger', 0, 'dictionary', url, method, body) else -- Show list of possible languages message = {"Usage", " /define word_to_define"} for _, line in ipairs(message) do chat_system_send_to_subscribers(self, sender, channel, line, 'define') end end chat_system_set_callback(sender, CHAT_STATUS_CODES.OK, 'OK') end