[request] PM Blocker Rewrite

Do you have script in mind but no ability to make it, type in what it should do, and you might be lucky.

[request] PM Blocker Rewrite

Postby jonlar » Wed Jan 27, 2010 2:35 pm

Hi folks. I have a quit nice (for me) Pm Blocker. The problem is that this Script works with Nicks only, means if i have someone in my accepted list and the user changes his Nick he will be automaticly in the declined list.
So i wanted to ask if some could do a rewrite for me, so the Script will accept nicks always when i put them in the accepted List. Appreciate

The Code - I was searching for the Coder, with no chance to find him/her

Code: Select all
;***********************************
;Q-Apm-blocker V1.4 by Queen-Amidala on DALnet
;Written 10/7/03
;Last Updated 11/12/03
;***********************************


;******************
;DIALOG TABLE CODE
;******************

dialog Q-Apm-blockerV1.4 {
  title "Q-Apm-blocker v1.4"
  size -1 -1 131 117
  option dbu
  box "Manual Controls", 12, 62 66 66 32
  combo 8, 5 13 54 84, size drop
  list 1, 5 26 54 89, size extsel vsbar
  list 2, 74 13 54 52, sort size extsel vsbar
  text "Channel List", 3, 7 3 32 8
  text "My Accept List", 4, 74 3 43 8
  edit "", 10, 68 74 54 10, autohs
  button "Add", 11, 68 85 20 9
  button "Del", 7, 89 85 20 9
  button "->", 5, 61 26 11 10
  button "", 9, 999 999 0 0, hide disable cancel
  text "By Queen-Amidala", 13, 64 108 46 8
  icon 6, 112 100 15 15,  $scriptdirqaicon.jpg, 0
}




;*************************************************************
;FIRST-TIME LOAD COMMAND(S) TO ALLOW YOU TO SET YOUR PM REPLY
;*************************************************************

on *:LOAD:{
  echo -s 14[13Q-Apm-blocker v1.414] loaded successfully! Thank you for trying this script. Please direct any questions/comments or concerns to Queen-Amidala on DALnet. (queenie@gobbly.net)
  set %pmblocker.reply $$?="Welcome to Q-Apm-blocker V1.4! Since this is the first time you have loaded this script, you need to configure your reply setting. Below, please enter a sentence that you would like automatically sent to users that are not on your accept list when they private message you to let them know that you will not be accepting their message. Example: I do not accept private messages from people I don't know, lamer. Please try to reach me in #Helpdesk instead. This can be set to whatever you want."
}



;**************
;INIT COMMANDS
;**************

on *:dialog:Q-Apm-blockerV1.4:init:*: {
  ;LOOPS THRU YOUR CHANNELS AND FILLS THE DROP DOWN BOX WITH CHANNELS
  var %loop = 1
  while (%loop <= $chan(0)) {
    did -a $dname 8 $chan(%loop)
    if ($chan(%loop) == $active) { did -c $dname 8 %loop }
    inc %loop
  }
  ;FILLS YOUR NICK LIST AND ACCEPT LIST
  fillnick $dname
  fillaccept $dname
}


;NICKLIST ADD BUTTON
on *:dialog:Q-Apm-blockerV1.4:sclick:5: {
  auser friends $did(q-apm-blockerV1.4,1).seltext
  fillaccept $dname
}


;MANUAL DELETE BUTTON
on *:dialog:Q-Apm-blockerV1.4:sclick:7:{
  ruser friends $did($dname,2).seltext 
  fillaccept $dname
}


;COMBO DROP-DOWN BOX
on *:dialog:Q-Apm-blockerV1.4:sclick:8: {
  fillnick $dname
}


;MANUAL ADD BUTTON
on *:dialog:Q-Apm-blockerV1.4:sclick:11: { 
  auser friends $did(q-apm-blockerV1.4,10).text
  fillaccept $dname
  did -r $dname 10
}





;********
;ALIASES
;********

;FILLS YOUR ACCEP LIST
alias -l fillaccept {
  did -r $$1 2
  var %i = 1
  while (%i <= $ulist(*,friends,0)) {
    did -a $$1 2 $ulist(*,friends,%i)
    inc %i
  }
}

;FILLS YOUR NICK LIST
alias -l fillnick {
  did -r $$1 1
  var %loop = 1
  while (%loop <= $nick($did($$1,8).seltext,0)) {
    did -a $$1 1 $nick($did($$1,8).seltext,%loop)
    inc %loop
  }
}


