small msg prot/anti query spam

By ch0ob3r on Oct 12, 2007

a simple small bit of code that allows u to control who messages you and who doesnt,.with auto ignore, memorise nicks, and a restore to default option

on ^*:text:*:?: {
  if (%msg.prot == on) {
    if (%msg. [ $+ [ $nick ] ] == $null) {
      inc -u10 %m. [ $+ [ $nick ] ]
      if (%m. [ $+ [ $nick ] ] == 1) { msg $nick Sorry I am currently not accepting query's (ask me in a main channel first) }
      if (%m. [ $+ [ $nick ] ] == 4) { notice $nick 14(4bad14)15: you have been auto added to ignore for7 4515secs for 094 unwanted queries | ignore -u45 $1 }
    }
  }
}
menu Query,nicklist {
  msg prot
  .$iif(%msg.prot == on,Turn Off):set %msg.prot off
  .$iif(%msg.prot == off,turn on):set %msg.prot on
  .$iff(%msg.prot == $null,turn on):set %msg.prot on
  .-
  .allow user:set %msg. [ $+ [ $1 ] ] ok | echo -a 14(9added14)15: $1 is now able to message you. | notice $1 14(9accepted14)15 You have now been added, and private messages will now be accepted.
  .disallow user:unset %msg. [ $+ [ $1 ] ] | echo -a 14(4removed14)15: $1 is now unable to message you. 
  .-
  .restore default:unset %msg.*
}

Comments

Sign in to comment.
ch0ob3r   -  Oct 18, 2007

thx for the input guys..lol i realise its pretty basic i actually put it together for a mate and decided to chuck it on here in case he ever lost it =P

 Respond  
guest598594   -  Oct 16, 2007

yea i was thinkin the same thing, groups would be better than variables

 Respond  
Kyousoukyoku   -  Oct 16, 2007

Hmm, this isn\'t really a spam detector or anything, just a query blocker. If you meant to make it a query blocker, why not just decline all messages? You should also include the on *:open event. When first opening queries. Then you wouldn\'t have to use the on text event at all.

@ the code, you aren\'t unsetting variables, and why not store these nicks in an ini file or txt file and use $read/$readini to check? It\'d be pretty cool to include a dialog, but that isn\'t imperative. One last thing, you should use groups to disable/enable the snippet. ;)

 Respond  
guest598594   -  Oct 16, 2007

maybe u can use an $iif for allow/disallow

.$iif($+(%msg.,$1),Allow,Disallow):{
  if ($+(%msg.,$1)) {
    set $+(%msg.,$1) on
    echo whatever
  }
  else unset $+(%msg.,$1)
}
 Respond  
Anti   -  Oct 16, 2007

coding nice

 Respond  
Tippy   -  Oct 14, 2007

Good job I like it maybe you should make a Ignore with it.I can also help you with coding if you want :) I am making a Bot right now so maybe you could help me sometime our maybe I can give you some stuff.

 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.