-- Deny party whisper -- -- v0.1 -- local denyReply,_time local ResponseTable = {} local partyTexts ={} local DenyResponseTable = {} local partyInvite = false function Set (list) local set = {} for _, l in ipairs(list) do set[l] = true end return set end function denyPartyWhisper() partyTexts = Set {"invite","mems","pt","party","join","space","inv"} --If someone wants to party you this are the possible responds DenyResponseTable = { [1] = "Sorry, party is full atm", [2] = "Im trying something, maybe later", [3] = "when there is space ill let you know", [4] = "Just getting a few mems then im off", [5] = "sry m8, no spot free", [6] = "i wil invite you when there is a spot", } --If you get whisperd and the text isnt for party ResponseTable = { [1] = "Busy atm", [2] = "Sry i dont have time", [3] = "Can you whisper me later again, im busy atm", [4] = "Testing some stuff ill /w back in a few", } repeat local time, moreToCome, name, msg = EventMonitorCheck("denyPartyWhisper", "4,1") if msg ~= nil and name ~= "Newbie Pet" then -- make sure something was returned yrest(1000) for word in string.gmatch(msg, "%a+") do if partyTexts[word] then partyInvite = true break else partyInvite = false end end if partyInvite == true then --Text matched one of the words in the party table guesing they would like to join youre party printf("\nYou have been whispered by: " ..name.. " for a party invite\n") denyReply = DenyResponseTable[math.random(#DenyResponseTable)] sendMacro("SendChatMessage(\'"..denyReply.."\', 'WHISPER', 0, \'"..name.."\');"); else printf("\nYou have been whispered by: " ..name.. "\n") denyReply = ResponseTable[math.random(#ResponseTable)] sendMacro("SendChatMessage(\'"..denyReply.."\', 'WHISPER', 0, \'"..name.."\');"); end end until moreToCome == false end function startDenyPartyWhisper() unregisterTimer("denyPartyWhisper"); printf("Deny party whisper started\n"); EventMonitorStart("denyPartyWhisper", "CHAT_MSG_WHISPER"); registerTimer("denyPartyWhisper", secondsToTimer(5), denyPartyWhisper); end