Author Topic: Mc scanner  (Read 10451 times)

0 Members and 1 Guest are viewing this topic.

Offline Kastor

  • Junior Member
  • **
  • Posts: 21
  • Karma: +0/-0
Mc scanner
« on: 27 January, 2007, 20:15:08 »
hi all  ;D

excused I would have need of a script similar to the "mc scanner" that it has ynhub,I have seen a script similar to this in the forum , but when one of the staff (or admin) says a "word forbidden" in main, the word comes changed . I want that the "words forbidden"  only forbidden from the op (comprised) to the categories low . It is possible?
thanks so much!

PtokaX forum

Mc scanner
« on: 27 January, 2007, 20:15:08 »

Offline Kastor

  • Junior Member
  • **
  • Posts: 21
  • Karma: +0/-0
Re: Mc scanner
« Reply #1 on: 27 January, 2007, 21:59:22 »
I have this script , but the forbidden words are extended to all the categories: admin, mod, op, etc. I would want that the categories under the op cannot say the forbitten words(for example : ["fuck"]= "***** ",), but over the op yes.(for example : ["fuck"]= "fuck ")

the scrit about which I speak it is following:



Code: [Select]
-- PtokaX Lua 5 version by PPK

-- Naruto www.narutodc.tk
-- Body by plop thx to him

-- This script stops the ***** words :) It has some words saved..
-- Plz if you know new words plz add them or go to my homepage and tell me..
-- Languages:  English
--             Frensh
--             Luxembourgois
--             Portuges
--             German
--             Italian
--             Swedish
--             Norsk
-- Version 1.0


---------------------------------------------------------------------------------------------

---- filter what? use 1 to enable, nil to disable the filter.
FilterPm = 1
FilterMain = 1

---- the words to be replaced and by what.
tBadWords = {
   ["fuck"]= "",
   ["Bitch"] = "",
   ["fuck you"] = "",
   ["motherfucker"] = "",
   ["fuck you all"] = "",
   ["fucking"] = "",
   ["pussy"] = "",
   ["suck"] = "",
   ["sucks"] = "",
   ["suckz"] = "",
   ["blow"] = "",
   ["fucker"] = "",
   ["shit"] = "",
   ["ass"] = "",
   ["mother fucker"] = "",
   ["cock sucker"] = "",
   ["stupid fucker"] = "",
   ["I   hate t  his    hu b"] = "",
   ["this hub sucks"] = "",
   ["this hub blows"] = "",
   ["suck my dick"] = "",
   ["stupid whore"] = "",
   ["fagget"] = "",
   ["je te deteste"] = "",
   ["conard"] = "",
   ["connard"] = "",
   ["batard"] = "",
   ["conasse"] = "",
   ["va te faire foutre"] = "",
   ["va te faire enculer"] = "",
   ["enculer"] = "",
   ["pute"] = "",
   ["PD"] = "",
   ["fils de pute"] = "",
   ["salopar"] = "",
   ["salop"] = "",
   ["salot"] = "",
   ["salo"] = "",
   ["filhu da puta"] = "",
   ["puta"] = "",
   ["puta qua pariu"] = "",
   ["vai a tua main filhu da puta"] = "",
   ["tu es un grand idiota"] = "",
   ["tu es un grande idiota"] = "",
   ["filu da puta"] = "",
   ["vai a merda"] = "",
   ["idiota de merda"] = "",
   ["tu es uma grande merda"] = "",
   ["arschgesit"] = "",
   ["arshgesit"] = "",
   ["allen penner"] = "",
   ["du arsch"] = "",
   ["du arsh"] = "",
   ["du bas en vixxer"] = "",
   ["vixer"] = "",
   ["vixxer"] = "",
   ["dier gid mer all op den sack"] = "",
   ["arschloch"] = "",
   ["arshloch"] = "",
   ["alter sack"] = "",
   ["du bist eine hure"] = "",
   ["hure"] = "",
   ["alter penner"] = "",
   ["wixer"] = "",
   ["wixxer"] = "",
   ["arschgesicht"] = "",
   ["arshgesicht"] = "",
   ["puff"] = "",
   ["puffmama"] = "",
   ["pufmama"] = "",
   ["schlampe"] = "",
   ["alte schlampe"] = "",
   ["fanculo"] = "",
   ["stronzo"] = "",
   ["merda"] = "",
   ["cazzo"] = "",
   ["troia"] = "",
   ["puttana"] = "adsadsd",
   ["coglione"] = "",
   ["Knulla din mamma"] = "",
   ["fitte"] = "",
   ["suge"] = "",
   ["r?v"] = "",
   ["vill du g?ra e i min r?v!"] = "",
   ["Knulla"] = "",
   




   
}

