Help with LUA5 BCDC++ Scripting with gsub!!
 

Help with LUA5 BCDC++ Scripting with gsub!!

Started by NightLitch, 31 March, 2004, 15:52:11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NightLitch

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
//NL

NotRabidWombat

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


I like childish behavior. Maybe this post will be deleted next.

SMF spam blocked by CleanTalk