Özele Mesaj Filtresi
;{================================================ =================}
; Yardiff's Private Message Filter v1.1
;{================================================ =================}
;{-----------------------------------------------------------------}
; aliases for the configuration file
;{-----------------------------------------------------------------}
; alias to set the config information
alias -l setconfig writeini $scriptdirfilter.cfg filter $1 $2-
; alias to get the config information
alias -l getconfig return $readini $scriptdirfilter.cfg filter $1
;{-----------------------------------------------------------------}
; menu and nicklist stuff
;{-----------------------------------------------------------------}
menu Nicklist {
User Levels
.Add Level:guser -a $$?="What level?" $$1 3
.Display Info:echo 4 -a $$1 $+ 's address is $address($$1,3)
.Remove Level:ruser $$1 3
.-
.Remove Ignore:ignore -r $$1 3
}
menu Menubar {
Private Filter
.Filter is $group(#V.Filter)
..On:.enable #V.Filter
..-
..Off:.disable #V.Filter
.Settings
..Set Message:setconfig message $$?="Your Message:"
..Ignore Time:setconfig ignore $$?="Ignore (seconds):"
}
menu @V.Status {
dclick:/clear @V.Status
C&lear:/clear @V.Status
&Close:/window -c @V.Status
}
;{-----------------------------------------------------------------}
; Status Message Handler
;{-----------------------------------------------------------------}
alias V.LogStatus {
; check if the window has not been created
if ($window(@V.Status) == $null) {
; create it
window -n @V.Status 196 69 478 150 @V.Status
}
; echo the parameters directly to the window and write them to file
echo @V.Status $timestamp $+ : $1-
write V-Personal.log $timestamp $+ : $1-
}
alias -l V.StatusStuff {
; check if the window has not been created
if ($window(@V.Status) == $null) {
; create it
window -n @V.Status 196 69 478 150 @V.Status
}
; echo the parameters directly to the window
echo @V.Status $timestamp $+ : $1-
}
;{-----------------------------------------------------------------}
; aliases for the filter
;{-----------------------------------------------------------------}
; alias to send a message and ignore the nick for a time
alias -l V.MyMessage {
; send the message
msg $nick $getconfig(message)
; ignore them for a time
ignore -pntiku $+ $getconfig(ignore) $nick 3
}
; alias to check if someone is opped, voiced, or a helper
alias -l CheckOVH {
; check if the nick is op/voice/helper on one of the common channels
var %V.LoopChans 0
:V.NextChan
inc %V.LoopChans
if (($1 isop $comchan($1,%V.LoopChans)) || ($1 isvo $comchan($1,%V.LoopChans)) || ($1 ishelp $comchan($1,%V.LoopChans))) {
; return true
return $true
}
; if loop (ie haven't done all the channels yet
if (%V.LoopChans < $comchan($1,0)) goto V.NextChan
; return false
return $false
}
#V.Filter on
; Filter private actions
on ^1:action:*{
; check if we have a chat or a query for the nick
if (($chat($nick) != $null) || ($query($nick) != $null)) goto V.Skipcheck
; check if the nick's user-level is approved, or they are op/voice/help...
if (($ulevel > 1) || ($CheckOVH($nick) == $true) || ($server isin $target)) {
; echo the action to the status window
V.LogStatus $+ $colour(action text) $+ * $nick $1-
; and end the default action
halt
}
; ignore them for 2 minutes and send a message
V.MyMessage $nick
; echo a message informing you to the status window and halt
V.StatusStuff 4: $+ $nick $+ : tried to send a private action
halt
; label, for skipping the entire process...
:V.Skipcheck
}
; Filter private notices
on ^1:NOTICE:*:*:{
; check if the nick's user-level is approved, or they are op/voice/help...
if (($ulevel > 1) || ($CheckOVH($nick) == $true) || ($server isin $target)) {
; check if we have a chat or query for the nick
if (($chat($nick) != $null) || ($query($nick) != $null)) {
; echo the notice to the query/chat window
echo $colour(notice text) $nick * $+ $nick $+ * $1-
}
else {
; echo the message to the status window
V.LogStatus $+ $colour(notice text) $+ * $+ $nick $+ * $1-
}
; halt the default notice
halt
}
; ignore them for 2 minutes and send a message
V.MyMessage $nick
; echo a message informing you to the status window and halt
V.StatusStuff 4: $+ $nick $+ : tried to send a notice
halt
}
; Filter private messages
on ^1:TEXT:*{
; check if we have a chat or a query for the nick
if (($chat($nick) != $null) || ($query($nick) != $null)) goto V.Skipcheck
; check if the nick's user-level is approved, or they are op/voice/help...
if (($ulevel > 1) || ($CheckOVH($nick) == $true) || ($server isin $target)) {
; echo the text to the status window and halt the default action
V.LogStatus < $+ $nick $+ > $1-
halt
}
; ignore them for 2 minutes and send a message
V.MyMessage $nick
; echo a message informing you to the status window and halt
V.StatusStuff 4: $+ $nick $+ : tried to send a private message
halt
; label, for skipping the entire process...
:V.Skipcheck
}
;{-----------------------------------------------------------------}
; Yardiff's private DCC filter
;{-----------------------------------------------------------------}
; Filter Query sessions
on ^1:OPEN:?:{
; check if the nick's user-level is approved, or they are op/voice/help...
if (($ulevel > 1) || ($CheckOVH($nick) == $true)) goto V.Skipcheck
; ignore them for 2 minutes and send a message
V.MyMessage $nick
; echo a message informing you to the status window and halt
V.StatusStuff 4: $+ $nick $+ : tried to query you
halt
; label, for skipping the entire process...
:V.Skipcheck
}
; Filter Chat sessions
on 1CCSERVER:Chat:{
; check if the nick's user-level is approved, or they are op/voice/help...
if (($ulevel > 1) || ($CheckOVH($nick) == $true)) goto V.Skipcheck
; ignore them for 2 minutes and send a message
V.MyMessage $nick
; echo a message informing you to the status window and halt
V.StatusStuff 4: $+ $nick $+ : tried to DCC chat you
halt
; label, for skipping the entire process...
:V.Skipcheck
}
; Filter send sessions
on 1CCSERVER:Send:{
; check if the nick's user-level is approved, or they are op/voice/help...
if (($ulevel > 1) || ($CheckOVH($nick) == $true)) goto V.Skipcheck
; ignore them for 2 minutes and send a message
V.MyMessage $nick
; echo a message informing you to the status window and halt
V.StatusStuff 4: $+ $nick $+ : tried to DCC send to you
halt
; label, for skipping the entire process...
:V.Skipcheck
}
#V.Filter end
;{-----------------------------------------------------------------}
; on load event
;{-----------------------------------------------------------------}
on 1:load:{
; display the initial welcome message
echo 2 -a Welcome to Yardiff's Private Message Filter (v1.1)
echo 2 -a This addon should work in mIRC v5.6 onwards - earlier versions will require some changes to the syntax (go for it, if you really want to)
; check if the filter.cfg file doesn't exist
if ($exists($scriptdirfilter.cfg) == $false) {
; create it and its default messages
setconfig message I don't accept private messages and stuff
setconfig ignore 120
}
}
----------------------------------
|