---- the words to be replaced and by what (function mode).
tBadFuncs = {
   -- replace lol with a random amount of o's
   ["lol"] = function()
      local i = math.random(1,20)
      return "L"..(string.rep("o", i)).."L"
   end
}

-- prefixes table, allowed for me and let commands bypase the replacer
tPre = { ["+"] = 1, ["!"] = 1, ["/"] = 1, ["-"]=1 }

function Main()
   local num = string.gsub(os.date(), "%D", "")
   math.randomseed(tonumber(num))
end

function CheckWord(word)
   local wordl = string.lower(word)
   if tBadWords[wordl] then
      return tBadWords[wordl]
   elseif tBadFuncs[wordl] then
      return tBadFuncs[wordl]()
   else
      return word
   end
end

function ChatArrival(user, data)
   if FilterMain then
      local s,e,data =string.find(string.sub(data, 1, (string.len(data)-1)), "%b<>%s+(.*)")
      local data,c = string.gsub(data , "(%w+)", function(word) return CheckWord(word) end)
      local s,e,pre, cmd = string.find(data, "^%s*(%W)(%S+)")
      if c ~= 0 then
         if pre and tPre[pre] then
            if cmd == "me" then
               SendToAll("* "..user.sName.." "..string.sub(data, 5, string.len(data)).."|")
               return 1
            else
               return 0
            end
         else
            SendToAll(user.sName, data.."|")
            return 1
         end
      end
   end
end

function ToArrival(user, data)
   if FilterPm then
      local s,e,whoto = string.find(data, "%S+%s*(%S+)")
      local s,e,data = string.find(strsub(data, 1, (string.len(data)-1)), "$%b<>%s*(.*)$")
      local data,c=string.gsub(data , "(%S+)", function(word) return CheckWord(word) end)
      if c ~= 0 then
         SendPmToNick(whoto, user.sName, data.."|")
         return 1
      end
   end
end
« Last Edit: 27 January, 2007, 22:06:12 by bastya_elvtars »

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #2 on: 09 February, 2007, 17:23:34 »
Hi!

I am looking for a similar script, but I want to replace words with another word.

Example:

[1.0]Nicko Hello hubbers

is changed to

[1.0]Nicko Hello folks

I want to have the possibillity to add the words trough Rightclick.

Some kind of a joke scripte, replace words :)
Regards,

BrotherBear

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
Re: Mc scanner
« Reply #3 on: 09 February, 2007, 18:50:58 »
Hi!

I am looking for a similar script, but I want to replace words with another word.

Example:

[1.0]Nicko Hello hubbers

is changed to

[1.0]Nicko Hello folks

I want to have the possibillity to add the words trough Rightclick.

Some kind of a joke scripte, replace words :)


you need the script Kastor posted, or download my original wordreplacer from the script database.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #4 on: 09 February, 2007, 21:07:01 »
Oops sorry, didn't se that I should write something between " "   hehe

But when I want to repleace words with ??? (Swedish characters)
nothing happens :(

Thanks for this simple but very useful script :)
Regards,

BrotherBear

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
Re: Mc scanner
« Reply #5 on: 09 February, 2007, 22:25:23 »
Oops sorry, didn't se that I should write something between " "   hehe

But when I want to repleace words with ??? (Swedish characters)
nothing happens :(

Thanks for this simple but very useful script :)

can you check if it works in pm.
if so replace this line on ChatArrival
Code: [Select]
      local data,c = string.gsub(data , "(%w+)", function(word) return CheckWord(word) end)for
Code: [Select]
      local data,c = string.gsub(data , "(%S+)", function(word) return CheckWord(word) end)
plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 744
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Mc scanner
« Reply #6 on: 09 February, 2007, 22:26:45 »
os.setlocale()?
Everything could have been anything else and it would have just as much meaning.

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #7 on: 10 February, 2007, 09:26:50 »
Thanks plop, it worked in Main but not in PM :)

Does not work in PM at all :(

I'll get this error --> MCScanner.lua:98: attempt to call global 'strsub' (a nil value)
When I test the words in PM


What do you mean bastya_elvtars with

os.setlocale()?
« Last Edit: 10 February, 2007, 11:06:33 by BrotherBear »
Regards,

BrotherBear

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 744
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Mc scanner
« Reply #8 on: 10 February, 2007, 12:09:37 »
Thanks plop, it worked in Main but not in PM :)

Does not work in PM at all :(

I'll get this error --> MCScanner.lua:98: attempt to call global 'strsub' (a nil value)

Replace strsub with string.sub.

What do you mean bastya_elvtars with

os.setlocale()?

That's a way to set up what characters count as letters in lua. It was a suggestion for plop.
Everything could have been anything else and it would have just as much meaning.

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #9 on: 24 February, 2007, 17:30:14 »
Ahh, thanks bastya_elvtars :)

