PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: Dessamator on 24 April, 2005, 20:44:11

Title: anti-"SHOUT" script
Post by: Dessamator on 24 April, 2005, 20:44:11
-- added gaguser check
--LUA 5 VERSION , by Dessamator
-- anti-shout script
-- not perfect, only detects 2+ words to minimize bugs
-- replaces uppercase with lowercase only if whole text is uppercase
-- added non-english char table, it counts only when things are needed 2 replace
-- if both words consist of non-standard chars only, it ignores (in Hungarian, its quite impossible)
-- consumes resources, use with caution
-- NB: made for hungarian and english language, but supports german IMHO (i dont speak german) - feel free to modify the table
-- bastya_elvtars (the rock n' roll doctor)Bot="-Silence-"
Bot=frmHub:GetHubBotName()  
gaguser=true --change if u want to allow the shouter to send his msg, in lower case, (added by Dessamator)
nonstandard={["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?"
}
-- checks data
function ChatArrival(user,data)
local _,_,text = string.find(data, "^%b<>%s+(.*)|")
engletters=string.gsub(text, "%A","")
if string.find(engletters,"(%a+)") then
if string.upper(engletters)==engletters then
if gaguser then
user:SendData(Bot,"Hmm hmm... "..user.sName.." better not shout...;)")
return 1
else
attenuate(user,text)
return 1
end
end
end
end
-- find out what this does ^^
function attenuate(user,text)
text=string.lower(text)
for a,b in nonstandard do
text=string.gsub(text,a,b)
end
SendToAll("<"..user.sName.."> "..text)
end
Title:
Post by: bastya_elvtars on 24 April, 2005, 22:44:30
assert(os.setlocale(hu),"Bad locale!") -- does not seem 2 have influence :-/
This has to be omitted, or commented, as it will crash PtokaX and kills all other scripts.
Title:
Post by: Dessamator on 24 April, 2005, 23:35:38
yes sir!!,
done!
Title:
Post by: Dessamator on 24 April, 2005, 23:51:09
         
-- added maxchar(upper case letters)
-- added gaguser check
--LUA 5 VERSION , by Dessamator
-- anti-shout
-- not perfect, only detects 2+ words to minimize bugs
-- replaces uppercase with lowercase only if whole text is uppercase
-- added non-english char table, it counts only when things are needed 2 replace
-- if both words consist of non-standard chars only, it ignores (in Hungarian, its quite impossible)
-- consumes resources, use with caution
-- NB: made for hungarian and english language, but supports german IMHO (i dont speak german) - feel free to modify the table
-- bastya_elvtars (the rock n' roll doctor)

-----------------------
Bot=frmHub:GetHubBotName()  
gaguser=true --change if u want to allow the shouter to send his msg, in lower case, (added by Dessamator)
maxchar=5 -- write the max number of characters u want to allow users to type b4 the script "silencer bot" acts
---------------------------------

nonstandard={["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?"
}

-- checks data
function ChatArrival(user,data)
local found
local _,_,text = string.find(data, "^%b<>%s+(.*)|")
engletters=string.gsub(text, "%A","")

if string.find(engletters,"(%a+)") then
for s=0,string.len(engletters) do
local letter=string.sub(engletters,s,s)
if string.upper(letter)==letter and found then
found=found+1
else
found=0
end
end
if string.upper(engletters)==engletters and found>maxchar and gaguser then
user:SendData(Bot,"Hmm hmm... "..user.sName.." better not shout...;)")
return 1
elseif not(gaguser) then
attenuate(user,text)
return 1

end
end
end
-- find out what this does ^^
function attenuate(user,text)
text=string.lower(text)
for a,b in nonstandard do
text=string.gsub(text,a,b)
end
SendToAll("<"..user.sName.."> "..text)
end
Title:
Post by: kunal on 21 August, 2005, 11:22:27
can u put a cmd to toggle it on and off
Title:
Post by: Dessamator on 21 August, 2005, 14:29:25
!stopscript scriptname
Title:
Post by: kunal on 21 August, 2005, 16:01:18
thats what i tried but i m using terminator and the !stopscript cmd doesnt seem to work with it
Title:
Post by: kunal on 22 August, 2005, 18:21:21
now can i expect the on off cmd
Title:
Post by: bastya_elvtars on 22 August, 2005, 19:13:31
QuoteOriginally posted by kunal
now can i expect the on off cmd

!stopscript is a PtokaX command. If it does not work, there must be serious problems.
Title:
Post by: kunal on 23 August, 2005, 14:25:02
no ptokax inbuilt cmds are there when i use terminator
when i type !help this menu comes

['?RM???']['?R COMMANDS ( Ops / Masters )

Show Commands         !Help         

Lotto:-

   help         !lotto help
   Lucky Dip      !lotto ld
   Termy Predicted Numbers   !lotto predict
   Ball Stat         !lotto ball [Ball Number ( 1 - 49 )]
   Add A Draw stat      !lotto add ( use Right Click Menu )


Matrix Text:-

   !matrixon
   !matrixoff


Hangman:-

   Start         -hmstart
   Stop         -hmstop
   Scores         -scores


Trivia:-

   Start Triv         -trivstart
   Start Numbers Game   -numstart
   Stop Triv/Numbers      -trivstop
   Scores         -scores
   Add A Question      -aq [Question]*[Answer]
   Show Questions      !sq
   Show Question files   -qfiles
   Change Question File   -trivquestionfile [Question File]
   Default Question File   -trivquestionfile default


Anagrams:-

   Start         -anstart
   Stop         -anstop
   Display Available Word Files   !anfiles
   Choose Word File      !anwordfile [Word File]
   Default Word File      !anwordfile default
   Scores         -scores


War Games:-

   Start         !startwargame
   Force Start      !forcestart
   Stop         !stopwargame
   Join         !joingame
   Watch Game      !watchgame
   Leave Game      !leavegame
   FIRE         !f [nick]
   RE-LOAD         !r
   HIDE         !h
   Show Players      !l
   Help         !w
   Results         !results
   Session         !session


Tic-Tac-Toe:-

   Invite To Play      invite [nick] [BotName]
   Help         help [BotName]


FreshStuff:-

   !adds [THESTUFF]      Lets you add FreshStuff.
   !shows         Shows you the FreshStuff.
   !shows 20 40      Shows Item 20 - 40
   !shows [ITEMTYPE]   Shows you only certain ITEMTYPES
   !searchstuff [SearchString]   Searches the FreshItems for your String.
   !dels [ITEM]/[ITEMNR.]   Lets you delete an item.
   !topp         Shows you the topposters.
   !rate [ITEMNR.] [RATENR.]   Lets you rate good items.
   !showr         Shows you the toprated items.
   !showr [ITEM]      Shows you the rating of the item.
   !request [REQUEST]   Lets you add a request.
   !showrequest      shows you the requests.
   !showrequest 20 40      shows you request 20 - 40
   !delrequest [Name]/[Nr.]   Deletes a request.
   !freshhelp      Shows you this text again.


Nick Party:-

   NP#1 on         [trig set in gui] on
   NP#1 off         [trig set in gui] off
   NP#1 random      [trig set in gui] rnd
   NP#2 on         [trig set in gui] on
   NP#2 off         [trig set in gui] off
   NP#2 random      [trig set in gui] rnd


Silly Text:-

   Silly Text ON      ( User Right Click Menu )
   Silly Text OFF      !sillytext off


Reminder/Alarm:-

   Set a Private Reminder   !alarm [TIME Syntax  Hrs:Mins] [DATE Syntax  Month/Day/Year] [Message]
   Set a MASS Reminder   !alarmtoall [TIME Syntax  Hrs:Mins] [DATE Syntax  Month/Day/Year] [Message to Send]
   Show all alarm calls   !showalarms
   Delete an Alarm call   !delalarm [Alarm Number]


Clock:-

   Show Ascii Clock      !time


Joker:-

   Show Joke      !joke


Trigg Bot:-

   Show All Ascii Triggs   !trigs


Animalize:-

   Animalize User      ( Use the Right click Menu )
   UN-Animalize User       !unanimalize [nick]


Kenny / Mute:-

   Kenny User      !kenny [nick]
   Un Kenny User      !unkenny [nick]
   Clear all Kenny Users   !unkennyall
   Show Kenny'd Users   !showkenny
   Mute User      !mute [nick]
   Un Mute user      !unmute [nick]
   Clear All Mutes      !clearmutes
   Show Muted Users      !showmutes


Intro / Outro:-

   Set Custom intro      !sintro [Text]    insert to have it display your nick   command without text to remove.
   Set Custom outro      !soutro [Text]    insert to have it display your nick   command without text to remove.


Hub:-

   Main Chat History      !history
   View Hub Info      !hconfig
   View Chat Stats      !chstats
   Banner         !banner [message]
   Clear Main Chat      !cls
   Show Redirect list      !sredirect
   View Network      !network
   View Hub Rules      !rules
   View DC++ FAQ      !faq
   Mass Message users   !mass [message]
   Send Advert      !advert
   

Users And Kicking:-

   Gag User         !gag [nick]
   UnGag User      !ungag [nick]
   Follow Kicked Users   !watchkicks       Toggles On / Off  Send message when Kicked user returns
   Warn User      !warn [nick] [Reason]
   Timeban User      !timeban [nick] [bantime in mins] [reason]
   Kill Nick         !kill [nick] [Reason]
   Kick User         !kick [nick] [Reason]
   Kick ban User      !kickban [nick] [Reason]
   Disconnect User      !drop [nick]
   Nick ban         !nickban [nick]
   Ban IP         !banip [IP]
   Clone Add      !clone [User]
   Clone Remove      !rclone [User]
   Clone Allow List      !sclones
   User info         !info [nick]
   Brief User info      !userinfo [nick]   Online and Offline Users
   Whois IP         !whois [ip]    ( DISABLED )
   IP Info         !ipinfo [IP]   Online and Offline Users
   Kick Log         !getkicks
   Ban Log         !getbanlist
   Warn Log         !getwarn
   Top Kickers      !topkickers
   Reg Reg         !reguser [nick] [password]
   Reg Vip         !regvip [nick] [password]
   List Users      !showreg [profile]   profile = Master , op , VIP , REG.  Exclude Profile to list all
   Upgrade / Downgrade User   !upgrade [nick] [Profile]   profile = vip , reg
   Activate Redirect      !redirectpass [password]
   Redirect User      !red  [nick] [address] [Reason]
   Unban ip          !unban [IP]
   Unban Nick       !unban [nick]
   delete user      !delreg [nick]
   Leave offline Message     !message [User Name] [Message]
   Get My IP      !myip


Other Stuff / Maintenance:-

   Stealth ON      !stealthon
   Stealth OFF      !stealthoff
   check Bots Mem      !scriptmem
   Clear Temp Bans      !clrtemp
Title:
Post by: bastya_elvtars on 23 August, 2005, 14:28:38
If the !stopscript antishout.lua command does not work due to another bot, then blame the creator of that one, not us who created this script. Also run antishout as the very last script in PtokaX.
Title:
Post by: kunal on 23 August, 2005, 15:27:16
i was not blaming u
it was just a request
Title:
Post by: bastya_elvtars on 23 August, 2005, 15:32:38
QuoteOriginally posted by kunal
i was not blaming u
it was just and request

I just don't get why it won't work. What is the PtokaX version, and what is the filename?
Title:
Post by: kunal on 23 August, 2005, 15:39:02
ptokax version 0.3.3.0 build 17.08
which filename are u talking bout
Title:
Post by: bastya_elvtars on 23 August, 2005, 15:50:30
QuoteOriginally posted by kunal
ptokax version 0.3.3.0 build 17.08

LOL you are using a pretty old PtokaX. Download the latest one, otherwise this won't work.
Title: russian language
Post by: front242 on 16 October, 2005, 13:37:33
this script don't work in russian language  ;(
i added all russian alphabet to non standart characters:

nonstandard={["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?",
["?"]="?"
}


but script work only with english letters  ;(
help plz