Mushufasa's Event Script V1.5 (Multi-Event)

By Mushufasa on Jul 03, 2007

Well this is a basic event script which I decided to turn into something a little better. Instead of just having 1 single event with !setevent !event and !delevent for example, it stores an event for each day of the week.

This was initially designed to set events for a RuneScape clan I belong to on the swiftIRC network, but of course you can edit it to any needs you might have. O.O

!addevent
!event
!unset

the above are the parameters for the script. Its not fully finished but this does work and serve for now. As I finish it...Probably tomorrow or something I'll update this snippet more, for anyone who cares or bothers to read this. -shrug-

note; theres probably a lot better way to do this but this is just a nice way that works for me. Any 'constructive' comments welcome.
note2; there are messages shown if the syntax is not met, it will not just 'not respond'
note3; there may be a couple errors as I deleted parts such as nicks for privacy reasons. If there are please comment so I can a) add it into this script and b) see if it's missing from my personal script.
note4; @event to come, for use with nicknames and generally a more overall 'better look' - man my English owned.
note5; any ideas are also welcome.

Thanks for reading. :)

Edit: V1.4 - @event added, only halfops or ops can use @event. Also I fixed a small problem with the !unset part, thanks to Lindrian for that. O.O (!unset has been generally redesigned)

Edit: V1.5 !/@event can now be used without the use of a after. Using !/@Event will give the current days event, as well as the date. If no event has been set then it will display "No event set." Also fixed a couple channel issues as well as removed #the.m from the on TEXT:!unset:#: { part.
Note: V1.5 copied and pasted from Remotes, whole snippet wasn't transferred, if you find any errors, please leave a comment so I can edit it immediatly. Also note than my personal snippet is working 100% correctly.

