mIRC Homepage
Posted By: zad0909 Need help editing a few scripts. - 21/08/07 02:38 PM
I have a few scripts here that I found. Need some help editing them. Thanks for any and all that help.
I have this spam script here

on *:TEXT:*:#:{
inc -u3 %spam. [ $+ [ $nick ] ]
if (%spam. [ $+ [ $nick ] ] == 4) {
ban $chan $address($nick,1)
kick $chan $nick Spam
}
}

I was wondering on how to make it a warning script. Where 2 or 3 times it will kick them. Then on the 3 or 4th it will be a ban.

Also for my blacklist script everytime someone joins it will say its 5 kicks till blacklist thing. How do you make it so that it only says it once and only when the bot joins? Heres the script
on *:join:#: {
if $ini(black.ini,bans,$chan) {
part $chan $c1 This channel has Been blacklisted To have this removed please contact $c2 Yournick.
}
else {
if ($chan != #bots) {
if ($($+(%,kick.,$chan),2)) var %left = $+($calc(5 - $v1),/5)
else var %left = 5/5
.msg $nick $c1 If i am kicked $c2 5 $c1 Times this channel will be blacklisted Number of kicks left $c2 %left
}
}
}

My last one is my mute script. i would like to make it so that if a voice tries to use it it will say you need to a hop/op to use this command. As well as not allowing it to work on an op/hop and lastly if you just type !mute it will do nothing and give an error message like please type in a name. Here is the script

on *:text:!mute*:#:{ if ($nick isop $chan) || ($nick ishop $chan) {
/mode $chan +bb ~q: $+ $address($2,2)
/mode $chan -v $2
/notice $nick $2 has been muted
}
}
on *:text:!unmute*:#:{ if ($nick isop $chan) || ($nick ishop $chan) {
/mode $chan -b ~q: $+ $address($2,2)
/msg $chan $2 has been unmuted
/mode $chan +v $2
}
}

I know this is a lot but I would appreciate any help anyone can offer me.

Thanks.

Posted By: LostShadow Re: Need help editing a few scripts. - 21/08/07 04:27 PM
Why not contact the coder of the script?

Quote:
My last one is my mute script. i would like to make it so that if a voice tries to use it it will say you need to a hop/op to use this command.


on *:text:!mute*:#:{ if ($nick isop $chan) || ($nick ishop $chan) {
/mode $chan +bb ~q: $+ $address($2,2)
/mode $chan -v $2
/notice $nick $2 has been muted
}
}

See the bold? That means it triggers for ops and +h's. So it doesn't trigger for voices.
Posted By: LonDart Re: Need help editing a few scripts. - 21/08/07 05:55 PM
This kicks/warns on 3, ban/kicks on 4. The var may unset if they don't have auto-rejoin enabled.
Looks to me as though %spam is any text at all, sent too quickly ( 3 or 4 lines in under 3 seconds )
Code:
on *:TEXT:*:#:{
  inc -u3 %spam. [ $+ [ $nick ] ]
  if (%spam. [ $+ [ $nick ] ] == 4) {
    ban $chan $address($nick,1)
    kick $chan $nick Spam
  }
}

on *:TEXT:*:#:{
  inc -u3 %spam. [ $+ [ $nick ] ]
  if (%spam. [ $+ [ $nick ] ] == 3) {
    kick $chan $nick Do Not Spam. You have been warned.
  }
  if (%spam. [ $+ [ $nick ] ] == 4) {
    ban -k $chan $address($nick,1) Spamming. You were warned.
  }
}

This will tell user if they are ineligible, or if they use the wrong syntax.
Code:
on *:text:!mute *:#:{
  if ($nick isop $chan) || ($nick ishop $chan) {
    if ( !$2 ) { notice $nick You must specify a nick. | return }
    mode $chan +bb ~q: $+ $address($2,2)
    mode $chan -v $2 
    notice $nick $2 has been muted 
  }
  else notice $nick You must have op/hop status to use this command.
}
on *:text:!unmute *:#:{
  if ($nick isop $chan) || ($nick ishop $chan) {
    if ( !$2 ) { notice $nick You must specify a nick. | return }
    mode $chan -b ~q: $+ $address($2,2)
    msg $chan $2 has been unmuted 
    mode $chan +v $2 
  }
  else notice $nick You must have op/hop status to use this command.
}

For second request, need to know if the script is loaded in the bot client.
Posted By: zad0909 Re: Need help editing a few scripts. - 21/08/07 08:12 PM
Thats the whole script.

