RequestSystem

By DjSxX on Oct 30, 2014

This is a requestsystem I wrote,
Its in dutch and even working with the new system of Anope 2
You can set the DJ, it wil make him/her an halfop (%) even when he/she is an owner on the channel
It wil also set the topic with the current DJ that has been set (topic lock should be off)
Syntax: !setdj nickname

When you unset the DJ, it wil set the rights back from where he was (if he was an owner it wil set it back to owner)
Syntax: !unsetdj with/without nickname

Current syntax for the requestsystem: !request Artist - title
But that you can easy adjust
It wil simply send the request to the setted DJ you did with !setdj
It also checks if the Setted DJ is on the channel
If the DJ falls of the channel and is comming back, it wil set him back to halfop (%)

I also know its badly written, but for me it works
To let the requestsystem work, type:
!requestsystem on

alias sc_topic1 { 
  topic $1 1,1..8,8..4,4..0,7 $1 $chr(124) Current DJ: %sc.dj. [ $+ [ $1 ] ]  $chr(124) $1 4,4..0,0..12,12.. 
}

alias sc_topicoff { 
  topic $1 1,1..8,8..4,4..0,7 $1 $chr(124) Current DJ: RequestSystem OFF  $chr(124) $1  4,4..0,0..12,12.. 
}

on *:text:!setdj*:#: {
  if ($me isop #) {
    if ($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) && ($2 ison #) {
      timerdehop 1 1 mode # -hv %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 msg # $nick $+ , %sc.dj is now ready and wil be taken over by $2 :) | msg #gbc %sc.dj is now ready and wil be taken over by $2 $+ !
      timersetdj2 1 1  set %sc.dj. [ $+ [ $chan ] ] $2
      timertopic 1 2 sc_topic1 $chan
      timermode1 1 2 mode # -qaoh $2 $2 $2 $2
      timermode2 1 2 mode # +h $2
      timermsg1 1 2 msg # $nick $+ , $2 has been set as DJ on # $+ !
      timermsg2 1 2 msg #gbc  $2 has been set as DJ on $chan $+ !
    }
    elseif ($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) && ($2 !ison #) { msg # $nick $+ , $2 is not on # }
    else { msg # $nick $+ , 4ErroR You don't have rights on # $+ ! }
  }
  else {
    notice $nick $me has no rights, $me needs atleast @ (ops) to function!
    notice $nick If you give $me ~ (owner) , $+ $me could fully function.
  }
}

on *:text:!unsetdj*:#: {
  if ($me isop #) {
    if ($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) && ($2 ishop #) {
      set %sc.dj. [ $+ [ $chan ] ] Non-Stop DJ
      timertopic 1 1 sc_topic1 $chan
      timermode 1 1 mode # -hv $2 $2
      ;timervop 1 1 mode # +v $2
      timerup 1 1 msg chanserv up # $2
      timermsg 1 1 msg # $nick $+ , $2 is no longer DJ on # $+ !
      timermsg 1 1 msg #gbc $nick $+ , $2 is no longer DJ on # $+ !
    }
    elseif ($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) && (!$2) { 
      msg # %sc.dj. [ $+ [ $chan ] ] is no longer DJ on # $+ !
      msg #gbc %sc.dj. [ $+ [ $chan ] ] is no longer DJ on # $+ !
      timermode 1 1 mode # -hv %sc.dj. [ $+ [ $chan ] ] %sc.dj. [ $+ [ $chan ] ]
      ;timervop 1 1 mode # +v %sc.dj. [ $+ [ $chan ] ]
      timerup 1 1 msg chanserv up # %sc.dj. [ $+ [ $chan ] ]
      timerset 1 2 set %sc.dj. [ $+ [ $chan ] ] Non-Stop DJ
      timertopic 1 2 sc_topic1 $chan
      ;timermsg 1 2 msg %irc.chan,#gbc $2 is nu afgesteld als DJ op %irc.chan $+ !
    }
    elseif ($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) && ($2 !ison #) { msg # $nick $+ , $2 is not on # $+ ! }
    else { msg # $nick $+ , You dont have rights on # $+ ! }
  }
  else {
    notice $nick $me has no rights, $me needs atleast @ (ops) to function!
    notice $nick If you give $me ~ (owner) , $+ $me could fully function.
  }
}
on *:text:!request *:#:{ if ($readini(channels.ini,$chan,request) == on) {
    if (%verzoekflood. [ $+ [ $nick ] ] $+ ) {
      notice $nick Please 1 request per 3 minutes :)
      msg #gbc $nick flood with 4!request $2-  
      halt 
    }
    if (!%verzoekflood. [ $+ [ $nick ] ] $+ ) { 
      inc -u180 %verzoekflood. [ $+ [ $nick ] ] {
        if (!$2) { 
          msg # $nick $+ , Syntax is: !request  <artist - song>
          halt 
        }
        if (%sc.dj. [ $+ [ $chan ] ] == Non-Stop DJ) { 
          msg # $nick $+ , Currently playing %sc.dj. [ $+ [ $chan ] ] $+ ! 
          halt 
        }
        if (%sc.dj. [ $+ [ $chan ] ] !ison #) {
          msg # $nick $+ , Sorry %sc.dj. [ $+ [ $chan ] ] is not on # rightnow :( 
          halt 
        }
        if ($regex($nick($chan,%sc.dj. [ $+ [ $chan ] ] $+ ).pnick,/(!|~|&|@|%)/)) { 
          msg # DJ %sc.dj. [ $+ [ $chan ] ] $+ , spin that shit around and turn that request from 4 $nick 1 
          msg %sc.dj. [ $+ [ $chan ] ] 4[ReQuest] $2- $+  Requested by 11,1 $+ $nick $+  at 4 $+ $asctime(HH:nn:ss)
          msg #gbc 4[ReQuest] $2- $+  has been requested by 11,1 $+ $nick $+  at 4 $+ $asctime(HH:nn:ss) 
          notice $nick Your request 11,1 $2-  is deliverd at %sc.dj. [ $+ [ $chan ] ] 
          halt 
        }
        else { 
          msg # $nick $+ , $2 is not a DJ on #  
        }
      }
    }
  }
}

