PtokaX forum

Development Section => Your Developing Problems => Topic started by: NightLitch on 31 March, 2004, 15:52:11

Title: Help with LUA5 BCDC++ Scripting with gsub!!
Post by: NightLitch on 31 March, 2004, 15:52:11
how do I solve this:

LUA Error: beginner.lua:52: attempt to call global `gsub' (a nil value)

dcpp:setListener( "chat", "MainChat",
function( client, user, text )
-- Original Message
client:sendChat( user:getNick().. " you are advertising: "..text )
local line = string.lower( text )
for i,v in CharCh do
line=gsub(line, i, v)
end
-- Changed Message
client:sendChat( user:getNick().. " you are advertising: "..line )

-- CA(client,user,line,text)
end
)

plz help / NL
Title:
Post by: NotRabidWombat on 31 March, 2004, 16:08:18
RTFM! http://www.lua.org/manual/5.0/

Most of lua 4.0 global functions are now contained inside of specific tables (much like namespaces).
http://www.lua.org/manual/5.0/manual.html#5.3

string.gsub(....)

-NotRabidWombat