;******************************************************************
;OPENS A @BLOCKpm WINDOW SO YOU CAN TRACK/VIEW USER'S INFORMATION
;******************************************************************
;WHEN YOU RECEIVE A PM, IF THE USER IS ON YOUR ACCEPT LIST YOU WILL GET THEIR QUERY
;WINDOW AS NORMAL. IF THE PERSON IS NOT ON YOUR ACCEPT LIST, THEY WILL AUTOMATICALLY
;RECEIVE A PM BACK FROM YOU STATING THE SENTENCE YOU SET WHEN YOU LOADED THIS SCRIPT,
;TELLING THEM YOU DO NOT ACCEPT PM'S FROM UNAUTHORIZED PEOPLE. YOU WILL ALSO GET A
;WINDOW CALLED @BLOCKPM THAT POPS UP, AND KEEPS TRACK OF ALL UNAUTHORIZED PM'S THAT
;YOU RECEIVE. THIS IS MERELY SO YOU CAN TRACK THE PEOPLE THAT ARE PM'ING YOU, AND WHAT
;CHANNEL THEY ARE "SPAMMING" YOU FROM.  YOU CAN ALSO SEE THEIR MESSAGE, JUST IN CASE
;IT'S IMPORTANT. UPON THEIR PM, THEY ARE AUTOMATICALLY ADDED TO YOUR IGNORE LIST FOR 20
;SECONDS, AND THEN AUTOMATICALLY BE REMOVED. AS WELL, ANYTHING THAT ENDS UP IN YOUR
;@BLOCKPM WINDOW WILL ALSO BE WRITTEN TO A LOG FILE IN WHATEVER DIRECTORY THIS SCRIPT
;WAS LOADED FROM TITLED BLOCKEDPMS.TXT IN CASE YOU NEED TO REFER TO IT IN THE FUTURE.

