PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: kepp on 18 February, 2004, 18:54:20

Title: Mute :)
Post by: kepp on 18 February, 2004, 18:54:20
Idea from "Y-HUB Crap" :)

-- Mute Script v0.1
-- By Kepp
-- 04/02/18

sBot = "[MUTER]"

MUTE = {}

function DataArrival(user, data)
   if (strsub(data,1,1) == "<") then
   data=strsub(data,1,strlen(data)-1)
   s,e,cmd = strfind(data,"%b<>%s+(%S+)")
      if ((cmd=="+mute")) and user.bOperator then
         DoMute(user, data) return 1
         
      elseif ((cmd=="+unmute")) and user.bOperator then
         DoUnMute(user, data) return 1
      end
      if strsub(data,1,1) == "<" then
         if MUTE[user.sName] == 1 then return 1
         end
      end
   end
end

function DoMute(user, data)
local s,e,cmd,vic = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
local victim = GetItemByName(vic)
   if victim == nil then
      user:SendData(sBot,"User is not in the hub...")
   else
      if MUTE[victim.sName] == nil then
         MUTE[victim.sName] = 1
         SendToAll(sBot,"Tell me "..victim.sName..", How good is a phonecall if you're unable to speak? ;)")
      end
   end
end

function DoUnMute(user, data)
local s,e,cmd,vic = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
local victim = GetItemByName(vic)
   if victim == nil then
      user:SendData(sBot,"User is not in the hub...")
   else
      if MUTE[victim.sName] == 1 then
         MUTE[victim.sName] = nil;
         SendToAll(sBot, victim.sName.." Was umuted ;) ")
      end
   end
end
Title:
Post by: Skrollster on 19 February, 2004, 09:50:52
What about !gag ??
Title:
Post by: DorianG on 19 February, 2004, 12:35:28
What differences there are with the gag???
The only difference that I have noticed is that warns the user that he has stayed muted.  I think :)
Title:
Post by: kepp on 19 February, 2004, 12:41:42
well, this is more like a joke in my oppinion
Title:
Post by: Typhoon on 29 March, 2004, 00:54:57
joke or not i like it , and !gag can be bypassed with a reconnect to the hub and !me , but this muter works..
i made a update so the table get " flushed " on a timer ..  now set on 5 minutes  you'll get it ..



-- Mute Script v0.2
-- By Kepp
-- 04/02/18
-- added a timer function that clears the table // Typhoon? / Ratcom_Typhoon?
-- +mute
-- +unmute
-- works agaist reconnect and the use of !me

------------ things that can be changed

sBot = "[MUTER]"
ClockInterval = 5   -- clears table on specific minutes

----------- End

MUTE = {}
mins = 1000 * 60 * ClockInterval

function Main()
SetTimer(mins)
StartTimer()
end

function OnTimer()
clear()
end

function clear()
MUTE = nil
MUTE = {}
end

function DataArrival(user, data)
   if (strsub(data,1,1) == "<") then
   data=strsub(data,1,strlen(data)-1)
   s,e,cmd = strfind(data,"%b<>%s+(%S+)")
      if ((cmd=="+mute")) and user.bOperator then
         DoMute(user, data) return 1
         
      elseif ((cmd=="+unmute")) and user.bOperator then
         DoUnMute(user, data) return 1
      end
      if strsub(data,1,1) == "<" then
         if MUTE[user.sName] == 1 then return 1
         end
      end
   end
end

function DoMute(user, data)
local s,e,cmd,vic = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
local victim = GetItemByName(vic)
   if victim == nil then
      user:SendData(sBot,"User is not in the hub...")
   else
      if MUTE[victim.sName] == nil then
         MUTE[victim.sName] = 1
         SendToAll(sBot,"Tell me "..victim.sName..", How good is a phonecall if you're unable to speak? ;)")
      end
   end
end

