Simple script where you can add|remove|list the rules, NOW WORKS FOR INDIVIDUAL CHANNELS ;)
if you add a rule in a specific channel, YOU MUST DELETE IT FROM THE CHANNEL YOU SET IT IN.
ty :)
Updated so it won't attempt to list the rules in the .ini if there are no rules there to list.
updated the error everyone kept talking about.
Any more errors, gimme a shout.
alias loc return $iif($chan,$v1,$nick)
on $*:text:/^!rules\b/Si:*:{
tokenize 32 $strip($1-)
if ($2 == add) && ($nick isop $chan) {
if ($3) {
writeini rules.ini $chan $3- Added by $nick
msg $chan 4" $+ $3- $+ " Added as a rule by $nick $+ .
}
}
if ($2 == del) && ($nick isop $chan) {
if ($3) {
if ($readini(rules.ini,$chan,$3)) {
remini rules.ini $chan $3- Added By $nick
.msg $chan 4Removed $3- from rules list.
}
}
else {
msg $chan 4No such Rule entry.
.notice $nick 4To see the list of Rule List Entries, type !Rules <list>
}
}
if ($2 == list) && ($ini(rules.ini,$chan,0)) {
.msg $loc 4Displaying A List Of Rules For $loc $+ :
var %a 1, %z $ini(Rules.ini,$chan,0)
while (%a <= %z) {
.msg $loc 04 $+ %a $ini(rules.ini,$chan,%a) $readini(rules.ini,$chan,$ini(rules.ini,$chan,%a))
inc %a
}
.msg $chan 4End of list. %z entry(s) displayed.
}
elseif ($2 == list) && (!$ini(rules.ini,$chan,0)) {
.msg $loc 04Sorry $nick $+ , there are currently no rules for $chan $+ .
}
}
Heh. Well considering that has never done it on anyone elses but yours, that proves that it's user error. :)
(21:10:38) [~Jordan] !rules
(21:10:39) [+Atmosphere] Displaying A List Of Rules For #inspircd:
(21:10:40) [+Atmosphere] 1) Respect the ops.
(21:10:41) [+Atmosphere] 2) Don't beg for ops, they will be given to you when we are ready.
(21:10:41) [+Atmosphere] End of list. 2 entry(s) displayed.
(21:10:51) [~Jordan] !rules add Smoking kills
(21:10:51) [+Atmosphere] "Smoking kills" Added as a rule by Jordan.
(21:10:53) [~Jordan] !rules
(21:10:54) [+Atmosphere] Displaying A List Of Rules For #inspircd:
(21:10:54) [+Atmosphere] 1) Respect the ops.
(21:10:54) [+Atmosphere] 2) Don't beg for ops, they will be given to you when we are ready.
(21:10:54) [+Atmosphere] 3) Smoking kills
(21:10:54) [+Atmosphere] End of list. 3 entry(s) displayed.
:) Point proved ? :D
[20:46] <~Spencer> !rules add don't flood
[20:46] <~I_HIDE> "don't flood" Added as a rule by Spencer.
[20:46] <~Spencer> !rules
[20:46] <~I_HIDE> Displaying A List Of Rules For #hidden_room_here:
[20:46] <~I_HIDE> 1) Dont Spam
[20:46] <~I_HIDE> 1) Dont Spam
[20:46] <~I_HIDE> 1) Dont Spam
[20:46] <~I_HIDE> 1) Dont Spam
[20:46] <~I_HIDE> 1) Dont Spam
[20:46] <~I_HIDE> 1) Dont Spam
[20:46] <~I_HIDE> 1) Dont Spam
[20:46] <~I_HIDE> 1) Dont Spam
[20:46] <~IHIDE> 1) Dont Spam
> <_< just leaves this here.
alias loc return $iif($chan,$v1,$nick)
on $*:text:/^!rules\b/Si:*:{
tokenize 32 $strip($1-)
if ($2 == add) && ($nick isop $chan) {
if ($3) {
writeini rules.ini $chan $3-
msg $chan 4" $+ $3- $+ " Added as a rule by $nick $+ .
}
}
if ($2 == del) && ($nick isop $chan) {
if ($3) {
if ($readini(rules.ini,$chan,$3)) {
remini rules.ini $chan $3-
.msg $chan 4Removed $3- from rules list.
}
}
else {
msg $chan 4No such Rule entry.
.notice $nick 4To see the list of Rule List Entries, type !Rules <list>
}
}
if (!$2) && ($ini(rules.ini,$chan,0)) {
.msg $loc 4Displaying A List Of Rules For $loc $+ :
var %a 1, %z $ini(Rules.ini,$chan,0)
while (%a <= %z) {
.msg $loc 04 $+ %a $+ $chr(41) $ini(rules.ini,$chan,%a) $readini(rules.ini,$chan,$ini(rules.ini,$chan,%a))
inc %a
}
.msg $chan 4End of list. %z entry(s) displayed.
}
elseif ($2 == list) && (!$ini(rules.ini,$chan,0)) {
.msg $loc 04Sorry $nick $+ , there are currently no rules for $chan $+ .
}
}
Nac, it now works for !rules
remini rules.ini $chan $3- Added By $nick <-- that line you only need remini rules.ini $chan, and in order to have this removed from anychannel, simpley do this, remini rules.ini # $+ $2 ; It will still read it as $chan because its looking to whats in it, so if you know the name, it will delete as well.
Hold your nellies,
now this is epically late... but do tell me why I was mentioned...
thanks guys, and bullet_fag $strip works perfectly, unlike you i create my scripts for release, therefore other users who use the scripts might not want to type /ignore -k @ so stfu and go get butthurt by mikey again.
/latest ever!!!! What an achievement Q_Q
iv sorta got it working :/ its not perfect but still..
alias loc return $iif($chan,$v1,$nick)
on $*:text:/^!rules\b/Si:*:{
tokenize 32 $strip($1-)
if ($2 == add) && ($nick isop $chan) {
inc %rules
if ($3) {
writeini rules.ini $chan %rules $3- Added by $nick
msg $chan 4" $+ $3- $+ " Added as a rule by $nick $+ .
}
}
if ($2 == del) && ($nick isop $chan) {
if ($3) {
if ($readini(rules.ini,$chan,$3)) {
remini rules.ini $chan $3- Added By $nick
.msg $chan 4Removed $3- from rules list.
dec %rules
}
}
else {
msg $chan 4No such Rule entry.
.notice $nick 4To see the list of Rule List Entries, type !Rules <list>
}
}
if ($2 == list) && ($ini(rules.ini,$chan,0)) {
.msg $loc 4Displaying A List Of Rules For $loc $+ :
var %a 1, %z $ini(Rules.ini,$chan,0)
while (%a <= %z) {
.msg $loc 04 $+ $ini(rules.ini,$chan,%a) $readini(rules.ini,$chan,$ini(rules.ini,$chan,%a))
inc %a
}
.msg $chan 4End of list. %z entry(s) displayed.
}
elseif ($2 == list) && (!$ini(rules.ini,$chan,0)) {
.msg $loc 04Sorry $nick $+ , there are currently no rules for $chan $+ .
}
}
i know its not "perfect" but it works.. :)