on *:text:!resetverzoek*:#:{
  if ($nick isop #) {
    if (!$2) {
      unset %verzoekflood. [ $+ [ $nick ] ]
      notice $nick Flood resetted
      halt
    }
    if ($2) && (!%verzoekflood. [ $+ [ $2 ] ] $+ ) {
      notice $nick $2 can still do requests
      halt
    }
    if ($2) && (%verzoekflood. [ $+ [ $2 ] ] $+ ) {
      unset %verzoekflood. [ $+ [ $2 ] ]
      notice $nick $2 Flood resetted
      notice $2 $nick has resetted your floodprotection
      halt
    }
  }
  else {
    msg # Sorry $nick $+ , you can't reset floodprotection.
    halt
  }
}

on *:text:!requestsystem*:#: {
  if ($me isop #) {
    if ($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) {
      if ($2 == on || $2 == off) {
        /writeini channels.ini $chan request $2
        /msg # RequestSystem for $chan is: $2 
        if ($2 == on) { 
          /msg # Now use !setdj nickname to set a DJ. Use !unsetdj to set NONStop .
          /msg # Users now can request by !request artist - titel.
          set %sc.dj. [ $+ [ $chan ] ] Non-Stop DJ
          sc_topic1 $chan
        }
        if ($2 == off) {
          mode # +v %sc.dj. [ $+ [ $chan ] ]
          /msg chanserv up # %sc.dj. [ $+ [ $chan ] ]
          msg # %sc.dj. [ $+ [ $chan ] ] is set off as DJ on # $+ !
          unset %sc.dj. [ $+ [ $chan ] ]
          sc_topicoff $chan
        }
      }
      else { notice $nick Use: !request <on/off>  }
    }
    else { notice $nick Access Denied }
  }
  else {
    notice $nick Request will work if $me has atleast @ (ops)!
  }
}

on *:join:#: {
  if ($me isop #) {
    if ($nick == %sc.dj. [ $+ [ $chan ] ] $+ ) {
      timermode 1 3 mode # -qohv $nick $nick $nick $nick
      timermode2 1 3 mode # +h $nick
    }
    else { 
      halt
    }
  }
}

Comments

Sign in to comment.
^WeSt   -  Oct 30, 2014

It would be good if you could translate it to english language, because here we are not all from dutch, english everybody know's

DjSxX  -  Oct 30, 2014

That was a good point, I hope the translation is any good ;)

CrazyDriver  -  Nov 04, 2014

I tried to do this via mIRC but when I do !requestsystem on it won't read !request <artist - title> as it's just keeps asking to turn request on/off...

Could you tell me what i'm doing wrong or could you see if you missed anything out of the script? thanks! :)

DjSxX  -  Nov 04, 2014

Are you having @ or higher ur self? Then it should work otherwise !requestsystem on then u can use !request

CrazyDriver  -  Nov 04, 2014

Already tried that and i was the owner of the room, already tried different ways by having re-op'd myself but still gave errors in the script and wouldn't want to use the !request <artist - title> as it kept on going back to stage 1

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.