on *:TEXT:!addevent*:#: {
  if ($nick !isop $chan) && ($nick !ishop $chan) { notice $nick Sorry, you must be a halfop or an op to set the event. }
  elseif ($nick isop $chan) || ($nick ishop $chan) && ($2 !iswm monday) && ($2 !iswm tuesday) && ($2 !iswm wednesday) && ($2 !iswm thursday) && ($2 !iswm friday) && ($2 !iswm saturday) && ($2 !iswm sunday) { notice $nick To add an event please type !addevent <name of the day the event takes place> <event>. For example; !addevent monday [Castle Wars] 8pm GMT time, meet in the lobby on World 48. Don't forget !time. }
;;!time is a different script my bot has - sorry I got this straight from my remotes.
  else { 
    if (!$3) { notice $nick Please choose an event to add. }
    else { set % $+ $2 $+ news. $3- | msg #chan The Clan event for $2 has been set! Type !event $2 to see it! Event set by $nick $+ . }
  }
}

on *:TEXT:!event*:#: {
  if (!$2) {
    if ($day == Monday) {
      if (%mondaynews == $null) { notice $nick Date: Monday $date $+ : No event set. }
      else { notice $nick Date: Monday $date $+ : %mondaynews }
    }
    elseif ($day == Tuesday) {
      if (%tuesdaynews == $null) { notice $nick Date: Tuesday $date $+ : No event set. }
      else { notice $nick Date: Tuesday $date $+ : %tuesdaynews }
    }
    elseif ($day == Wednesday) {
      if (%wednesdaynews == $null) { notice $nick Date: Wednesday $date $+ : No event set. }
      else { notice $nick Date: Wednesday $date $+ : %wednesdaynews }
    }
    elseif ($day == Thursday) {
      if (%thursdaynews == $null) { notice $nick Date: Thursday $date $+ : No event set. }
      else { notice $nick Date: Thursday $date $+ : %thursdaynews }
    }
    elseif ($day == Friday) {
      if (%fridaynews == $null) { notice $nick Date: Friday $date $+ : No event set. }
      else { notice $nick Date: Friday $date $+ : %fridaynews }
    }
    elseif ($day == Saturday) {
      if (%satdaynews == $null) { notice $nick Date: Saturday $date $+ : No event set. }
      else { notice $nick Date: Saturday $date $+ : %satdaynews }
    }
    elseif ($day == Sunday) {
      if (%sundaynews == $null) { notice $nick Date: Sunday $date $+ : No event set. }
      else { notice $nick Date: Sunday $date $+ : %sundaynews }
    }
  }
  elseif ($2 !iswm monday) && ($2 !iswm tuesday) && ($2 !iswm wednesday) && ($2 !iswm thursday) && ($2 !iswm friday) && ($2 !iswm saturday) && ($2 !iswm sunday) { notice $nick To see the event please type !event <day> for example; !event Monday will show Monday's event. }
  elseif ($nick ison #chan) || ($nick == One-Winged-Angel) || ($nick == Ricketts) && ($2 == monday) { 
    if %mondaynews. == $null { notice $nick No event set for Monday. }
    else { notice $nick %mondaynews. }
  }
  elseif ($nick ison #chan) || ($nick == One-Winged-Angel) || ($nick == Ricketts) && ($2 == tuesday) { 
    if %tuesdaynews. == $null { notice $nick No event set for Tuesday. }
    else { notice $nick %tuesdaynews. }
  }
  elseif ($nick ison #chan) || ($nick == One-Winged-Angel) || ($nick == Ricketts) && ($2 == wednesday) { 
    if %wednesdaynews. == $null { notice $nick No event set for Wednesday. }
    else { notice $nick %wednesdaynews. }
  }
  elseif ($nick ison #chan) || ($nick == One-Winged-Angel) || ($nick == Ricketts) && ($2 == thursday) { 
    if %thursdaynews. == $null { notice $nick No event set for Thursday. }
    else { notice $nick %thursdaynews. }
  }
  elseif ($nick ison #chan) || ($nick == One-Winged-Angel) || ($nick == Ricketts) && ($2 == friday) { 
    if %fridaynews. == $null { notice $nick No event set for Friday. }
    else { notice $nick %fridaynews. }
  }
  elseif ($nick ison #chan) || ($nick == One-Winged-Angel) || ($nick == Ricketts) && ($2 == saturday) { 
    if %saturdaynews. == $null { notice $nick No event set for Saturday. }
    else { notice $nick %saturdaynews. }
  }
  elseif ($nick ison #chan) || ($nick == One-Winged-Angel) || ($nick == Ricketts) && ($2 == sunday) { 
    if %sundaynews. == $null { notice $nick No event set for Sunday. }
    else { notice $nick %sundaynews. }
  }
  else { notice $nick Sorry, you don't appear to be on my databse for event. If you are a member of The Marauders and you are seeing this message please type /msg Nero-The-Sable Error see event. Thank you. }
}
;;You can add more nicknames to the allow list by using || ($nick == <nick>) I deleted most the list as not to show people's IRC names.

on *:TEXT:!unset*:#: {
  if ($nick isop #) || ($nick ishop #) {
    if (!$2) { notice $nick Please choose a variable to be unset. Available variables are; % $+ mondaynews % $+ tuesdaynews % $+ wednesdaynews % $+ thursdaynews % $+ fridaynews % $+ saturdaynews % $+ sundaynews }
    elseif ($2 iswm % $+ mondaynews) || ($2 iswm % $+ tuesdaynews) || ($2 iswm % $+ wednesdaynews) || ($2 iswm % $+ thursdaynews) || ($2 iswm % $+ fridaynews) || ($2 iswm % $+ saturdaynews) || ($2 iswm % $+ sundaynews) { 
      msg $chan  $2 has been unset.
      unset $2
    }
    else { notice $nick Please choose a valid variable to be unset. Variables are; % $+ mondaynews % $+ tuesdaynews % $+ wednesdaynews % $+ thursdaynews % $+ fridaynews % $+ saturdaynews % $+ sundaynews }
  }
  elseif ($nick !isop #) && ($nick !ishop #) { notice $nick Sorry, only halfops and ops can unset events. }
}

on *:TEXT:@event*:#: {
  if ($nick !isop #) && ($nick !ishop #) { notice $nick Sorry, only halfops and ops can use @event. Please try !event instead. }
  elseif ($nick isop #) || ($nick ishop #) && ($2 !iswm monday) && ($2 !iswm tuesday) && ($2 !iswm wednesday) && ($2 !iswm thursday) && ($2 !iswm friday) && ($2 !iswm saturday) && ($2 !iswm sunday) || (!$2) { 
    if ($day == Monday) {
      if (%mondaynews == $null) { msg $chan Date: Monday $date $+ : No event set. }
      else { msg $chan Date: Monday $date $+ : %mondaynews }
    }
    elseif ($day == Tuesday) {
      if (%tuesdaynews == $null) { msg $chan Date: Tuesday $date $+ : No event set. }
      else { msg $chan Date: Tuesday $date $+ : %tuesdaynews }
    }
    elseif ($day == Wednesday) {
      if (%wednesdaynews == $null) { msg $chan Date: Wednesday $date $+ : No event set. }
      else { msg $chan Date: Wednesday $date $+ : %wednesdaynews }
    }
    elseif ($day == Thursday) {
      if (%thursdaynews == $null) { msg $chan Date: Thursday $date $+ : No event set. }
      else { msg $chan Date: Thursday $date $+ : %thursdaynews }
    }
    elseif ($day == Friday) {
      if (%fridaynews == $null) { msg $chan Date: Friday $date $+ : No event set. }
      else { msg $chan Date: Friday $date $+ : %fridaynews }
    }
    elseif ($day == Saturday) {
      if (%satdaynews == $null) { msg $chan Date: Saturday $date $+ : No event set. }
      else { msg $chan Date: Saturday $date $+ : %satdaynews }
    }
    elseif ($day == Sunday) {
      if (%sundaynews == $null) { msg $chan Date: Sunday $date $+ : No event set. }
      else { msg $chan Date: Sunday $date $+ : %sundaynews }
    }
    else { notice $nick Please try @event <day> to message the channel the event set for that day. }
  }
  elseif ($nick isop #) || ($nick ishop #) && ($2 == monday) {
    if (%mondaynews == $null) { msg $chan No event set for $2 $+ . }
    else { msg $chan %mondaynews }
  }
  elseif ($nick isop #) || ($nick ishop #) && ($2 == tuesday) {
    if (%tuesdaynews == $null) { msg $chan No event set for $2 $+ . }
    else { msg $chan %tuesdaynews }
  }
  elseif ($nick isop #) || ($nick ishop #) && ($2 == wednesday) {
    if (%wednesdaynews == $null) { msg $chan No event set for $2 $+ . }
    else { msg $chan %wednesdaynews }
  }
  elseif ($nick isop #) || ($nick ishop #) && ($2 == thursday) {
    if (%thursdaynews == $null) { msg $chan No event set for $2 $+ . }
    else { msg $chan %thursdaynews }
  }
  elseif ($nick isop #) || ($nick ishop #) && ($2 == friday) {
    if (%fridaynews == $null) { msg $chan No event set for $2 $+ . }
    else { msg $chan %fridaynews }
  }
  elseif ($nick isop #) || ($nick ishop #) && ($2 == saturday) {
    if (%saturdaynews == $null) { msg $chan No event set for $2 $+ . }
    else { msg $chan %saturdaynews }
  }
  elseif ($nick isop #) || ($nick ishop #) && ($2 == sunday) {
    if (%sundaynews == $null) { msg $chan No event set for $2 $+ . }
    else { msg $chan %sundaynews }
  }
}

Comments

Sign in to comment.
Runekas 3   -  Jul 06, 2007

ahh forgot got more good scripts? ;)

 Respond  
Runekas 3   -  Jul 06, 2007

actually it was #the.m i didnt see it in first plcae... :P

 Respond  
Mushufasa   -  Jul 06, 2007

What was it that you edited? Was it an actual problem with the script or just editing things like #the.m and #chan? It worked fine for me, so I guess it was that..Anyways I\'m going to change it slightly in the uncoming days when I\'m not busy getting hastled by my mother. :)

 Respond  
Runekas 3   -  Jul 06, 2007

nvm it works now edited few things :)
Thanx

 Respond  
Runekas 3   -  Jul 05, 2007

its pretty usefull script :)
but if i try to add event (example:!addevent monday f2p pk) it wont add... any help? also what i need to replace there?
Thanx

 Respond  
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.