Authr: Mock

Tested on: TFS 0.3.6 (Win XP i think it work on vista)
Require: Lua modules (http://otland.net/f163/lua-modules-otserv-socket-luasql-74836/) and lua curl (Attached)
When i tested this script at the first time i came to the edge of orgasm

So you can enter on your GM and say:
!tweet UPDATE TOMOROW
and will apear on your twitter it

Well first you need instal lua modules.
next you download all attacked DLL files and put it on you server folder (the same folder of config.lua and .exe not data folder)
Now add it on modules.xml
Code:
<module name="curl"/>
try find a way here LuaForge: LuaCURL: Project Filelist
if it works lets do it!
Add this tag on talkactions.xml:
Code:
<talkaction log="yes" words="!tweet" access="4" event="script" value="tweet.lua"/>
LUA:
--[[
Script to post on twitter by Mock the bear (MTB)
Using luaCurl
]]
tweet = {
c= curl.easy_init(),
check='http://www.twitter.com/statuses/update.xml',
user='username', -- here you put your username
password='yourpass', -- here you put password
}
function onSay(cid, words, param, channel)
if not tweet.c then
return doPlayerSendTextMessage(cid,25,'Could not create cURL state.')
else
tweet.c:setopt(curl.OPT_URL, tweet.check)
tweet.c:setopt(curl.OPT_CONNECTTIMEOUT, 10)
tweet.c:setopt(curl.OPT_POSTFIELDS, "status="..param);
tweet.c:setopt(curl.OPT_POST, 1)
tweet.c:setopt(curl.OPT_USERPWD, tweet.user..":"..tweet.password);
if tweet.c:perform() then
doPlayerSendTextMessage(cid,25,'Tweet sent! (I think)')
doSendMagicEffect(getCreaturePosition(cid),30)
else
doPlayerSendTextMessage(cid,25,'Error on send tweet.')
doSendMagicEffect(getCreaturePosition(cid),2)
end
end
return TRUE
end
reload and test

if it work enjoy!
if dont work try post here all erros and we try fix it ^^
If you want see my tests folow-me on twitter:
mockotnet
Attachments
-
dll.rar1.1 MB · Views: 39 · VirusTotal
Last edited: