Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 2 of 2
  1. #1
    Join Date
    January 2018
    Posts
    1

    [Request] Simple LUA Script

    Hi! I am trying to make a simple lua script for mac that will play a tone over the mic if someone does !tone in the channel text chat. Here is what I have in my init.lua

    Code:
    require("ts3defs")      -- Required
    require("ts3errors")    -- Required
    require("ts3init")      -- Required
    require("ts3autoload")  --
    
    function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
    	if message == "!tone" then
    		local error = ts3.playWaveFile(serverConnectionHandlerID, "./plugins/lua_plugin/test.wav")
    		if error == ts3errors.ERROR_ok then
    			ts3.printMessageToCurrentTab("Played wave file")
    		else
    			ts3.printMessageToCurrentTab("Error playing wave file: " .. error)
    		end
    		ts3.requestSendChannelTextMsg(serverConnectionHandlerID,"Playing Tones",1)
    	end
    end
    When I do !tone, I get this error: Error playing wave file: 2051. I assume something is wrong with my directories or my code somehow. Yes, the .wav is in the dir. What's going on?

  2. #2
    Join Date
    August 2013
    Location
    Germany
    Posts
    541
    playWaveFile only plays it local for you. You can't transmit audio with LUA.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Resolved] Help with simple Lua script
    By Idler in forum Client Plugins / Lua Scripts
    Replies: 11
    Last Post: December 14th, 2015, 02:39 PM
  2. Rather simple service script
    By wowsin in forum Linux / FreeBSD
    Replies: 5
    Last Post: September 6th, 2010, 07:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •