this gives people 3 warnings before they are kicked.
after they are warned 3 times they are kicked for 2 minutes. the second time they are kicked for 24 hours.
Commands:
!warn - gives them a warning (1-3)
!decwarn - lowers their warning level by 1
!resetwarn - resets the warning level back to 0
on *:text:!warn*:#:{
if ($address($2,2) == $address($me,2)) {
notice $nick you cannot warn $2 | halt
}
else if ($nick isop $chan) {
if ($2 ison $chan) {
if ($readini(Warn.ini,$chan,$address($2,2)) == $null) {
writeini Warn.ini $chan $address($2,2) 1
notice $2 5You currently have3 15 warning, you now have3 25 warnings remaining, Reason for warning: $3-
notice $nick $2 has been warned about their 3first offence. | halt
}
}
}
if ($nick isop $chan) {
if ($2 ison $chan) {
if ($readini(Warn.ini,$chan,$address($2,2)) == 1) {
writeini Warn.ini $chan $address($2,2) $calc( $readini(Warn.ini,$chan,$address($2,2)) +1)
writeini ban.ini $chan $address($2,2) $calc( $readini(ban.ini,$chan,$address($2,2)) +1)
notice $2 You currently have7 25 warnings, you now have7 15 warnings remaining, Reason for warning: $3-
notice $nick $2 has been warned about their 7second offence. | halt
}
}
}
if ($nick isop $chan) {
if ($2 ison $chan) {
if ($readini(Warn.ini,$chan,$address($2,2)) == 2) {
writeini Warn.ini $chan $address($2,2) $calc( $readini(Warn.ini,$chan,$address($2,2)) +1)
writeini ban.ini $chan $address($2,2) $calc( $readini(ban.ini,$chan,$address($2,2)) +1)
notice $2 You currently have4 35 warnings, you now have4 05 warnings remaining, Reason for warning: $3-
notice $nick $2 has been warned about their 4third offence. | halt
}
}
}
if ($nick isop $chan) {
if ($2 ison $chan) {
if ($readini(Warn.ini,$chan,$address($2,2)) == 3) {
if ($readini(ban.ini,$chan,$address($2,2)) == 2) {
set %reason. you had 3 warnings and didn't learn you have been banned for 2 minutes. your next ban will be for 24 hours.
ban -ku120 $chan $$2 2 Reason: $3- %reason.
Unset %reason.
remini Warn.ini $chan $address($2,2)
}
}
}
}
if ($nick isop $chan) {
if ($2 ison $chan) {
if ($readini(ban.ini,$chan,$address($2,2)) == 4) {
set %reason2. you have had 2 chances and you didn't learn, have been banned for 24 hours from $chan $+ .
ban -ku1440 $chan $$2 2 Reason: $3- %reason2.
Unset %reason2.
remini ban.ini $chan $address($2,2)
remini Warn.ini $chan $address($2,2)
}
}
}
}
on *:TEXT:!resetwarn*:#: {
if ($nick isop $chan) {
if ($2 ison $chan) {
if ($address($nick,2) == $address($2,2)) {
notice $nick you cannot reset your own warning level | halt
}
else if ($readini(Warn.ini,$chan,$address($2,2)) == $null) {
notice $nick $2 $+ 's warning level is already set to3 0
}
else { remini Warn.ini $chan $address($2,2)
remini ban.ini $chan $address($2,2)
notice $2 your Warning has been reset back to3 0 5by $nick $+ .
notice $nick $2 $+ 's warning level has been reset back to3 0.
}
}
}
}
on *:TEXT:!decwarn*:#: {
if ($nick isop $chan) {
if ($2 ison $chan) {
if ($address($nick,2) == $address($2,2)) {
notice $nick you cannot decrease your own warning level | halt
}
if ($readini(Warn.ini,$chan,$address($2,2)) == 1) {
remini Warn.ini $chan $address($2,2)
notice $nick $2 $+ 's warning level has been decreased to3 0
notice $2 your warning level has been decreased to3 0
}
elseif ($readini(Warn.ini,$chan,$address($2,2)) > 1) {
writeini Warn.ini $chan $address($2,2) $calc( $readini(Warn.ini,$chan,$address($2,2)) -1)
notice $nick $2 $+ 's warning level has been decreased to $readini(Warn.ini,$chan,$address($2,2))
notice $2 your warning level has been decreased to $readini(Warn.ini,$chan,$address($2,2))
}
}
}
}