Oki, let's see what Plop do ;)
Hi again :)

Is it possible to get the scanner replace words like this:

h mm
h m m

Words with spaces?
Pleeeeeeeeeeeeeease Anyone ?
Regards,

BrotherBear

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 744
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Mc scanner
« Reply #10 on: 24 February, 2007, 17:37:29 »
Yes, put %s+ where you expect spaces.
Everything could have been anything else and it would have just as much meaning.

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 744
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Mc scanner
« Reply #11 on: 24 February, 2007, 18:00:23 »
%s*, should serve you a little better.

Indeed. That also matches if there aren't spaces.
Everything could have been anything else and it would have just as much meaning.

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #12 on: 24 February, 2007, 18:45:18 »
Thanks Guys, I don't get it to work :(

Is this right?

tBadWords = {
   ["h%s*mm,"]= "Halleluja",
   ["h%s*m%s*m,"]= "What !!!",
}

Regards,

BrotherBear

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 744
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Mc scanner
« Reply #13 on: 24 February, 2007, 18:48:37 »
Yeah, that's it.
(Sidenote: why do we have to force characterclass-based matching in chatlines? :-/)
Everything could have been anything else and it would have just as much meaning.

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #14 on: 24 February, 2007, 18:59:29 »
OK

Is it not anything that would be added here:

---- the words to be replaced and by what (function mode).
tBadFuncs = {
   -- replace lol with a random amount of o's
   ["lol"] = function()
      local i = math.random(1,20)
      return "L"..(string.rep("o", i)).."L"
   end
}

Or could it be something with I am using 5.1.1 Lua ?
Regards,

BrotherBear

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #15 on: 24 February, 2007, 19:10:12 »
Nope, no errors
Regards,

BrotherBear

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #16 on: 24 February, 2007, 19:20:26 »
Here you are :)

Code: [Select]
-- PtokaX Lua 5 version by PPK

-- Naruto www.narutodc.tk
-- Body by plop thx to him

-- This script stops the ***** words :) It has some words saved..
-- Plz if you know new words plz add them or go to my homepage and tell me..
-- Languages:  English
--             Frensh
--             Luxembourgois
--             Portuges
--             German
--             Italian
--             Swedish
--             Norsk
-- Version 1.0


---------------------------------------------------------------------------------------------

---- filter what? use 1 to enable, nil to disable the filter.
FilterPm = 1
FilterMain = 1

---- the words to be replaced and by what.
tBadWords = {
   ["hmm"]= "Fundilerar",
   ["hmmm"]= "Vad var det d?r d? ?",
   ["hm"]= "Hennes & Mauritz",
   ["hm,"]= "haha, den gick jag  eh..  p? :)",
   ["hmm,"]= "Halleluja",
   ["h%s*m%s*m,"]= "N?h? inte det :(",
   ["h%s*mm,"]= "Inte h?r heller :(",
   ["fan"]= "*SWORDOM*",
   ["faan"]= "*SWORDOM*",
   ["faaan"]= "*SWORDOM*",
   ["faaaan"]= "*SWORDOM*",
   ["j?vlar"]= "*SWORDOM*",
   ["j?vla"]= "*SWORDOM*",
   ["helvete"]= "*SWORDOM*",
   ["helvetes"]= "*SWORDOM*",
   ["j?sses"] = "g?sses",
   ["idiot"] = "ingen d?lig intelligens och tanke",
   ["hoho"] = "Jag andas...d?rf?r finns jag, eller? *k?nner mig ensam*",
   ["shit"] = "e n?dig :( ",
   ["ass"] = "En sak med skinkor",
   ["troia"] = "F?rvirrad Full H?st !!!",
   ["r?v"] = "e n?t man bajsar med",
   ["slot"] = "`I'm a slotbegger, yes I am?",
   ["ladda"] = "`Jag ?r en liten leecher, hihi?",
   ["msn"] = "MDN",
   ["h?h?"] = "Gn?ggGn?gg",
   ["hello"] = "Zippedi doh dah",
   ["tjena"] = "Boomshackalack",
   ["brb"] = "Be Right Back at Ya :)",
   ["bbl"] = "Be Back Later Dudes :)",
   ["s?k"] = "Anv?nd CTRL + S :)",
}

---- the words to be replaced and by what (function mode).
tBadFuncs = {
   -- replace lol with a random amount of o's
   ["lol"] = function()
      local i = math.random(1,20)
      return "L"..(string.rep("o", i)).."L"
   end
}

-- prefixes table, allowed for me and let commands bypase the replacer
tPre = { ["+"] = 1, ["!"] = 1, ["/"] = 1, ["-"]=1 }

function Main()
   local num = string.gsub(os.date(), "%D", "")
   math.randomseed(tonumber(num))
