mIRC Home    About    Download    Register    News    Help

Print Thread
#10437 10/02/03 12:24 PM
Joined: Dec 2002
Posts: 28
B
bibadi Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Dec 2002
Posts: 28
I want if some one says # or #channel or something that the message will be blocked and the 1 who was trying to say it will be warned, if he says it twice in 1 minite a kick and trice in 1 minute a 1 minute ban
is this possible?
if answer is yes please make it:P
ty
regards


I'm.... LETHAL
#10438 10/02/03 01:29 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Am I right in assuming that if:
[*]someone says "#" or the current channel's name eg: "#Aubs" (or any other channel)
  • You warn them
[*]If they say it twice (2) within 1 minute
  • You warn them
  • you kick them
[*]if they say it 3 times in 1 minute
  • You warn them
  • You kick them
  • You ban them


If this is the case, I would think something like this *Should* work...
Code:
on @*:TEXT:*:#:{
  if ($1- iswm *#ChannelName*) {
    [color:green];If the text you supply is in the text spoken[/color]
    if ($eval($+(%Channel.,$address($nick,2)),3) == $null) {
      .echo $chan Warning $nick (1st Warning)
      [color:green];echo your channel window what is being done[/color]
      .notice $nick This is your First warning. Please refrain from saying #Channel in $chan $+ .
      [color:green];notice the person about the warning[/color]
      set -u60 $eval($+(%Channel.,$address($nick,2)),3) 1
      halt
    }
    if ($eval($+(%Channel.,$address($nick,2)),3) == 1) {
      .echo $chan Warning $nick (2nd Warning)
      [color:green];echo your channel window what is being done[/color]
      .notice $nick This is your Second warning. Please refrain from saying #Channel in $chan $+ .
      .notice $nick This time you will be kicked. Next time, I will perm ban you from $chan $+ .
      [color:green];notice the person about the warning[/color]
      .kick $chan $nick Second warning (Refrain from saying "#Channel" in $chan)
      [color:green];Kick the person...2nd warning[/color]
      set -u60 $eval($+(%Channel.,$address($nick,2)),3) 2
      halt
    }
    if ($eval($+(%Channel.,$address($nick,2)),3) == 2) {
      .echo $chan Warning $nick (3rd Warning - Bye Bye!)
      [color:green];echo your channel window what is being done[/color]
      .mode $chan -o+b $nick $address($nick,3)
      [color:green];deop and ban the person[/color]
      .ban -ru300 $chan $nick 3
      [color:green];Tells mIRC to remove the ban in 5minutes (300Seconds)[/color]
      .kick $chan $nick Third warning - Bye Bye! (Refrain from saying "#Channel" in $chan)
      [color:green];Kick the person...3rd warning[/color]
      .notice $nick Third warning. This time you have been banned. Good Bye!
      [color:green];notice the person about the warning[/color]
      set -u60 $eval($+(%Channel.,$address($nick,2)),3) 3
      halt
    }
  }
}


It does however reset the variable, so if they said "#Aubs" then 59 seconds later say it again, it resets it so loggs that they have said it twice in 60Secs. This can be changed, but IU couldn't be bothered, sorry!

Anyways, hope it helps I wrote it, and haven't checked it so someone will come back sna point out problems with it!!


Aubs.
cool

#10439 10/02/03 04:27 PM
Joined: Feb 2003
Posts: 32
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Feb 2003
Posts: 32
I think that
if ($1- iswm *#ChannelName*)
should be
if (*#* iswm $1-) or even if (*#ChannelName* iswm $1-) (for only one chan)

But the best code for me to check if someone advertises a channel is to "analyze" if # character is the first char of a word.
ex. if someone writes *^&*&*#(*^(^, he doesn't try to advertise a channel smile . So with tokens identifiers split the $1- in words and check the word that has the # character if it is the first character on not smile



#10440 10/02/03 05:16 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Don't forget, you may need to use $strip too!


eg: #hello That is Bold hello


Aubs.
cool

#10441 10/02/03 06:30 PM
Joined: Dec 2002
Posts: 28
B
bibadi Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Dec 2002
Posts: 28
where do i have to put it? remote?
and is it that code i have to have or with that green stuff? please make it excatly how i can put in in remote or alias? please do and tell me where? ty


I'm.... LETHAL
#10442 11/02/03 01:55 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Yes, you need to save it all in your remotes section.

With mIRC open, press ...Hmmm, let me open mIRC and make sure!...Press: Alt+R

This opens up the mIRC Editor in the "Remotes" section.

Point to File-->New

This adds a new file to the remotes section (As a side note, you can see what files are being used by Pointing to: View)

In the main window, paste all the text I wrote (all the code) including the "green writing"!

I made it green so you can see it is a comment.

From the help file:
(/help comments)

Comments
You can add comments to your scripts by using the ; semi-colon at the start of a line.

;This is a comment

You can place comments anywhere in a script, they are ignored during processing.



Make sure it looks EXACTLY the same as the code I pasted (any comments do not show up as green. they look like ordinary text)

If in doubt, mess around! you can only get better grin


Aubs.
cool


Link Copied to Clipboard