There is no "load" function.
Quote:

See the bold? That means it triggers for ops and +h's. So it doesn't trigger for voices.


I meant so that it wouldnt mute them. Like right now a mute could mute a hop or an op. And vice versa. Was wondering if there was a way to not allow that to happen at all. Meaning it only works on those that are voiced. Again should som1 try to mute an op/hop an error message would say, this script does not work on ops or w/e.

Also for the spam script I am having a little trouble with it. Seems it will ban you and not kick you cause the difference is so close. And setting it apart you never get banned. So what if you set a timer for like 2 mins after the first spam and during that 2 mins if they spam again they are then banned. Can you do that? and if so how?

Thanks.
Posted By: LonDart Re: Need help editing a few scripts. - 21/08/07 11:12 PM
I really goofed on posting that 'spam' code. The whole first instance of
on *:TEXT:# (your original code) should be replaced with the second instance.

RE: !mute , I am unfamiliar with the code
Code:
mode $chan +bb ~q: $+ $address($2,2)

I suspect that the ~q parameter may be in the ircd. We have an eggdrop bot, which always kicks on a ban,
so I've never been able to use /ban as a 'silencing' command.
That said, if the channel is in moderated mode, de-voicing ought to effectively silence a nick,
so simply removing the above line should restrict it's effect to only voiced nicks.

This is my understanding of the modes, and I may be wrong.

As to the blacklist script, it actually makes no sense to me.
Who is the *I* who must not be kicked 5 times?
It seems it ought to be the bot, in which case it makes no sense to me
for that code to be loaded anywhere but in the bot.
Also if there is no other code, like an on KICK to increase the variable %kick.$chan
and write the channel name to black.ini when it reaches 5, it's not doing anything useful.

Posted By: truguce Re: Need help editing a few scripts. - 21/08/07 11:34 PM
Code:
on *:text:!mute*:#:{
 if ($nick isop $chan) || ($nick ishop $chan) {
    if ( !$2 ) { notice $nick You must specify a nick. | return }
    if ($2 isop $chan) || ($2 ishop $chan) return
    mode $chan +bb ~q: $+ $address($2,2)
    mode $chan -v $2 
    notice $nick $2 has been muted 
  }
  else notice $nick You must have op/hop status to use this command.
}
 

That should stop the script if the target nick is a Hop or Op.
Posted By: LonDart Re: Need help editing a few scripts. - 22/08/07 12:45 AM
Generally 'spamming' a channel refers to advertising websites or other channels.
The script you gave is more like a flood script. As I modified it
It will kick/warn anyone for sending *any* text to channel at a rate higher than 3 lines in 3 seconds,
and ban/kick anyone who manages to send 4 lines of any text to channel in 3 seconds.

If what you want is to warn at first instance of spam, as defined above,
and ban/kick if they re-offend within 2 minutes:

Code:
on *:TEXT:*:#:{
  if ( (*http*//* iswm $1-) || (*www.* iswm $1-) || (*join*#* iswm $1-) ) {
    if ( $($+(%,spam.,$nick),2) ) {
      ban -k $nick 1 Spamming. You were warned.
    }
    else set -u120 $+(%,spam.,$nick) 1
    msg $chan $nick $+ , Do Not Spam! You have been warned.
  }
}


To warn on 1st offense, kick on 2nd offense, ban on 3rd, with no time limit between offenses:

Code:
on *:TEXT:*:#:{
  if ( (*http*//* iswm $1-) || (*www.* iswm $1-) || (*join*#* iswm $1-) ) {
    if ( $($+(%,spam.,$nick),2) == 2 ) {
      ban -k $nick 1 Spamming. You were warned.
    }
    elseif ( $($+(%,spam.,$nick),2) == 1 ) {
      kick $nick 1 Spamming. You were warned.
      inc $+(%,spam.,$nick)
    }
    else inc $+(%,spam.,$nick)
    msg $chan $nick $+ , Do Not Spam! You have been warned.
  }
}

Posted By: zad0909 Re: Need help editing a few scripts. - 22/08/07 02:31 PM
Originally Posted By: LonDart
Generally 'spamming' a channel refers to advertising websites or other channels.
The script you gave is more like a flood script. As I modified it
It will kick/warn anyone for sending *any* text to channel at a rate higher than 3 lines in 3 seconds,
and ban/kick anyone who manages to send 4 lines of any text to channel in 3 seconds.

