Event script Automessage and Lookup

By Bielie on Dec 17, 2010

Event spam snippet:

You can set/unset events. You can set spam message on/off.

Check !event help after submitting the snippet in your remote with alt+r thank you ;)

;;;;;;****************************;;;;;;
;;;;; Event script by Bielie 2010© ;;;;;
;;;;;;............................;;;;;;

on $*:text:/^[!.@]event/i:#:{
  tokenize 32 $strip($1-)
  if (%floody [ $+ [ $nick ] ]) { halt }
  set -u3 %floody [ $+ [ $nick ] ] $true

  if ($acc.num($chan,$nick) >= 1) {
    if ($2 == $null) {
      if (!%event [ $+ [ $chan ] ]) { notice $nick There is no event set for $chan $+ . | halt }
      notice $nick The current event for $chan is set to: %event [ $+ [ $chan ] ]
      halt 
    }
    if ($2 == help) {
    notice $nick Event Help: !event set/clear <event> -> Sets or clears an event. -- !event spam on/off <delay in seconds> -> Will spam the event info every <delay seconds> or will turn it off. | halt }
  }

  if (!$acc.num($chan,$nick) >= 3) { halt }

  if ($2-3 == spam off) { 
    if (!%eventspam [ $+ [ $nick ] ]) { /notice $nick The eventspam option is already off! | halt }  
  notice $nick The eventspam option is now turned OFF. | $+(timer,$chan) off | unset %eventspam [ $+ [ $chan ] ] | halt }

  if ($2-3 == spam on) { 
    if (!$4) { notice $nick Please provide the delay in seconds. Syntax: !event spam on <delay in seconds> | halt }
    else { 
      if (%eventspam [ $+ [ $nick ] ]) { The eventspam option is already on! | halt }   
      if (!%event [ $+ [ $chan ] ]) { notice $nick There is no event set for $chan $+ . | halt }
      if ($4 !isnum) { notice $nick Please use only numbers. The delay you entered was $4 $+ . Wich isnt correct. | halt }
      if ($4 <= 29) { notice $nick I wont spam with less then 30 seconds delay. | halt }
      notice $nick The eventspam option has been turned ON for channel $chan (The message will repeat every $4 seconds!)  
      $+(timer,$chan) 0 $4 /msg $chan The current event for $chan is:  %event [ $+ [ $chan ] ] 
      set %eventspam [ $+ [ $chan ] ] on     
      halt
    }
  }
  if ($2 == clear) {
    if (!%event [ $+ [ $chan ] ]) { notice $nick There is no event set for $chan $+ . | halt }
    else { unset %event [ $+ [ $chan ] ] | $+(timer,$chan) off | notice $nick The event for $chan has been cleared. | return }
    notice $nick You have no rights to do that!
    halt
  }
  if ($2 == set) {
    if (!$3) { notice $nick Please provide what event you want to set. Syntax: !event set <event> | halt }
    if (%event [ $+ [ $chan ] ]) { notice $nick There is already a event set for $chan $+ . Unset it with !event clear. | halt }
    else { set %event [ $+ [ $chan ] ] $3- $+ . ( $+ Set by $nick $+ ) | notice $nick The event for $chan has been set. ( $+ $3- $+ ) | return }     
    notice $nick You have no rights to do that!
    halt
  }  
  else { notice $nick The command you tried to trigger isnt correct. (You entered: $1- $+ ) Check !event help for more info. | halt }
}

alias acc.num {
  if ($1 ischan) {
    if ($2 ison $1) {
      var %pre = $remove($nick($1,$2).pnick,$2)
      ; 0 = Reg; 1 = Voice; 2 = HOp; 3 = Op; 4 = SOp; 5 = Founder
      if ($prop == pre) return %pre
      if ($prop == p) return $left(%pre,1)
      if (~ isin %pre) || ($1 isowner $2) return 5
      elseif (& isin %pre) return 4
      elseif (@ isin %pre) || ($1 isop $2) return 3
      elseif (% isin %pre) || ($1 ishop $2) return 2
      elseif (+ isin %pre) || ($1 isvo $2) return 1
      else return 0
    }
  }
}

Comments

Sign in to comment.
Jethro   -  Dec 23, 2010

Yes, you have done it correctly. And good work, Bielie.

 Respond  
Bielie   -  Dec 23, 2010

Jethro_ i dont know how to use tokensize so tell me if i did it wrong. Btw that line you mentioned is to make sure only 1 bot of my scons reacts on a trigger. I deleted it since it doesnt applies for public use indeed. Just something i forgot to delete after testing ;)

 Respond  
Jethro   -  Dec 22, 2010

Bilie, What is this?> if ($me != Snuffy) && ($chan == #Snuffy) { return }Once you submit a snippet, be sure it's suitable for the general public. Also, add

tokenize 32 $strip($1-)

under the text event. Then remove the S modifier from the regex.

 Respond  
Bielie   -  Dec 22, 2010

I didnt get a thing of what you said.. But ok thanks i guess ;)

 Respond  
macs-rock   -  Dec 18, 2010

yeh this code is cool i think you did well 1 thing you did well i know all the code from the description and i will use this code

 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.