function DoUnMute(user, data)
local s,e,cmd,vic = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
local victim = GetItemByName(vic)
   if victim == nil then
      user:SendData(sBot,"User is not in the hub...")
   else
      if MUTE[victim.sName] == 1 then
         MUTE[victim.sName] = nil;
         SendToAll(sBot, victim.sName.." Was umuted ;) ")
      end
   end
end

Title:
Post by: Typhoon on 29 March, 2004, 03:13:12
made a update , added +showmuted


-- Mute Script v0.3
-- By Kepp
-- 04/02/18
-- added a timer function that clears the table // Typhoon? / Ratcom_Typhoon?
-- +mute
-- +unmute
-- works agaist reconnect and the use of !me
-- +showmuted added by Typhoon? / Ratcom_Typhoon?
-- thx to kepp & plop  :-?

------------ things that can be changed

sBot = "[MUTER]"
ClockInterval = 5   -- clears table on specific minutes

----------- End

MUTE = {}
mins = 1000 * 60 * ClockInterval

function Main()
SetTimer(mins)
StartTimer()
end

function OnTimer()
clear()
end

function clear()
MUTE = nil
MUTE = {}
end

function DataArrival(user, data)
   if (strsub(data,1,1) == "<") then
  data=strsub(data,1,strlen(data)-1)
    s,e,cmd = strfind(data,"%b<>%s+(%S+)")
   end

      if cmd == "+mute" and user.bOperator then
  DoMute(user, data) return 1
         
elseif cmd == "+showmuted" and user.bOperator then
function MUTED()
local disp = ""
for index, value in MUTE do
local line = index
disp = disp.."\t ? "..line.."\r\n"
end
return disp
end
user:SendPM(sBot,"\r\n\r\n\t\t\t\t\t(? ?.??.->   These are the muted   <-.??.???)\r\n\r\n"..MUTED().."|")
return 1

      elseif cmd == "+unmute" and user.bOperator then
  DoUnMute(user, data) return 1
      end
      if strsub(data,1,1) == "<" then
         if MUTE[user.sName] == 1 then return 1
         end
      end
   end


function DoMute(user, data)
local s,e,cmd,vic = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
local victim = GetItemByName(vic)
   if victim == nil then
      user:SendData(sBot,"User is not in the hub...")
   else
      if MUTE[victim.sName] == nil then
         MUTE[victim.sName] = 1
         SendToAll(sBot,"Tell me "..victim.sName..", How good is a phonecall if you're unable to speak? ;)")
      end
   end
end

function DoUnMute(user, data)
local s,e,cmd,vic = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
local victim = GetItemByName(vic)
   if victim == nil then
      user:SendData(sBot,"User is not in the hub...")
   else
      if MUTE[victim.sName] == 1 then
         MUTE[victim.sName] = nil;
         SendToAll(sBot, victim.sName.." Was umuted ;) ")
      end
   end
end

Title:
Post by: bliskner on 25 May, 2004, 20:05:27
is this a ptokax server side script?
Title:
Post by: plop on 26 May, 2004, 01:03:11
QuoteOriginally posted by bliskner
is this a ptokax server side script?
yep

plop
Title:
Post by: Janhouse on 05 August, 2004, 23:02:35
In Yhub this mute script shows some crap text if you are saying something. But in ptokax it only gag user. No fun : (
Title:
Post by: Janhouse on 06 August, 2004, 00:32:21
Can somebody edit it? So it could work like in yhub. Whit that crap text.
Title:
Post by: Herodes on 06 August, 2004, 10:01:44
I think u are talking about kennylizing ....

try searching for kenny in the forum u'll find it ...
Title:
Post by: ARCHANGEL on 06 August, 2004, 14:16:32
Try the "funscript" by Solian, you can get it from Plops site, it gags and does the Kenny thing, it also makes a user drunk. Heres a link:

http://www.plop.nl/ptokaxbots/Solian.php
Title:
Post by: ??????Hawk?????? on 06 August, 2004, 17:34:32
heres another...

http://www.plop.nl/ptokaxbots/Hawk/kenny-mute.lua (http://www.plop.nl/ptokaxbots/Hawk/kenny-mute.lua)


??????Hawk??????