Ok, this is for anyone way better at MSN scripting than I (darn near everyone). Does this look like it'll work? It's For A "Show Respect" Script That I Intend To Eventually Release If It Seems Like A Useful One, Might Be Able To Be Modified For Regular IRC usage as well. Anyone that helps me here of course will receive credit for doing so. "Revisions By so on and so forth". I know I could have done it with user levels but I'm obsessed with using txt files. I used custom identifiers to simplify the bulk of the code (as you can see it's prolly a good idea).
$res.ifoffend($1-) looks up the restricted words file to see if any of the words is in the text and if so returns true, else returns false
$offender($$ial($nick $+ *,1).addr).exists returns true if they already said somethign offensive
$offender($$ial($nick $+ *,1).addr).count returns the number of offenses
The on join will check to see if the user's in the disrespectful list and if so ban them, however if it's the script itself then it'll check the whole room for the addresses of everyone, and if on the list and the script is owner ban them and kick them cos these people are offenders 10x or more. and yes this is with vincula 4.9.
the on text checks if it's offensive by reading the list, reads the restricted file and determines whether or not they're on it, if so how much, and will warn/kick accordingly.
Thanks to anyone who lends a hand.
;
;identifiers
;
res.ifoffend {
var %curword 1
var %retval $false
var %look.in $1
while (%curword <= $lines(restricted.txt)) {
if ($read(restricted.txt,%curword) isin %look.in) {
%retval = $true
/break
}
/inc %curword
}
return %retval
}
offender {
var %retval
if ($prop == exists) {
%retval = $false
if ($read(offenders.txt,w,* $+ $1 $+ *) {
%retval = $true
/break
}
}
if ($prop == count) {
%retval = $gettok($read(offenders.txt,w,* $+ $1 $+ *),2,126)
}
return %retval
}
;
;text check
;
on *:TEXT:**:#:{
if ($res.ifoffend($1-) == $true) {
if ($offender($$ial($nick $+ *,1).addr).exists == $true) {
if ($offender($$ial($nick $+ *,1).addr).count = 1) {
/write -l $+ $readn offenders.txt $$ial($nick $+ *,1).addr $+ ~ $+ $calc($offender($$ial($nick $+ *,1).addr).count + 1)
/msg $comchan($me,1) Hey $nick This Is Your Second Warning, No Slurs Or Disrespectful Comments. I MEAN IT! :@
}
elseif ($offender($$ial($nick $+ *,1).addr).count = 2) {
/write -l $+ $readn offenders.txt $$ial($nick $+ *,1).addr $+ ~ $+ $calc($offender($$ial($nick $+ *,1).addr).count + 1)
.sockwrite -tn msn.server. $+ $cid ACCESS $msn.get($cid,fullroom) ADD DENY $$ial($nick $+ *,1).addr $calc(1440 * 2)
/kick $comchan($me,1) $nick Show Some Respect! [Access Ban Set For 48 Hours]
}
elseif ($offender($$ial($nick $+ *,1).addr).count >= 3) && ($offender($$ial($nick $+ *,1).addr).count < 10){
/write -l $+ $readn offenders.txt $$ial($nick $+ *,1).addr $+ ~ $+ $calc($offender($$ial($nick $+ *,1).addr).count + 1)
.sockwrite -tn msn.server. $+ $cid ACCESS $msn.get($cid,fullroom) ADD DENY $$ial($nick $+ *,1).addr $calc(1440 * 7)
/kick $comchan($me,1) $nick OK It Seems That The 48 Hours I Gave You Wasn't Enough. Let's Try A Week Now. [Access Ban Set For 1 Week]
}
elseif ($offender($$ial($nick $+ *,1).addr).count = 10){
/write -l $+ $readn offenders.txt $$ial($nick $+ *,1).addr $+ ~ $+ $calc($offender($$ial($nick $+ *,1).addr).count + 1)
.sockwrite -tn msn.server. $+ $cid ACCESS $msn.get($cid,fullroom) ADD DENY $$ial($nick $+ *,1).addr $calc(1440 * 7)
/kick $comchan($me,1) $nick OK It Seems That The 48 Hours I Gave You Wasn't Enough. Let's Try A Week Now. [Access Ban Set For 1 Week]
}
if ($offender($$ial($nick $+ *,1).addr).count > 10){
/write -l $+ $readn offenders.txt $$ial($nick $+ *,1).addr $+ ~ $+ $calc($offender($$ial($nick $+ *,1).addr).count + 1)
.sockwrite -tn msn.server. $+ $cid ACCESS $msn.get($cid,fullroom) ADD DENY $$ial($nick $+ *,1).addr 0
/kick $comchan($me,1) $nick Looks Like You Can't Listen [Access Ban Set Indefinitely]
}
else {
/write offenders.txt $$ial($nick $+ *,1).addr $+ ~ $+ 1
/msg $comchan($me,1) Ok $nick I'm Telling You Now...No Slurs, Slur-ish Or Disrespectful Remarks, In Any Fashion. It's Rude.
}
}
}
;
;Join Check
;
on *:JOIN:#:{
if ($nick != $me) &&{
if ($offender($$ial($nick $+ *,1).addr).exists == $true) {
if ($offender($$ial($nick $+ *,1).addr).count > 10) {
.sockwrite -tn msn.server. $+ $cid ACCESS $msn.get($cid,fullroom) ADD DENY $$ial($nick $+ *,1).addr 0
/kick $comchan($me,1) $nick You've Been A Pain [You'll Never Be Alowed In Here Again]
}
}
}
elseif ($nick == $me) && ($me isowner $chan) {
var %i = 0
var %nicks = ""
:nextnick
inc %i
if ($nick($chan,%i) == $me) {
inc %i
}
if ($offender($$ial($nick($chan,%i) $+ *,1).addr).exists == $true) {
if ($offender($$ial($nick($chan,%i) $+ *,1).addr).count > 10) {
.sockwrite -tn msn.server. $+ $cid ACCESS $msn.get($cid,fullroom) ADD DENY $$ial($nick $+ *,1).addr 0
/kick $comchan($me,1) $nick You've Been A Pain [You'll Never Be Alowed In Here Again]
}
goto nextnick
}
}
}