Forum

Results 1 to 4 of 4
  1. #1
    Join Date
    December 2015
    Location
    Wisconsin
    Posts
    1

    [Request] Automated Responding to Pokes

    Hi all, I just made an account so please excuse me for any mishaps or misunderstandings. If I am posting in the wrong forum please let me know and I'll promptly remove this.

    So just for reference, I am an admin for a specific gaming community. It is my duty to help the players and make sure they have a good experience. Part of my duty is to be on teamspeak and resolve any issues that may happen.

    MY PROBLEM: I am constantly annoyed, poked, messaged, and bothered by other players in the teamspeak when I am busy. I may be busy for various reasons, however these people will constantly pester me until I address them.

    I am looking for some sort of script/plugin that can automatically reply to people who poke me. Any thoughts or Ideas? I did some searching around here and found some old posts about people in a similar situation as mine.

    I already have the Lua Plugin installed,

    Here is some code that I found on the forums:

    Code:
    require("ts3init")
    local count = {} --To keep track of poke count.
    local haspoked = {} --To index individual users.
    local poketime = {} --To save poke times.
    local maxpokes = 3 --Max number of pokes.
    local maxtime = 180 --Interval in seconds in which the pokes will be accounted for.
    local doreply = "y"
    local recmsg = "Received your poke! Please don't poke me again, I'll respond whenever I can." --Message to be sent on poke receival.
    local kickmsg = "Don't abuse pokes!" --Message to be sent with kick.
    local function onClientPokeEvent(serverConnectionHandlerID, pokerID, pokerName, message, ffIgnored)
    	maxpokes-=1
    	if (pokerID ~= haspoked[pokerID]) then --Checks if there's a "record" of the poker
    			haspoked[pokerID] = pokerID --Creates a record
    			count[pokerID] = 1 --Sets his poke count to one
    			poketime[pokerID] = os.time() --Records the time of first poke
    			if (doreply == "y") then
    				ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, recmsg, pokerID) --Send message back.
    			end
    	elseif(pokerID == haspoked[pokerID])then --If there is a record already
    		  if (count[pokerID] >= maxpokes and os.difftime(poketime[pokerID],os.time()) <= maxtime) then --If the poker has poked over -maxpokes- times under maxtime interval.
    			  ts3.requestClientKickFromServer(serverConnectionHandlerID,pokerID, kickmsg) --Kick poker with message.
    			  poketime[pokerID] = os.time() --Reset timer.
    			else
    				if(os.difftime(poketime[pokerID],os.time()) > maxtime) then --If the interval between pokes is greater than maxtime.
    					poketime[pokerID] = os.time --Reset timer.
    				end
    				if (doreply == "y")then
    				  ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, recmsg, pokerID) --Sends message.
    				end
    				count[pokerID] = count[pokerID]+1 --Increments poke count for the user.
    	  	end
    	end
    end
    local registeredEvents = {
    	onClientPokeEvent = onClientPokeEvent
    }
    ts3RegisterModule("AutoReply", registeredEvents)
    However, the person that posted this said that it was incomplete/obsolete. I thought this would work but after some testing, I got nothing.

  2. #2
    Join Date
    May 2011
    Location
    Antartica
    Posts
    31
    Hope this is what your looking for
    create folder in lua_plugins called "autopm", add files below

    init.lua
    Code:
    require("ts3init")            -- Required for ts3RegisterModule
    require("autopm/events")
    require("autopm/autopm")
    
    local MODULE_NAME = "AutoPM"
    
    local registeredEvents = {
    	onClientPokeEvent  = pm_events.onClientPokeEvent,
    }
    
    ts3RegisterModule(MODULE_NAME, registeredEvents)
    events.lua
    Code:
    local function onClientPokeEvent(serverConnectionHandlerID, pokerID, pokerName, message, ffIgnored)
        apmPokeEvent(serverConnectionHandlerID, pokerID, pokerName, message)
        return 0
    end
    
    pm_events = {
      onClientPokeEvent = onClientPokeEvent
    }
    autopm.lua
    Code:
    -- Message to respond back with
    -- %n = Poker Name
    local response = "Hello %n, I am currently busy and will be with you shortly"
    -- 0 = pm, 1 = poke
    local type = 1
    
    -------------------------------------------------------------------------------
    ------------          IGNORE BELOW                             ----------------
    -------------------------------------------------------------------------------
    
    function apmPokeEvent(serverConnectionHandlerID, pokerID, pokerName, message)
    
      if string.find(response, "%%n") then
        response = response:gsub("%%n", pokerName)
      end
    
      if type == 0 then
        ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, response, pokerID)
      elseif type >= 1 then
        ts3.requestClientPoke(serverConnectionHandlerID, pokerID, response)
      end
    end

  3. #3
    Join Date
    January 2010
    Location
    Phoenix, AZ
    Posts
    99
    Look ar pmwatch.

    You could remove the ability of users to poke you and just let them pm you.

    pmwatch plays a different sound to let you know it's a pm instead of a message in the current channel.

    I made it because I had many people pm'ing me and they would scroll off the side where I couldn't see them.

    It also consolidates the poke messages into a single text tab.

  4. #4
    Join Date
    January 2016
    Posts
    2

    Poke

    How can i sed automaticaly one message to anyone who send me a poke?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 65
    Last Post: November 26th, 2017, 01:39 PM
  2. already possible: Feature Request: Save pokes to client log
    By MoleMan in forum Suggestions and Feedback
    Replies: 4
    Last Post: November 16th, 2013, 09:53 PM
  3. [request] Scripts, that kicks an user, when he pokes me
    By Creativeee in forum Client Plugins / Lua Scripts
    Replies: 3
    Last Post: March 17th, 2011, 07:07 PM

Tags for this Thread

Posting Permissions

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