This is my modified requestsystem, its a pretty long code, but it seems to work.
The Vars are in dutch, but the rest is translated from my own script to english, I hope its any good
If not, let me know
Every setting is settable:
!requestsystem on
!requestsystem points on
!requestsystem mode on
!requestsystem topic on
!requestsystem setdj v|h|o
To view te settings:
!requestsystem settings
To view the commands of this little system:
!requestsystem help
If the system is turned on type:
!request <artist - title> to make a request to the DJ (It wil send the ReQuest to the DJ and to the logchannel)
!brr (even pointsystem is off) to give the DJ credit
!skip give the DJ -1 in points
There is also an antiflood protection build in
The mode system is written on Anope2's /msg chanserv up #channel nickname system to give the status back when DJ is unset
I do know that this snippet is kinda long, I'm still working to shorten the code, but for now it works.
Only change the vars
alias varss {
set %channel URCHANNEL
set %logchannel URLOGCHANNEL
set %botowner URNICKNAME
}
on *:load:{
varss
}
on *:connect:{
varss
}
alias sc_topic1 {
topic $1 1,1..8,8..4,4..0,7 $1 $chr(124) Huidige DJ: %sc.dj. [ $+ [ $1 ] ] $chr(124) $1 typ !request help for the commands 4,4..0,0..12,12..
}
alias sc_topicoff {
topic $1 1,1..8,8..4,4..0,7 $1 typ !request help for the commands 4,4..0,0..12,12..
}
on *:text:!dj:#: {
if ($readini(channels.ini,$chan,request) == on) {
msg # Current DJ: 4 $+ %sc.dj. [ $+ [ $chan ] ]
}
else {
notice $nick $1 is not on on # $+ !
}
}
on *:text:!setdj*:#: {
if ($readini(channels.ini,$chan,request) == on) {
if ($me isop #) {
if (($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) || ($nick == %botowner)) && ($2 ison #) {
if ($readini(channels.ini,$chan,djmode) == on) {
timerdehop 1 1 mode # - $+ $readini(channels.ini,$chan,setdj) $+ v %sc.dj. [ $+ [ $chan ] ] %sc.dj. [ $+ [ $chan ] ]
timervop 1 1 mode # +v %sc.dj. [ $+ [ $chan ] ]
timerup 1 1 msg chanserv up # %sc.dj. [ $+ [ $chan ] ]
}
timersetdj1 1 1 notice $nick $nick $+ , %sc.dj. [ $+ [ $chan ] ] is now ready and will be taken over by $2 :)
if ($chan == %channel) {
timermsg 1 1 msg %logchannel %sc.dj. [ $+ [ $chan ] ] is now ready and will be taken over by $2 $+ !
}
else {
timermsg 1 1 msg #requestviewer %sc.dj. [ $+ [ $chan ] ] is now ready and will be taken over by $2 $+ !
}
timersetdj2 1 1 set %sc.dj. [ $+ [ $chan ] ] $2
if ($readini(channels.ini,$chan,topic) == on) {
timertopic 1 2 sc_topic1 $chan
}
if ($readini(channels.ini,$chan,djmode) == on) {
timermode1 1 2 mode # -qaoh $2 $2 $2 $2
timermode2 1 2 mode # + $+ $readini(channels.ini,$chan,setdj) $2
}
timermsg1 1 2 notice $nick $nick $+ , $2 is set as DJ on # $+ !
timermsg2 1 2 msg $chan $nick $+ , $2 is set as DJ on # $+ !
if ($chan == %channel) {
timermsg2 1 2 msg %logchannel $2 is set as DJ on $chan $+ !
}
else {
timermsg2 1 2 msg #requestviewer $2 is set as DJ on $chan $+ !
}
}
elseif (($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) || ($nick == %botowner)) && ($2 !ison #) { notice $nick $nick $+ , $2 is not on # }
else { msg # $nick $+ , 4ErroR Access Denied on # $+ ! }
}
else {
halt
}
}
else {
msg # $nick $+ , $1 is not on on # $+ !
}
}
on *:text:!unsetdj*:#: {
if ($readini(channels.ini,$chan,request) == on) {
if ($me isop #) {
if (($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) || ($nick == %botowner)) && ($2 ishop #) {
set %sc.dj. [ $+ [ $chan ] ] Non-Stop
if ($readini(channels.ini,$chan,topic) == on) {
timertopic 1 1 sc_topic1 $chan
}
if ($readini(channels.ini,$chan,djmode) == on) {
timermode 1 1 mode # - $+ $readini(channels.ini,$chan,setdj) $+ v $2 $2
;timervop 1 1 mode # +v $2
timerup 1 1 msg chanserv up # $2
}
timermsg 1 1 notice $nick $nick $+ , $2 is now unset as DJ on # $+ !
if ($chan == %channel) {
timermsg 1 1 msg %logchannel $nick $+ , $2 is now unset as DJ on # $+ !
}
else {
timermsg 1 1 msg #requestviewer $2 is now unset as DJ on # $+ !
}
}
elseif (($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) || ($nick == %botowner)) && (!$2) {
;msg %irc.chan %sc.dj is nu klaar met draaien op # $+ !
if ($chan == %channel) {
msg %logchannel %sc.dj. [ $+ [ $chan ] ] is unset as DJ on # $+ !
}
else {
msg #requestviewer %sc.dj. [ $+ [ $chan ] ] is unset as DJ on # $+ !
}
if ($readini(channels.ini,$chan,djmode) == on) {
timermode 1 1 mode # - $+ $readini(channels.ini,$chan,setdj) $+ v %sc.dj. [ $+ [ $chan ] ] %sc.dj. [ $+ [ $chan ] ]
;timervop 1 1 mode # +v %sc.dj. [ $+ [ $chan ] ]
timerup 1 1 msg chanserv up # %sc.dj. [ $+ [ $chan ] ]
}
timermsg 1 2 notice $nick %sc.dj. [ $+ [ $chan ] ] is unset as DJ on # $+ !
timermsg1 1 2 msg $chan %sc.dj. [ $+ [ $chan ] ] is unset as DJ on # $+ !
timerset 1 2 set %sc.dj. [ $+ [ $chan ] ] Non-Stop
if ($readini(channels.ini,$chan,topic) == on) {
timertopic 1 2 sc_topic1 $chan
}
}
elseif (($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) || ($nick == %botowner)) && ($2 !ison #) { msg # $nick $+ , $2 is not on # }
else { msg # $nick $+ , Access Denied! }
}
else {
halt
}
}
else {
msg # $nick $+ , $1 is not on on # $+ !
}
}
on *:text:!request *:#:{
if ($readini(channels.ini,$chan,request) == on) {
if (%verzoekflood. [ $+ [ $nick ] ] $+ ) {
if ($nick == %botowner) { goto next }
else {
notice $nick Graag 1 request in 3 minutes :)
if ($chan == %channel) {
msg %logchannel $nick flood with 4 $1 $2- to %sc.dj. [ $+ [ $chan ] ] verstuurd :)
}
else {
msg #requestviewer $nick flood with 4 $1 $2- to %sc.dj. [ $+ [ $chan ] ] verstuurd :)
}
halt
}
}
if (!%verzoekflood. [ $+ [ $nick ] ] $+ ) {
inc -u180 %verzoekflood. [ $+ [ $nick ] ]
:next
if (!$2) {
msg # $nick $+ , Correcte Syntax is: $1 <arties - song>
halt
}
if (%sc.dj. [ $+ [ $chan ] ] == Non-Stop) {
if ($chan == %channel) {
msg # $nick $+ , Sorry now is %sc.dj. [ $+ [ $chan ] ] $+ !
halt
}
else {
msg # $nick $+ , Sorry now is %sc.dj. [ $+ [ $chan ] ] $+ !
halt
}
}
if (%sc.dj. [ $+ [ $chan ] ] !ison #) {
msg # $nick $+ , Sorry %sc.dj. [ $+ [ $chan ] ] is not present here :(
halt
}
if (%sc.dj. [ $+ [ $chan ] ] ison #) {
msg # DJ %sc.dj. [ $+ [ $chan ] ] $+ , spin that shit around and turn that request from 4 $nick 1
;msg # $nick $+ , via4 de website kan je nog gemakkelijker verzoekjes plaatsen.
msg %sc.dj. [ $+ [ $chan ] ] 4[ReQuest] $2- $+ is requested by 11,1 $+ $nick $+ at 4 $+ $asctime(HH:nn:ss)
if ($chan == %channel) {
msg %logchannel 4[ReQuest] $2- $+ is requested at 13 $+ %sc.dj. [ $+ [ $chan ] ] by 11,1 $+ $nick $+ at 4 $+ $asctime(HH:nn:ss)
}
else {
msg #requestviewer 4[ReQuest] $2- $+ is requested at 13 $+ %sc.dj. [ $+ [ $chan ] ] by 11,1 $+ $nick $+ in 10 $+ $chan at 4 $+ $asctime(HH:nn:ss)
}
notice $nick 4[ReQuest] Your request 11,1 $$2- is submitted by %sc.dj. [ $+ [ $chan ] ]
halt
}
else {
msg # $nick $+ , $2 is no DJ on #
}
}
}
else {
msg # $nick $+ , !requestsystem is not on on # $+ !
}
}
on *:text:!brr*:#:{
if ($readini(channels.ini,$chan,request) == on) {
if ($chan == #sjet4all) {
halt
}
if (%brrflood. [ $+ [ $nick ] ] $+ ) {
notice $nick AntiFlood is enabled 60 secs ignore :)
halt
}
if (!%brrflood. [ $+ [ $nick ] ] $+ ) {
inc -u60 %brrflood. [ $+ [ $nick ] ]
/msg # 6Nice songg %sc.dj. [ $+ [ $chan ] ] $+ , it turns my speakers at maximum POWERRRRR :p
if (%sc.dj. [ $+ [ $chan ] ] == Non-Stop) || (%sc.dj. [ $+ [ $chan ] ] == $nick) { halt }
elseif ($readini(channels.ini,$chan,requestpoints) == on) {
if (!$2) {
add.pts $+(#,.,%sc.dj. [ $+ [ $chan ] ])
if ($read($+(positief/positief.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt)) == $null) {
/msg # 6 $+ %sc.dj. [ $+ [ $chan ] ] Doesn't have any reasons!
}
else {
msg # 6Random reason:4 $read($+(positief/positief.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt),n) 6nr:7 $readn $+ / $+ $lines($+(positief/positief.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt))
}
msg # 6 $+ %sc.dj. [ $+ [ $chan ] ] has 7 $readini(Points.ini,$+(#,.,%sc.dj. [ $+ [ $chan ] ]),Points) 6points.
}
else {
add.pts $+(#,.,%sc.dj. [ $+ [ $chan ] ])
/msg # 6 $+ %sc.dj. [ $+ [ $chan ] ] has7 $readini(Points.ini,$+(#,.,%sc.dj. [ $+ [ $chan ] ]),Points) 6points.
if ($2- !isin $read($+(positief/positief.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt), nw, * $+($2-)*, $readn)) {
write $+(positief/positief.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt) $nick $+ : $2-
}
msg # 6Random reason:4 $read($+(positief/positief.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt),n) 6nr:7 $readn $+ / $+ $lines($+(positief/positief.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt))
}
}
}
}
else {
halt
}
}
alias -l add.pts {
writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
if ((%floodpart) || ($($+(%,floodpart.,$nick),2))) { return }
set -u10 %floodpart On
set -u30 %floodpart. $+ $nick On
;msg $chan $nick heeft het kanaal verlaten en verdient geen punten meer.
}
on $*:text:/!delpoints/Si:#:{
if ($readini(channels.ini,$chan,requestpoints) == on) {
if ($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) || (*n* iswm $readini(users.ini,$address($nick,2),flags)) {
if (!$2) {
var %delpoints $nick
if (!$readini(Points.ini,$+(#,.,%delpoints),Points)) {
notice $nick 6Sorry $nick $+ ,4 %delpoints 6has no points.
halt
}
else {
dorempoints # %delpoints
notice $nick 6 $+ $nick $+ , Points for %delpoints erased.
}
}
var %delpoints $2
if (!$readini(Points.ini,$+(#,.,%delpoints),Points)) {
notice $nick 6Sorry $nick $+ ,4 %delpoints 6has no points.
halt
}
else {
dorempoints # %delpoints
notice $nick 6 $+ $nick $+ , points for %delpoints erased.
}
}
}
}
alias dorempoints {
var %topic $+($1,.,$2)
remini -n Points.ini %topic
echo -a Removed points for %topic
}
on *:TEXT:!top *:#:{
if ($readini(channels.ini,$chan,requestpoints) == on) {
if (($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) || ($nick == %botowner)) {
if ($2 !isnum) || ($2 == $null) {
top10 # 10
halt
}
elseif ($2 isnum) {
top10 # $2
}
else {
notice $nick Syntax: !top [nummer]
}
}
else { notice $nick Sorry $nick $+ , Access Denied :P }
}
}
alias -l top10 {
window -h @. | var %i 1
while $gettok($remove($read(Points.ini,w,$+(*,$1,*),%i),[,]),2,46) {
var %n $v1, %p $gettok($read(Points.ini,$calc($readn + 1)),2,61)
aline @. %n %p
var %i $calc($readn + 1)
}
filter -cetuww 2 32 @. @.
var %i 1 | while %i <= $2 {
var %list $addtok(%list,$line(@.,%i),44)
inc %i
}
msg $1 Top $calc(%i - 1) DJ's on $1 are:4 $replace(%list,$chr(44),$+($chr(44),$chr(32)))
window -c @.
}
on *:text:!skip*:#:{
if ($readini(channels.ini,$chan,request) == on) {
if ($chan == #sjet4all) {
halt
}
if (%brrflood. [ $+ [ $nick ] ] $+ ) {
notice $nick AntiFlood is enabled 60 secs ignore :)
halt
}
if (!%brrflood. [ $+ [ $nick ] ] $+ ) {
inc -u60 %brrflood. [ $+ [ $nick ] ]
/msg # 6Grrrr SKIP this song, %sc.dj. [ $+ [ $chan ] ] :p
if (%sc.dj. [ $+ [ $chan ] ] == Non-Stop) { halt }
elseif ($readini(channels.ini,$chan,requestpoints) == on) {
if (!$2) {
writeini -n Points.ini $+(#,.,%sc.dj. [ $+ [ $chan ] ]) Points $calc($readini(Points.ini,$+(#,.,%sc.dj. [ $+ [ $chan ] ]),Points) - 1)
if ($read($+(kritiek/kritiek.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt)) == $null) {
/msg # 6 $+ %sc.dj. [ $+ [ $chan ] ] has no down reasons!
}
else {
msg # 6Random reason:4 $read($+(kritiek/kritiek.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt),n) 6nr:7 $readn $+ / $+ $lines($+(kritiek/kritiek.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt))
}
msg # 6 $+ %sc.dj. [ $+ [ $chan ] ] has now7 $readini(Points.ini,$+(#,.,%sc.dj. [ $+ [ $chan ] ]),Points) 6points.
}
else {
writeini -n Points.ini $+(#,.,%sc.dj. [ $+ [ $chan ] ]) Points $calc($readini(Points.ini,$+(#,.,%sc.dj. [ $+ [ $chan ] ]),Points) - 1)
/msg # 6 $+ %sc.dj. [ $+ [ $chan ] ] has now7 $readini(Points.ini,$+(#,.,%sc.dj. [ $+ [ $chan ] ]),Points) 6points.
if ($2- !isin $read($+(kritiek/kritiek.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt), nw, * $+($2-)*, $readn)) {
write $+(kritiek/kritiek.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt) $nick $+ : $2-
}
msg # 6Random reason:4 $read($+(kritiek/kritiek.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt),n) 6nr:7 $readn $+ / $+ $lines($+(kritiek/kritiek.,#,.,$+(%sc.dj. [ $+ [ $chan ] ]),.txt))
}
}
}
}
else {
halt
}
}
on *:text:!requestsystem*:#: {
if ($me isop #) {
if (($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) || ($nick == %botowner)) {
if ($2 == help) {
notice $nick $1 on -> Turns on $1
notice $nick $1 topic on -> Turns $1 on with topic change
notice $nick $1 mode on -> Sets $1 on with mode changes
notice $nick $1 points on -> Turns $1 on with points with every !brr commando
notice $nick $1 setdj <v|h|o> -> Changes the mode the DJ has to have on the channel (standaard is h(%)
notice $nick $1 settings -> Shows the settings of $1
notice $nick $1 help -> Shows this help
halt
}
if ($2 == settings) {
notice $nick $1 :3 $readini(channels.ini,$chan,request)
if ($readini(channels.ini,$chan,djmode) == on) {
notice $nick DJ-Mode is:3 $readini(channels.ini,$chan,djmode)
}
else { notice $nick DJ-Mode is:4 off }
if ($readini(channels.ini,$chan,setdj) != $null) {
notice $nick $me wil set the DJ on:3 $readini(channels.ini,$chan,setdj)
}
else { notice $nick DJ-Mode is:4 off }
if ($readini(channels.ini,$chan,topic) == on) {
notice $nick Topic mode is:3 $readini(channels.ini,$chan,topic)
}
else { notice $nick Topic mode is:4 off }
if ($readini(channels.ini,$chan,requestpoints) == on) {
notice $nick Pointsystem is:3 $readini(channels.ini,$chan,requestpoints)
}
else { notice $nick Pointsystem is:4 off }
halt
}
if ($2 == mode) && ($3 == on) {
if ($readini(channels.ini,$chan,request) == on) {
/writeini channels.ini $chan djmode on
/writeini channels.ini $chan setdj h
notice $nick DJ-Mode for # is now: $3
notice $nick $me wil set de DJ on halfop(%) # $+ !
notice $nick To change that type: $1 setdj h(for %), o(for @) of v(for +)
halt
}
else { notice $nick $1 is off on # }
}
if ($2 == mode) && ($3 == off) {
/writeini channels.ini $chan djmode off
notice $nick DJ-Mode for # is now: $3
halt
}
if ($2 == points) && ($3 == on) {
if ($readini(channels.ini,$chan,request) == on) {
/writeini channels.ini $chan requestpoints on
notice $nick Points are now enabled on # $+ : $3
notice $nick For each !brr the DJ will get 1 point
notice $nick For each !skip 1 point wil go off with the current DJ
notice $nick !brr <reason> of !skip <reason>
notice $nick Ops or higher can get the score with !top <numer> or reset the points with !delpoints nickname.
halt
}
else { notice $nick $1 is off on # }
}
if ($2 == points) && ($3 == off) {
/writeini channels.ini $chan requestpoints off
notice $nick Pointssystem is disabled on #
halt
}
if ($2 == topic) && ($3 == on) {
if ($readini(channels.ini,$chan,request) == on) {
/writeini channels.ini $chan topic $4
notice $nick Requestsystem wil now set the topic on #
sc_topic1 $chan
}
else { notice $nick $1 is off on # }
}
if ($2 == setdj) && ($3 == h || $3 == o || $3 == v) {
if ($readini(channels.ini,$chan,request) == on) && ($readini(channels.ini,$chan,djmode) == on) {
/writeini channels.ini $chan setdj $3
notice $nick DJ-Mode for # is now: $3
notice $nick $me will now set the DJ on $readini(channels.ini,$chan,setdj) on # $+ !
halt
}
else { notice $nick $1 is off on # }
}
if ($2 == topic) && ($3 == off) {
/writeini channels.ini $chan topic off
sc_topicoff $chan
}
if ($2 == on || $2 == off) {
/writeini channels.ini $chan request $2
/msg # $1 for $chan is now: $2
if ($2 == on) {
notice $nick Now type !setdj <nickname> to set a DJ, with !unsetdj to set back nonstop
notice $nick Use !request <artist - title> to request a song with the current DJ
notice $nick Enable points with $1 points on
notice $nick typ $1 help for more info
set %sc.dj. [ $+ [ $chan ] ] Non-Stop
}
if ($2 == off) {
if ($readini(channels.ini,$chan,djmode) == on) {
mode # +v %sc.dj. [ $+ [ $chan ] ]
msg chanserv up # %sc.dj. [ $+ [ $chan ] ]
}
/writeini channels.ini $chan topic off
/writeini channels.ini $chan djmode off
/writeini channels.ini $chan requestpoints off
/remini -n channels.ini $chan setdj
notice $nick %sc.dj. [ $+ [ $chan ] ] is unset as DJ on # $+ !
notice $nick $1 is now off on # $+ !
unset %sc.dj. [ $+ [ $chan ] ]
}
}
else { notice $nick Syntax: $1 <on|off|help> }
}
else { notice $nick Access Denied }
}
else {
notice $nick $1 can only work if $me has a minimum of ops(@)!
}
}
on *:join:#: {
if ($me isop #) {
if ($nick == %sc.dj. [ $+ [ $chan ] ]) && ($nick == Non-Stop) {
halt
}
elseif ($nick == %sc.dj. [ $+ [ $chan ] ]) && ($readini(channels.ini,$chan,djmode) == on) {
timermode 1 3 mode # -qohv $nick $nick $nick $nick
timermode2 1 3 mode # + $+ $readini(channels.ini,$chan,setdj) $nick
}
else {
halt
}
}
}
Found it with http://www.msldev.com/, if you are interested, mIRC Scripting IDE. Do note, mSLDev is a lot more stricter than mIRC in scripting syntax.
I see :) thnx for reporting..
Changed it :>