end

function CheckWord(word)
   local wordl = string.lower(word)
   if tBadWords[wordl] then
      return tBadWords[wordl]
   elseif tBadFuncs[wordl] then
      return tBadFuncs[wordl]()
   else
      return word
   end
end

function ChatArrival(user, data)
   if FilterMain then
      local s,e,data =string.find(string.sub(data, 1, (string.len(data)-1)), "%b<>%s+(.*)")
      local data,c = string.gsub(data , "(%S+)", function(word) return CheckWord(word) end)
      local s,e,pre, cmd = string.find(data, "^%s*(%W)(%S+)")
      if c ~= 0 then
         if pre and tPre[pre] then
            if cmd == "me" then
               SendToAll("* "..user.sName.." "..string.sub(data, 5, string.len(data)).."|")
               return 1
            else
               return 0
            end
         else
            SendToAll(user.sName, data.."|")
            return 1
         end
      end
   end
end

function ToArrival(user, data)
   if FilterPm then
      local s,e,whoto = string.find(data, "%S+%s*(%S+)")
      local s,e,data =string.find(string.sub(data, 1, (string.len(data)-1)), "%b<>%s+(.*)")
      local data,c=string.gsub(data , "(%S+)", function(word) return CheckWord(word) end)
      if c ~= 0 then
         SendPmToNick(whoto, user.sName, data.."|")
         return 1
      end
   end
end

Thanks Mutor :)
Regards,

BrotherBear

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #17 on: 24 February, 2007, 22:24:16 »
That would be very apritiated, Mutor :)

Thanks alot!
Regards,

BrotherBear

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #18 on: 25 February, 2007, 12:14:26 »
Thank You Very Much Mutor :)

It works great :D

Do you have a place that explain these:

$
%s*
%s+
etc..

Thanks again Mutor, I will let you know how it works out :)
Regards,

BrotherBear

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 744
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Mc scanner
« Reply #19 on: 25 February, 2007, 13:36:38 »
Everything could have been anything else and it would have just as much meaning.

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: Mc scanner
« Reply #20 on: 03 March, 2007, 22:10:30 »
Thanks bastya :)
Mutor, after sometime the script get wierd!

Some of the words does not work and when I paste an ASCII pic it looks like this:

                     O       O       O       O       O       O        O       O                    ? ? ? ?  ?   ?   ????    ????    ????     ????    ????    ????     ????    ????   ?       ??  ??  ?       ? ?    ?    ?  ?    ?  ?    ?   ?    ?  ?    ?  ?    ?   ?    ?  ?    ?  ?       ??  ??  ? ? ? ?  ??     ??????  ??????  ??????   ??????  ??????  ??????   ??????  ??????  ?       ??  ??       ?  ? ?    ?    ?  ?    ?  ?    ?   ?    ?  ?    ?  ?    ?   ?    ?  ?    ?  ?  ? ? ? ?  ?   ?  ?    ?  ?    ?  ?    ?   ?    ?  ?    ?  ?    ?   ?    ?  ?    ?  ?????   ??  ??

Instead of this:

   
                                 O             O              O              O             O             O               O             O 
                                 
? ? ? ?    ?     ?      ????        ????        ????         ????        ????        ????         ????        ????      ?              ??    ?? 
?             ?  ?       ?        ?    ?        ?    ?        ?     ?        ?    ?        ?    ?        ?     ?        ?    ?        ?    ?              ??    ?? 
? ? ? ?    ??         ??????    ??????    ??????     ??????    ??????    ??????     ??????    ??????    ?              ??    ?? 
         ?    ?  ?       ?        ?    ?        ?    ?        ?     ?        ?    ?        ?    ?        ?     ?        ?    ?        ?    ? 
? ? ? ?    ?     ?    ?        ?    ?        ?    ?        ?     ?        ?    ?        ?    ?        ?     ?        ?    ?        ?    ?????      ??    ??     

Do you know what could be wrong?

Running Ptokax 0.3.5.2f and these scripts:

- [ 1 ]  ChatStatsv3.lua
- [ 1 ]  Lucifer6.6.6-build2.133.lua
- [ 1 ]  LV_3.lua
- [ 1 ]  chatrooms.v4.12.lua
- [ 1 ]  NoPub.lua
- [ 1 ]  MCScanner.lua
- [ 1 ]  Request.lua
- [ 1 ]  Release.lua
- [ 1 ]  BirthdayMan.v4.07.lua
- [ 1 ]  Ascii.lua
- [ 1 ]  Infos.lua

Disabled the McScanner.lua (your script) and the ASCII worked.
Regards,

BrotherBear

PtokaX forum

Re: Mc scanner
« Reply #20 on: 03 March, 2007, 22:10:30 »