• 0

    posted a message on SendChatMessage(): Invalid escape code in chat message
    one line seems help

    zeile_x=string.gsub ( zeile_x,"[|]","||")


    I replace the pipe with a double pipe ^^
    Posted in: Need Help?
  • 0

    posted a message on SendChatMessage(): Invalid escape code in chat message
    Hello ,
    First -forgive me my bad english but im not a natural english speaker.
    I have developed my first addon http://static.curseforge.net/content/files/416/915/bigletter.zip .
    You can types things in huge letters in the chat . And it will post some little ascii arts in the chat . In the Lua environment works well but in WoW i got an error message wenn i will send the google asccii art . Command in wow "/bl s google1" .

    see the code below

    zeichensatz.lua

    zeichensatz = {
    {
    [[░▄▀█]],
    [[░▀░█]],
    [[░░░█]],
    },
    {
    [[░▀▀█]],
    [[░█▀▀]],
    [[░▀▀▀]],
    },
    {
    [[░▀▀█]],
    [[░▀▀█]],
    [[░▀▀▀]],
    },
    {
    [[░▄▀█]],
    [[█▄▄█]],
    [[░░░█]],
    },
    {
    [[░█▀▀]],
    [[░▀▀█]],
    [[░▀▀▀]],
    },
    {
    [[░█▀▀]],
    [[░█▀█]],
    [[░▀▀▀]],
    },
    {
    [[█▀█]],
    [[░░█]],
    [[░░█]],
    },
    {
    [[░█▀█]],
    [[░█▀█]],
    [[░▀▀▀]],
    },
    {
    [[░█▀█]],
    [[░▀▀█]],
    [[░▀▀▀]],
    },
    {
    [[░█▀█]],
    [[░█░█]],
    [[░▀▀▀]],
    },
    a={
    [[░█▀█]],
    [[░█▀█]],
    [[░▀░▀]],
    },
    b={
    [[░█▀█░]],
    [[░█▀▀█]],
    [[░▀▀▀▀]],
    },
    c={
    [[░█▀▀]],
    [[░█░░]],
    [[░▀▀▀]],
    },
    d={
    [[░█▀█░]],
    [[░█░░█]],
    [[░▀▀▀░]],
    },
    e={
    [[░█▀▀]],
    [[░█▀▀]],
    [[░▀▀▀]],
    },
    f={
    [[░█▀▀]],
    [[░█▀▀]],
    [[░▀░░]],
    },
    g={
    [[░█▀▀▀]],
    [[░█░▀█]],
    [[░▀▀▀▀]],
    },
    h={
    [[░█░░█]],
    [[░█▀▀█]],
    [[░▀░░▀]],
    },
    i={
    [[░█]],
    [[░█]],
    [[░▀]],
    },
    j={
    [[░░░█]],
    [[░█░█]],
    [[░▀▀▀]],
    },
    k={
    [[░█░█░]],
    [[░█▀▀█]],
    [[░▀░░▀]],
    },
    l={
    [[░█░░]],
    [[░█░░]],
    [[░▀▀▀]],
    },
    m={
    [[░█▀█▀█]],
    [[░█░▀░█]],
    [[░▀░░░▀]],
    },
    n={
    [[░▀▄░░█]],
    [[░█░█▄▀]],
    [[░▀░░░▀]],
    },
    o={
    [[░█▀█]],
    [[░█░█]],
    [[░▀▀▀]],
    },
    p={
    [[░█▀█]],
    [[░█▀▀]],
    [[░▀░░]],
    },
    q={
    [[░█▀█░]],
    [[░█░█░]],
    [[░▀▀▀▌]],
    },
    r={
    [[░█▀▀█]],
    [[░█▀█▀]],
    [[░▀░▀▀]],
    },
    s={
    [[░█▀▀]],
    [[░▀▀█]],
    [[░▀▀▀]],
    },
    t={
    [[░█▀█▀█]],
    [[░░░█░░]],
    [[░░░▀░░]],
    },
    u={
    [[░█░█]],
    [[░█░█]],
    [[░▀▀▀]],
    },
    v={
    [[░█░█]],
    [[░█░█]],
    [[░░▀░]],
    },
    w={
    [[░█░░░█]],
    [[░█░█░█]],
    [[░▀▀▀▀▀]],
    },
    x={
    [[░▀▄░▄▀]],
    [[░░▄�*▄░]],
    [[░▀░░░▀]],
    },
    y={
    [[░█░█]],
    [[░▀█▀]],
    [[░░▀░]],
    },
    z={
    [[░▀▀█]],
    [[░█▀▀]],
    [[░▀▀▀]],
    },
    excl ={
    [[░█]],
    [[░█]],
    [[░▄]],
    },
    space={
    [[ ]],
    [[ ]],
    [[ ]],
    },
    google1={
    [[  ___                _]],
    [[ / __|___  ___  __ _| |___ ]],
    [[| (_ / _ \/ _ \/ _` |   -_)]],
    [[ \___\___/\___/\__, |_\___|]],
    [[              |___/]],
    },
    bunny1={
    [[(\_/)]],
    [[(O.o)]],
    [[(> <)]],
    },
    }
    


    bigletter.lua

    ChanTable = {
    	["whsiper"] = "WHISPER",
    	["w"] = "WHISPER",
    	["flüstern"] = "WHISPER",
    	["say"] = "SAY",
    	["sagen"] = "SAY",
    	["s"] = "SAY",
    	["yell"] = "YELL",
    	["schreien"] = "YELL",
    	["y"] = "YELL",
    	["emote"] = "EMOTE",
    	["e"] = "EMOTE",
    	["gilde"] = "GUILD",
    	["guild"] = "GUILD",
    	["g"] = "GUILD",
    	["party"] = "PARTY",
    	["gruppe"] = "PARTY",
    	["p"] = "PARTY",
    	["raid"] = "RAID",
    	["schlachtzug"] = "RAID",
    	["ra"] = "RAID",
    	["o"] = "OFFICER",
    	["battleground"] = "BATTLEGROUND",
    	["bg"] = "BATTLEGROUND",
    	["handel"] = {"CHANNEL", "2"},
    	["allgemein"] = {"CHANNEL", "1"},
    	["general"]={"CHANNEL", "1"},
    	["trade"]= {"CHANNEL", "2"},
    	["localdefense"]= {"CHANNEL", "4"},
    	["1"] = {"CHANNEL", "1"},
    	["2"] = {"CHANNEL", "2"},
    	["3"] = {"CHANNEL", "3"},
    	["4"] = {"CHANNEL", "4"},
    	["5"] = {"CHANNEL", "5"},
    	["6"] = {"CHANNEL", "6"},
    	["7"] = {"CHANNEL", "7"},
    	["8"] = {"CHANNEL", "8"},
    	["9"] = {"CHANNEL", "9"},
    }
    --wort1="ra omg"
    
    function GetSendChannel(inhalt)
     local ChanTable=ChanTable
    		
    	if not inhalt or inhalt == "" or inhalt == "%d" then
    		return nil,nil
    	end
    	
    	name= string.match(inhalt,"([^%s]*)")
    		
    	if ChanTable[name] then
    		if type(ChanTable[name])=="table" then
    			local chan = ChanTable[name][1]
    			local c_typ = ChanTable[name][2]
    			return chan, c_typ
    		else
    			local chan = ChanTable[name]
    			return chan,name
    		end
    	else
    		return "WHISPER", name
    	end
    end
    
    function bl(inhalt)
    
    	f_load={}
    	zeile_x=""
    	inhalt= strtrim (inhalt)
    	inhalt=string.lower(inhalt)
    	local chan,c_typ = GetSendChannel(inhalt)
    	--c_typh="g"
    	--chan ="GUILD"
    	for wort in string.gmatch(inhalt,"%s%S+") do
    		wort= strtrim(wort)
    		jj=3
    		ll = #wort
    		if zeichensatz[wort] ~= nil then
    			jj=table.getn(zeichensatz[wort])
    		     ll=1
    	    end
    		for kk=1,jj do
    			for ii=1,ll do
    				zwort=string.sub(wort,ii,ii)
    			
    				if zwort== "!"  then
    					zwort = "excl"
    				elseif zwort=="_" then
    					zwort= "space"
    				end
    				
    				if zeichensatz[wort] ~= nil then
    						u_wort=wort
    				else
    					u_wort=zwort
    				end
    				l_string(u_wort,ii,kk)
    			end
    			message_line (chan,c_typ)
    		end
    
    	end
    end
    
    function message_line (chan,c_typ)
    	--print (zeile_x..chan..c_typ)
    	SendChatMessage (zeile_x,chan,nil,c_typ)
    	zeile_x=""
    end
    
    function l_string (zeichen,lauf_ii,lauf_kk)
    	local zeichensatz=zeichensatz
    	z_feld=nil
    			
    	if zeichen:match ("[0-9]") ~=nil then
    	z_feld= tonumber(zeichen)
    	end
    	if zeichensatz[z_feld] or zeichensatz[zeichen] ~= nil  then
    	
    	if  z_feld  ~=nil then
    	z_feld = '['..z_feld..']'
    	--print (z_feld.."=zahl")
    	
    	else
    	z_feld= '[\"'..zeichen..'\"]'
    	--print (zeichen.."=Zeichen")
    
    	end	
    		
    				
    		f_load[lauf_ii]=loadstring('zeile_x= zeile_x..(zeichensatz'..z_feld..'['..lauf_kk..'])')
    		
    		f_load[lauf_ii]()
    	end
    end
    
    
    
    --bl(wort1)
    
    SlashCmdList["BL"] = bl
    SLASH_BL1 = "/BL"


    any idias to fix the problem ?

    Thanks in advance
    Posted in: Need Help?
  • To post a comment, please or register a new account.