on ^friends:open:?:*:{ query -n $nick | echo $color(normal) -lmt $nick $+(<, $nick, >) $1- | haltdef }
on ^*:OPEN:?:*:{
  if (!$halted) && ($nick != -psybnc) {
    if (!$window(@blockPM)) { window -n @blockPM }
    aline -h @blockPM $str(-,20)
    aline @blockPM nick: $nick
    aline -p @blockPM message: $strip($1-)
    aline @blockPM time: $date $realtime
    aline @blockPM address: $fulladdress
    var %loop = $comchan($nick,0)
    while (%loop) {
      var %list = %list $comchan($nick,%loop)
      dec %loop
    }
    if (%list) { aline @blockPM channels: %list }
    aline @blockPM $str(-,20)
    if (!%pmblocker. [ $+ [ $nick ] ]) && ((*http://*.* !iswm $1-) || (*www.* !iswm $1-) || (* free * !iswm $1-)) {
      .msg $nick %pmblocker.reply
      ignore -pu20 $nick
      set -u10 %pmblocker. $+ $nick $true
    }
    elseif (%list) {
      echo 13 -a $nick spammed you in %list
    }
    write $scriptdirBLOCKEDpms.txt $timestamp < $+ $nick $+ > ( $+ $address $+ ) $1-
    halt
  }
}





;****************
;MENU LIST POPUP
;****************

menu status,nicklist,channel {
  $iif(!$dialog(Q-Apm-blockerv1.4),Q-Apm-blockerv1.4) : dialog -md Q-Apm-blockerv1.4 Q-Apm-blockerv1.4
}



;****************************************
;WEBSITE: http://home.gobbly.net/~queen/
;EMAIL: queenie@gobbly.net
;NETWORK: DALnet
;CHANNEL: #Helpdesk
;****************************************
jonlar
 

Re: [request] PM Blocker Rewrite

Postby PuNkTuReD » Wed Feb 03, 2010 12:56 am

Add this to your existing code
Code: Select all
on *:nick:*: {

  ; check if the user is in your users list with the level of "friends"
  if ($ulist($nick) && $level($nick) == friends) {

    ; add the new nick
    auser friends $newnick

    ; uncomment out the next line to delete the old nick
    ; ruser friends $nick
  }

}
PuNkTuReD
 

Re: [request] PM Blocker Rewrite

Postby jonlar » Sat Feb 06, 2010 4:39 pm

Cheers, but i get this after adding a nick and closing the PM blocker

error: unknown command ( *: )


Ahh i get this always if someone in a chan is changing his nick. but wouldnt it be better if the script just reacts if someone from my list is changing his nick?
jonlar
 

Re: [request] PM Blocker Rewrite

Postby PuNkTuReD » Mon Feb 08, 2010 12:33 am

Ahh i get this always if someone in a chan is changing his nick. but wouldnt it be better if the script just reacts if someone from my list is changing his nick?


check that you have copied the snippet i posted correctly, i dont think you have.

and yes, if pasted correctly, the script WILL only react when someone on your list changes nicks.
thats what this line is for
Code: Select all
  ; check if the user is in your users list with the level of "friends"
  if ($ulist($nick) && $level($nick) == friends) {


by the looks of it, its just a simple, copy/paste error.
please try again

Code: Select all
;***********************************
;Q-Apm-blocker V1.4 by Queen-Amidala on DALnet
;Written 10/7/03
;Last Updated 11/12/03
;***********************************


;******************
;DIALOG TABLE CODE
;******************

dialog Q-Apm-blockerV1.4 {
  title "Q-Apm-blocker v1.4"
  size -1 -1 131 117
  option dbu
  box "Manual Controls", 12, 62 66 66 32
  combo 8, 5 13 54 84, size drop
  list 1, 5 26 54 89, size extsel vsbar
  list 2, 74 13 54 52, sort size extsel vsbar
  text "Channel List", 3, 7 3 32 8
  text "My Accept List", 4, 74 3 43 8
  edit "", 10, 68 74 54 10, autohs
  button "Add", 11, 68 85 20 9
  button "Del", 7, 89 85 20 9
  button "->", 5, 61 26 11 10
  button "", 9, 999 999 0 0, hide disable cancel
  text "By Queen-Amidala", 13, 64 108 46 8
  icon 6, 112 100 15 15,  $scriptdirqaicon.jpg, 0
}




;*************************************************************
;FIRST-TIME LOAD COMMAND(S) TO ALLOW YOU TO SET YOUR PM REPLY
;*************************************************************

on *:LOAD:{
  echo -s 14[13Q-Apm-blocker v1.414] loaded successfully! Thank you for trying this script. Please direct any questions/comments or concerns to Queen-Amidala on DALnet. (queenie@gobbly.net)
  set %pmblocker.reply $$?="Welcome to Q-Apm-blocker V1.4! Since this is the first time you have loaded this script, you need to configure your reply setting. Below, please enter a sentence that you would like automatically sent to users that are not on your accept list when they private message you to let them know that you will not be accepting their message. Example: I do not accept private messages from people I don't know, lamer. Please try to reach me in #Helpdesk instead. This can be set to whatever you want."
}



;**************
;INIT COMMANDS
;**************

on *:dialog:Q-Apm-blockerV1.4:init:*: {
  ;LOOPS THRU YOUR CHANNELS AND FILLS THE DROP DOWN BOX WITH CHANNELS
  var %loop = 1
  while (%loop <= $chan(0)) {
    did -a $dname 8 $chan(%loop)
    if ($chan(%loop) == $active) { did -c $dname 8 %loop }
    inc %loop
  }
  ;FILLS YOUR NICK LIST AND ACCEPT LIST
  fillnick $dname
  fillaccept $dname
}


;NICKLIST ADD BUTTON
on *:dialog:Q-Apm-blockerV1.4:sclick:5: {
  auser friends $did(q-apm-blockerV1.4,1).seltext
  fillaccept $dname
}


;MANUAL DELETE BUTTON
on *:dialog:Q-Apm-blockerV1.4:sclick:7:{
  ruser friends $did($dname,2).seltext 
  fillaccept $dname
}


;COMBO DROP-DOWN BOX
on *:dialog:Q-Apm-blockerV1.4:sclick:8: {
  fillnick $dname
}


;MANUAL ADD BUTTON
on *:dialog:Q-Apm-blockerV1.4:sclick:11: { 
  auser friends $did(q-apm-blockerV1.4,10).text
  fillaccept $dname
  did -r $dname 10
}





;********
;ALIASES
;********

;FILLS YOUR ACCEP LIST
alias -l fillaccept {
  did -r $$1 2
  var %i = 1
  while (%i <= $ulist(*,friends,0)) {
    did -a $$1 2 $ulist(*,friends,%i)
    inc %i
  }
}

;FILLS YOUR NICK LIST
alias -l fillnick {
  did -r $$1 1
  var %loop = 1
  while (%loop <= $nick($did($$1,8).seltext,0)) {
    did -a $$1 1 $nick($did($$1,8).seltext,%loop)
    inc %loop
  }
}


;******************************************************************
;OPENS A @BLOCKpm WINDOW SO YOU CAN TRACK/VIEW USER'S INFORMATION
;******************************************************************
;WHEN YOU RECEIVE A PM, IF THE USER IS ON YOUR ACCEPT LIST YOU WILL GET THEIR QUERY
;WINDOW AS NORMAL. IF THE PERSON IS NOT ON YOUR ACCEPT LIST, THEY WILL AUTOMATICALLY
;RECEIVE A PM BACK FROM YOU STATING THE SENTENCE YOU SET WHEN YOU LOADED THIS SCRIPT,
;TELLING THEM YOU DO NOT ACCEPT PM'S FROM UNAUTHORIZED PEOPLE. YOU WILL ALSO GET A
;WINDOW CALLED @BLOCKPM THAT POPS UP, AND KEEPS TRACK OF ALL UNAUTHORIZED PM'S THAT
;YOU RECEIVE. THIS IS MERELY SO YOU CAN TRACK THE PEOPLE THAT ARE PM'ING YOU, AND WHAT
;CHANNEL THEY ARE "SPAMMING" YOU FROM.  YOU CAN ALSO SEE THEIR MESSAGE, JUST IN CASE
;IT'S IMPORTANT. UPON THEIR PM, THEY ARE AUTOMATICALLY ADDED TO YOUR IGNORE LIST FOR 20
;SECONDS, AND THEN AUTOMATICALLY BE REMOVED. AS WELL, ANYTHING THAT ENDS UP IN YOUR
;@BLOCKPM WINDOW WILL ALSO BE WRITTEN TO A LOG FILE IN WHATEVER DIRECTORY THIS SCRIPT
;WAS LOADED FROM TITLED BLOCKEDPMS.TXT IN CASE YOU NEED TO REFER TO IT IN THE FUTURE.

on ^friends:open:?:*:{ query -n $nick | echo $color(normal) -lmt $nick $+(<, $nick, >) $1- | haltdef }
on ^*:OPEN:?:*:{
  if (!$halted) && ($nick != -psybnc) {
    if (!$window(@blockPM)) { window -n @blockPM }
    aline -h @blockPM $str(-,20)
    aline @blockPM nick: $nick
    aline -p @blockPM message: $strip($1-)
    aline @blockPM time: $date $realtime
    aline @blockPM address: $fulladdress
    var %loop = $comchan($nick,0)
    while (%loop) {
      var %list = %list $comchan($nick,%loop)
      dec %loop
    }
    if (%list) { aline @blockPM channels: %list }
    aline @blockPM $str(-,20)
    if (!%pmblocker. [ $+ [ $nick ] ]) && ((*http://*.* !iswm $1-) || (*www.* !iswm $1-) || (* free * !iswm $1-)) {
      .msg $nick %pmblocker.reply
      ignore -pu20 $nick
      set -u10 %pmblocker. $+ $nick $true
    }
    elseif (%list) {
      echo 13 -a $nick spammed you in %list
    }
    write $scriptdirBLOCKEDpms.txt $timestamp < $+ $nick $+ > ( $+ $address $+ ) $1-
    halt
  }
}





;****************
;MENU LIST POPUP
;****************

menu status,nicklist,channel {
  $iif(!$dialog(Q-Apm-blockerv1.4),Q-Apm-blockerv1.4) : dialog -md Q-Apm-blockerv1.4 Q-Apm-blockerv1.4
}



;****************************************
;WEBSITE: http://home.gobbly.net/~queen/
;EMAIL: queenie@gobbly.net
;NETWORK: DALnet
;CHANNEL: #Helpdesk
;****************************************


; ADDED ON NICK EVENT

on *:nick:*: {

  ; check if the user is in your users list with the level of "friends"
  if ($ulist($nick) && $level($nick) == friends) {

    ; add the new nick
    auser friends $newnick

    ; uncomment out the next line to delete the old nick
    ; ruser friends $nick
  }

}


PuNkTuReD
 

Re: [request] PM Blocker Rewrite

Postby jonlar » Mon Feb 08, 2010 6:58 pm

I am very sorry, i have copied the whole script u posted at last. but i still get
error: unknown command ( *: )


I am using nnscript, dont know if this is relevant?!
jonlar
 

Re: [request] PM Blocker Rewrite

Postby PuNkTuReD » Tue Feb 09, 2010 4:20 am

ok found the problem, sorry that was my bad.
NOTE: the way it is set up is:

lets say you added PuNk1 to your accept lists
if PuNk1 changes to the nick of PuNk2
"PuNk1" is then deleted from the accept list and replaced with "PuNk2"

sooo, if one of your users has a main nick of PuNkTuReD
then changes their nick to something stupid like "byebye"
then leaves the room, when they come back to chat their main nick wont be on the accept list.

if you want it to keep all nicks in the accept list just comment out or delete this line

ruser friends $nick

down the very bottom of the script.

Code: Select all
;***********************************
;Q-Apm-blocker V1.4 by Queen-Amidala on DALnet
;Written 10/7/03
;Last Updated 11/12/03
;***********************************


;******************
;DIALOG TABLE CODE
;******************

dialog Q-Apm-blockerV1.4 {
  title "Q-Apm-blocker v1.4"
  size -1 -1 131 117
  option dbu
  box "Manual Controls", 12, 62 66 66 32
  combo 8, 5 13 54 84, size drop
  list 1, 5 26 54 89, size extsel vsbar
  list 2, 74 13 54 52, sort size extsel vsbar
  text "Channel List", 3, 7 3 32 8
  text "My Accept List", 4, 74 3 43 8
  edit "", 10, 68 74 54 10, autohs
  button "Add", 11, 68 85 20 9
  button "Del", 7, 89 85 20 9
  button "->", 5, 61 26 11 10
  button "", 9, 999 999 0 0, hide disable cancel
  text "By Queen-Amidala", 13, 64 108 46 8
  ;icon 6, 112 100 15 15,  $scriptdirqaicon.jpg, 0
}




;*************************************************************
;FIRST-TIME LOAD COMMAND(S) TO ALLOW YOU TO SET YOUR PM REPLY
;*************************************************************

on *:LOAD: {
  echo -s 14[13Q-Apm-blocker v1.414] loaded successfully! Thank you for trying this script. Please direct any questions/comments or concerns to Queen-Amidala on DALnet. (queenie@gobbly.net)
  set %pmblocker.reply $$?="Welcome to Q-Apm-blocker V1.4! Since this is the first time you have loaded this script, you need to configure your reply setting. Below, please enter a sentence that you would like automatically sent to users that are not on your accept list when they private message you to let them know that you will not be accepting their message. Example: I do not accept private messages from people I don't know, lamer. Please try to reach me in #Helpdesk instead. This can be set to whatever you want."
}



;**************
;INIT COMMANDS
;**************

on *:dialog:Q-Apm-blockerV1.4:init:*: {
  ;LOOPS THRU YOUR CHANNELS AND FILLS THE DROP DOWN BOX WITH CHANNELS
  var %loop = 1
  while (%loop <= $chan(0)) {
    did -a $dname 8 $chan(%loop)
    if ($chan(%loop) == $active) { did -c $dname 8 %loop }
    inc %loop
  }
  ;FILLS YOUR NICK LIST AND ACCEPT LIST
  fillnick $dname
  fillaccept $dname
}


;NICKLIST ADD BUTTON
on *:dialog:Q-Apm-blockerV1.4:sclick:5: {
  auser friends $did(q-apm-blockerV1.4,1).seltext
  fillaccept $dname
}


;MANUAL DELETE BUTTON
on *:dialog:Q-Apm-blockerV1.4:sclick:7: {
  ruser friends $did($dname,2).seltext 
  fillaccept $dname
}


;COMBO DROP-DOWN BOX
on *:dialog:Q-Apm-blockerV1.4:sclick:8: {
  fillnick $dname
}


;MANUAL ADD BUTTON
on *:dialog:Q-Apm-blockerV1.4:sclick:11: { 
  auser friends $did(q-apm-blockerV1.4,10).text
  fillaccept $dname
  did -r $dname 10
}





;********
;ALIASES
;********

;FILLS YOUR ACCEP LIST
alias -l fillaccept {
  did -r $$1 2
  var %i = 1
  while (%i <= $ulist(*,friends,0)) {
    did -a $$1 2 $ulist(*,friends,%i)
    inc %i
  }
}

;FILLS YOUR NICK LIST
alias -l fillnick {
  did -r $$1 1
  var %loop = 1
  while (%loop <= $nick($did($$1,8).seltext,0)) {
    did -a $$1 1 $nick($did($$1,8).seltext,%loop)
    inc %loop
  }
}


;******************************************************************
;OPENS A @BLOCKpm WINDOW SO YOU CAN TRACK/VIEW USER'S INFORMATION
;******************************************************************
;WHEN YOU RECEIVE A PM, IF THE USER IS ON YOUR ACCEPT LIST YOU WILL GET THEIR QUERY
;WINDOW AS NORMAL. IF THE PERSON IS NOT ON YOUR ACCEPT LIST, THEY WILL AUTOMATICALLY
;RECEIVE A PM BACK FROM YOU STATING THE SENTENCE YOU SET WHEN YOU LOADED THIS SCRIPT,
;TELLING THEM YOU DO NOT ACCEPT PM'S FROM UNAUTHORIZED PEOPLE. YOU WILL ALSO GET A
;WINDOW CALLED @BLOCKPM THAT POPS UP, AND KEEPS TRACK OF ALL UNAUTHORIZED PM'S THAT
;YOU RECEIVE. THIS IS MERELY SO YOU CAN TRACK THE PEOPLE THAT ARE PM'ING YOU, AND WHAT
;CHANNEL THEY ARE "SPAMMING" YOU FROM.  YOU CAN ALSO SEE THEIR MESSAGE, JUST IN CASE
;IT'S IMPORTANT. UPON THEIR PM, THEY ARE AUTOMATICALLY ADDED TO YOUR IGNORE LIST FOR 20
;SECONDS, AND THEN AUTOMATICALLY BE REMOVED. AS WELL, ANYTHING THAT ENDS UP IN YOUR
;@BLOCKPM WINDOW WILL ALSO BE WRITTEN TO A LOG FILE IN WHATEVER DIRECTORY THIS SCRIPT
;WAS LOADED FROM TITLED BLOCKEDPMS.TXT IN CASE YOU NEED TO REFER TO IT IN THE FUTURE.

on ^friends:open:?:*: { query -n $nick | echo $color(normal) -lmt $nick $+(<, $nick, >) $1- | haltdef }
on ^*:OPEN:?:*: {
  if (!$halted) && ($nick != -psybnc) {
    if (!$window(@blockPM)) { window -n @blockPM }
    aline -h @blockPM $str(-,20)
    aline @blockPM nick: $nick
    aline -p @blockPM message: $strip($1-)
    aline @blockPM time: $date $realtime
    aline @blockPM address: $fulladdress
    var %loop = $comchan($nick,0)
    while (%loop) {
      var %list = %list $comchan($nick,%loop)
      dec %loop
    }
    if (%list) { aline @blockPM channels: %list }
    aline @blockPM $str(-,20)
    if (!%pmblocker. [ $+ [ $nick ] ]) && ((*http://*.* !iswm $1-) || (*www.* !iswm $1-) || (* free * !iswm $1-)) {
      .msg $nick %pmblocker.reply
      ignore -pu20 $nick
      set -u10 %pmblocker. $+ $nick $true
    }
    elseif (%list) {
      echo 13 -a $nick spammed you in %list
    }
    write $scriptdirBLOCKEDpms.txt $timestamp < $+ $nick $+ > ( $+ $address $+ ) $1-
    halt
  }
}





;****************
;MENU LIST POPUP
;****************

menu status,nicklist,channel {
  $iif(!$dialog(Q-Apm-blockerv1.4),Q-Apm-blockerv1.4) : dialog -md Q-Apm-blockerv1.4 Q-Apm-blockerv1.4
}



;****************************************
;WEBSITE: http://home.gobbly.net/~queen/
;EMAIL: queenie@gobbly.net
;NETWORK: DALnet
;CHANNEL: #Helpdesk
;****************************************


; ADDED ON NICK EVENT

on *:nick: {

  ; check if the user is in your users list with the level of "friends"
  if ($ulist($nick)) && ($level($nick) == friends) {

    ; add the new nick
    auser friends $newnick

    ; uncomment out the next line to delete the old nick
    ruser friends $nick
  }

}
PuNkTuReD
 

Re: [request] PM Blocker Rewrite

Postby jonlar » Sat Feb 13, 2010 10:45 am

Cheers man, but there is another prob now. If i add a Nick and close mirc the added Nick is not in the list anymore......
jonlar
 

Re: [request] PM Blocker Rewrite

Postby PuNkTuReD » Mon Feb 15, 2010 1:00 pm

sorry i am not sure about that, i did not change any part of the actual script, i just added the nick event at the bottom.
PuNkTuReD
 

Re: [request] PM Blocker Rewrite

Postby jonlar » Sun Feb 21, 2010 8:33 pm

Well. i think it would be better to get the whole thing changed in that way it uses the host of a user instead his nick. Because with the "old" nicks i added, before the Codechanges, i do get this - * Added PeppiX|BFh to user list
* Removed DrPeppiX from user list - and that the whole time when a user change his nick. What would happen if i have 10 Users in the list... ;)

Man i thank u a lot for your Help but i would prefer the host change
jonlar
 

Re: [request] PM Blocker Rewrite

Postby Futz0r » Mon Jun 14, 2010 4:38 pm

Code: Select all
on *:text:*:?:if ($level($nick) != LEVEL) { close -m $nick | .notice $nick Your Message Has Been Blocked. | ignore -pu20 $nick | echo 4 -a $chr(91) $+ $nick tried to msg/query $+ $chr(93) | halt }
menu @window {
  PM Blocker
  .-=Add User=-:.add $$?="Enter The Nick To Add" | /clear | /iline @window 1 4Users Allowed To Msg/Query You - PM Blocker | /iline @window 2 ------------------------------------------- | /iline @window 3 10Right Click To Add/Del Users | var %x $ulist(*,level,0) | while (%x) { aline @window - | aline @window $ulist(*,level,%x) | dec %x }
  .-=Del User=-:.del $$1 | /clear | /iline @window 1 4Users Allowed To Msg/Query You - PM Blocker | /iline @window 2 ------------------------------------------- | /iline @window 3 10Right Click To Add/Del Users | var %x $ulist(*,level,0) | while (%x) { aline @window - | aline @window $ulist(*,level,%x) | dec %x }
  .-=Update List=-:/clear | /iline @window 1 4Users Allowed To Msg/Query You - PM Blocker | /iline @window 2 ------------------------------------------- | /iline @window 3 10Right Click To Add/Del Users | var %x $ulist(*,level,0) | while (%x) { aline @window - | aline @window $ulist(*,level,%x) | dec %x }
}
menu nicklist,query {
  PM Blocker
  .add:.auser level $$1 | echo -a 10[ $$1 Is Added To Allow List. ] | .notice $$1 You Are Added To My Msg/Query Allow List.
  .del:.ruser level $$1 | echo -a 10[ $$1 is Deleted From Allow List. ] | .notice $$1 You Are Deleted From My Msg/Query Allow List.

  .List Users://window -l @window | /iline @window 1 4Users Allowed To Msg/Query You - PM Blocker | /iline @window 2 ------------------------------------------- | /iline @window 3 10Right Click To Add/Del Users | var %x $ulist(*,level,0) | while (%x) { aline @window - | aline @window $ulist(*,level,%x) | dec %x }
}
menu channel {
  PM Blocker
  .add:.auser level $$?="Enter The Nick To add" | echo -a 10[ $! is Added To Allow List. ] | .notice $! You Are Added To My Msg/Query Allow List.
  .del:.ruser level $$?="Enter The Nick To Delete" | echo -a 10[ $! is Deleted From Allow List. ] | | .notice $! You Are Deleted From My Msg/Query Allow List.
  .List Users://window -l @window | /iline @window 1 4Users Allowed To Msg/Query You - PM Blocker | /iline @window 2 ------------------------------------------- | /iline @window 3 10Right Click To Add/Del Users | var %x $ulist(*,level,0) | while (%x) { aline @window - | aline @window $ulist(*,level,%x) | dec %x }
}
alias /add /auser level $1 | echo -a 10[ $1 Is Added To The Allow List. ] | /notice $1 You Are Added To My Msg/Query Allow List.
alias /del /ruser level $1 | echo -a 10[ $1 Is Deleted From The Allow List. ] | notice $$1 You Are Deleted From My Msg/Query Allow List.
Futz0r
 


Return to Mirc Scripting Request

Who is online

Users browsing this forum: No registered users and 2 guests

cron