If what you want is to warn at first instance of spam, as defined above,
and ban/kick if they re-offend within 2 minutes:

Code:
on *:TEXT:*:#:{
  if ( (*http*//* iswm $1-) || (*www.* iswm $1-) || (*join*#* iswm $1-) ) {
    if ( $($+(%,spam.,$nick),2) ) {
      ban -k $nick 1 Spamming. You were warned.
    }
    else set -u120 $+(%,spam.,$nick) 1
    msg $chan $nick $+ , Do Not Spam! You have been warned.
  }
}


To warn on 1st offense, kick on 2nd offense, ban on 3rd, with no time limit between offenses:

Code:
on *:TEXT:*:#:{
  if ( (*http*//* iswm $1-) || (*www.* iswm $1-) || (*join*#* iswm $1-) ) {
    if ( $($+(%,spam.,$nick),2) == 2 ) {
      ban -k $nick 1 Spamming. You were warned.
    }
    elseif ( $($+(%,spam.,$nick),2) == 1 ) {
      kick $nick 1 Spamming. You were warned.
      inc $+(%,spam.,$nick)
    }
    else inc $+(%,spam.,$nick)
    msg $chan $nick $+ , Do Not Spam! You have been warned.
  }
}



Yes sorry. Its more of a flood script.

I'll try these new ones.
Posted By: zad0909 Re: Need help editing a few scripts. - 22/08/07 02:34 PM
Originally Posted By: LonDart
I really goofed on posting that 'spam' code. The whole first instance of
on *:TEXT:# (your original code) should be replaced with the second instance.

RE: !mute , I am unfamiliar with the code
Code:
mode $chan +bb ~q: $+ $address($2,2)

I suspect that the ~q parameter may be in the ircd. We have an eggdrop bot, which always kicks on a ban,
so I've never been able to use /ban as a 'silencing' command.
That said, if the channel is in moderated mode, de-voicing ought to effectively silence a nick,
so simply removing the above line should restrict it's effect to only voiced nicks.

This is my understanding of the modes, and I may be wrong.

As to the blacklist script, it actually makes no sense to me.
Who is the *I* who must not be kicked 5 times?
It seems it ought to be the bot, in which case it makes no sense to me
for that code to be loaded anywhere but in the bot.
Also if there is no other code, like an on KICK to increase the variable %kick.$chan
and write the channel name to black.ini when it reaches 5, it's not doing anything useful.



Again my mistake. I misunderstood your question.
It is in the bots remote section and the bot is the "I".

I apologize.
Posted By: LonDart Re: Need help editing a few scripts. - 22/08/07 05:00 PM
OK. To make this part of the script have the bot announce to channel about the 5 kicks/blacklist when bot joins channel,
rather than messaging everyone who joins the channel, Try:
Code:
on me:*:join:#: {
  if $ini(black.ini,bans,$chan) {
    part $chan $c1 This channel has Been blacklisted To have this removed please contact $c2 Yournick.
  }
  else {
    if ($chan != #bots) { 
      if ($($+(%,kick.,$chan),2)) var %left = $+($calc(5 - $v1),/5) 
      else var %left = 5/5 
      .msg $chan $c1 If i am kicked $c2 5 $c1 Times this channel will be blacklisted Number of kicks left $c2 %left 
    }
  }
}

Don't forget to change 'Yournick' smile
Sometimes, on me:*:JOIN:... will not work as expected because joining a channel is a series of events.
I think the above should work, as we aren't basing the code on any info about the channel other than
it's name and what is in black.ini.
If it does not, replace it with the following.
Raw 366 (End of NAMES) is sent near the end of a JOIN event, and $2 is the channel name.

Code:
raw 366: {
  if ( $me ison $2 ) {
    if $ini(black.ini,bans,$2) {
      part $2 $c1 This channel has Been blacklisted To have this removed please contact $c2 Yournick.
    }
    else {
      if ($2 != #bots) { 
        if ($($+(%,kick.,$2),2)) var %left = $+($calc(5 - $v1),/5) 
        else var %left = 5/5 
        .msg $2 $c1 If i am kicked $c2 5 $c1 Times this channel will be blacklisted Number of kicks left $c2 %left 
      }
    }
  }
}

Posted By: zad0909 Re: Need help editing a few scripts. - 23/08/07 01:30 PM
Thanks man.

That does it for me.
© mIRC Discussion Forums