mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2016
Posts: 14
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Feb 2016
Posts: 14
Okay, so I'm not sure where to start, but I have an idea of what I want. Basically, I want a script that warns users in a channel if they don't abide by the rules. And each user will have a different variable as to how many warning or infractions against them. And on the third, will ban the user(s) from the channel. I know quite a bit of MSL, but not entirely sure where to start on this kind of idea.

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Well, seems like you need to define the rules that you want the script to check for, and then see if it's possible to be checked.. e.g bad words, flood, join/part flood.
And then apply the counting variables to each case.

Joined: Apr 2014
Posts: 170
Vogon poet
Offline
Vogon poet
Joined: Apr 2014
Posts: 170
Generally, when I try to work out a script I throw something like this together to keep my mind on what exactly I should be doing... Then I go through and put in the actual script and give it a few tests with some echo's or something...

Code:
on *:text:*:#: {
  ;if they broke the rules:
    ;check if on warn2
      if yes:
        ;remove from warn2
        ;ban.
      if no:
        ;check warn1
    ;check if on warn1
      if yes:
        ;warn again
        ;remove from warn1
        ;add to warn2
      if no warn
        ;warn
        ;add to warn1
}


You COULD use variables to keep users on the list, but I'd go with a file of some sort (txt would be easiest probably). Check if they broke the rules, if not then { return } If they did, then simply check if their username is in that file. If it is, do the appropriate action... I put in the "remove from..." bit just to prevent double messages and whatnot. But you could also just add a return after the "add to..." parts I think? Someone more knowledgeable might be able to verify if that would work. But, adding the remove also allows you to keep the files cleaned up a bit.


Also, this is just a quick thing I threw together. Obviously. Don't judge it for not checking the right way. The idea was to get you moving in the right direction.

Last edited by Bramzee; 08/04/17 08:06 PM.
Joined: Feb 2016
Posts: 14
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Feb 2016
Posts: 14
Basically what I want is to set rules such as flooding, caps, etc... and have the bot detect it and set a variable or text file with how many warnings they get. First warning would be a five minute ban, second would be 24 hour ban, and third permaban. Like the three strikes rule. Is this possible? And if so, how would I do it?

Joined: Jan 2017
Posts: 57
Babel fish
Offline
Babel fish
Joined: Jan 2017
Posts: 57
I made a script way-back-when. I'll post it here because it's slightly relevant.

Quote:
on *:TEXT:*:#: {
;#### ROBOT BOUNCER ####
if (%BouncerOn == True) {
if (%AmHuman. [ $+ [ $nick ] ] == $null) {
set %AmHuman. [ $+ [ $nick ] ] False
}
if (%RaidCountdown <= 0 && %AmHuman. [ $+ [ $nick ] ] == False) {
if (%BotWarningCount. [ $+ [ $nick ] ] >= 5) {
msg $chan /ban $nick
msg $chan /me &#10071; $nick [ $+ [ , ] ] message @KubosKube with "/w KubosKube Unban $nick $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) " to be unbanned. Robots won't follow these directions.
set %BotWarningCount. [ $+ [ $nick ] ] 0
}
else {
if (%BotWarningCount. [ $+ [ $nick ] ] == $null) {
set %BotWarningCount. [ $+ [ $nick ] ] 0
}
inc %BotWarningCount. [ $+ [ $nick ] ]
msg $chan /me &#10071; Type !human in Chat, $nick . Warning %BotWarningCount. [ $+ [ $nick ] ] / 5.
}
}
}
}


It uses a couple of variables.
%BouncerOn is a toggle so I can turn this feature off.
%AmHuman "determines" if a user is a robot or not. If this value is false, then the user is "breaking the rules".
%BotWarningCount.$nick is used for counting how many times a particular user has been warned. When this reaches a certain limit, it bans the user.
%RaidCountDown is set in a separate part of my script to bypass this whole block of text so I don't timeout/ban 20 new members in my Twitch stream during a raid.

I know it's not exactly what you asked for, but it's close to what you wanted, I think, so I hope it helps you out.

Joined: Feb 2016
Posts: 14
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Feb 2016
Posts: 14
That works. I'll take that and run with it. Thanks for that!


Link Copied to Clipboard