• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TalkAction !commands for TFS 1.1

sdog1234

New Member
Joined
Dec 18, 2010
Messages
17
Reaction score
4
So I'm just posting this because I couldn't find it in Otland (probably just my bad research skills and because it's so basic). I found it here: http://www.tibiaking.com/forum/topic/52973-commands-para-tfs-11/

For those who don't want to register on another website just to read some code:

This goes in data>talkactions>talkactions.xml
Code:
 <talkaction words="!commands" script="commands.lua"/>

This goes in data>talkactions>scripts>commands.lua
Code:
function onSay(cid, words, param)
local p = Player(cid)
local file = io.open("data/talkactions/talkactions.xml", "r+")
local str = ""
local text = ""
for line in (file:lines()) do
  str = str.."\n"..line
end
file:close()

for a in string.gmatch(str, '<talkaction words="(.-)"') do
  text = text..'\n'..a
end

  p:showTextDialog(2160, text)
  return true
end

Cheers.
 
awesome works in tfs 1.2 thanks i was looking for this as well and i couldnt find it either but maybe i also have bad search skills :p
 
Any way to make it show only player commands and not all? =)
what i did was make a new talkactions.xml and remove the commands u dont want in there

and changed in his script
Code:
local file = io.open("data/talkactions/talkactions.xml", "r+")
to
Code:
local file = io.open("data/talkactions/whatever.xml", "r+")
 
my client crashes when i use this command.. tfs 1.2 no errors in cmd
any ideas? :D
 
Back
Top