• Home
  • Servers
  • Chat
  • Channels
  • Commands
  • Forum
  • FAQ
  • Software
  • Quotes
Topic Options
Rate This Topic
#3841 - 12/30/08 12:31 PM Accept - Reject Pm script. Final Version.
iAlex Offline
Over 100 posts

Registered: 09/01/08
Posts: 100
Loc: Kongsvinger, 2209 Norway.
I previously posted a pm script that completely failed..
Here I have created a new one. This one is even without bugs! >_<
Just put in the remote tab on the script editor.
to open the file where rejected users are stored enter /pmfile in mIRC :P

Code:
on *:TEXT:*:?:{
  if ($readini(privmsg.ini, accepted, $nick) !== $null) { halt }
  if ($readini(privmsg.ini, hold, $nick) !== $null) { .msg $nick 04Please wait until I have accepted your Private Message. | close -m $nick }
  if ($readini(privmsg.ini, deny, $address($nick,2)) !== $null) {
    close -m $nick
    .msg $nick 07 I am sorry but private messages from your host: " $+ $address($nick,2) $+ " is denied.
  }
  else {
    close -m $nick
    writeini privmsg.ini hold $nick 1
    askirc $nick $address($nick,2) $1-
    .msg $nick 12Please Wait while I 03Accept or 04Reject Your Private message.
  }
}
on *:ACTION:*:?:{
  if ($readini(privmsg.ini, accepted, $nick) !== $null) { halt }
  if ($readini(privmsg.ini, hold, $nick) !== $null) { .msg $nick 04Please wait until I have accepted your Private Message. | close -m $nick }
  if ($readini(privmsg.ini, deny, $address($nick,2)) !== $null) {
    close -m $nick
    .msg $nick 07 I am sorry but private messages from your host: " $+ $address($nick,2) $+ " is denied.
  }
  else {
    close -m $nick
    writeini privmsg.ini hold $nick 1
    askirc $nick $address($nick,2) $1-
    .msg $nick 12Please Wait while I 03Accept or 04Reject Your Private message.
  }
}
dialog privmsg {
  title "Private Message"
  size -1 -1 179 64
  option dbu
  text "o.o", 1, 12 7 153 39
  button "Accept", 2, 27 50 37 12, ok
  button "Reject", 3, 94 50 37 12, ok
}
alias askirc {
  set %pmnick $1
  set %pmaddress $2
  set %pmtext $3-
  dialog -m privmsg privmsg
}
on *:DIALOG:privmsg:init:0:{
  did -r privmsg 1
  did -a privmsg 1 %pmnick just private messaged you. Accept or Reject?  - Message: %pmtext
}
on *:DIALOG:privmsg:sclick:2:{
  dialog -x privmsg
  query %pmnick
  remini privmsg.ini hold %pmnick
  writeini privmsg.ini accepted %pmnick 1
  .msg %pmnick 03I have accepted your private messages. Thank you for waiting.
  unset %pmnick
  unset %pmtext
  unset %pmaddress
}
on *:DIALOG:privmsg:sclick:3:{
  dialog -x privmsg
  remini privmsg.ini hold %pmnick
  writeini privmsg.ini deny %pmaddress 1
  .msg %pmnick 07I have rejected your private message. Your pm's are now automaticly ignored by my client. Have a nice day %pmnick $+ .
  unset %pmnick
  unset %pmtext
  unset %pmaddress
}
on *:CLOSE:?:{
  remini privmsg.ini accepted $nick
}
alias query {
  writeini privmsg.ini accepted $$1 1
  query $$1-
}
alias pmfile {
  run $mircdir $+ \privmsg.ini
}
_________________________
http://ialex.info
ialex94wr@gmail.com
alex@ialex.info

Top
Sponsored Links
Sponsored Links
Member
*****

Registered: 27/08/04
Posts: 10136
Loc: Mountain View, CA
Top
#3846 - 12/31/08 07:06 AM Re: Accept - Reject Pm script. Final Version. [Re: iAlex]
iAlex Offline
Over 100 posts

Registered: 09/01/08
Posts: 100
Loc: Kongsvinger, 2209 Norway.
I was bored so I though adding another usefull feature to the pm script. If the user sends over 4 messages before you have accepted the pm the user will be auto rejected.
Delete the old script and put in the following one:
Code:
on *:TEXT:*:?:{
  if ($readini(privmsg.ini, flood, $nick) > 4) { pmreject $nick }
  if ($readini(privmsg.ini, accepted, $nick) !== $null) { halt }
  if ($readini(privmsg.ini, hold, $nick) !== $null) {
    close -m $nick
    writeini privmsg.ini flood $nick $calc($readini(privmsg.ini, flood, $nick) + 1)
    .msg $nick 04Please wait until I have accepted your Private Message.
  }
  if ($readini(privmsg.ini, deny, $address($nick,2)) !== $null) {
    close -m $nick
    .msg $nick 07 I am sorry but private messages from your host: " $+ $address($nick,2) $+ " is denied.
  }
  else {
    close -m $nick
    writeini privmsg.ini hold $nick 1
    askirc $nick $address($nick,2) $1-
    writeini privmsg.ini flood $nick 1
    .msg $nick 12Please Wait while I 03Accept or 04Reject Your Private message.
  }
}
on *:ACTION:*:?:{
  if ($readini(privmsg.ini, flood, $nick) > 4) { pmreject $nick }
  if ($readini(privmsg.ini, accepted, $nick) !== $null) { halt }
  if ($readini(privmsg.ini, hold, $nick) !== $null) {
    close -m $nick
    writeini privmsg.ini flood $nick $calc($readini(privmsg.ini, flood, $nick) + 1)
    .msg $nick 04Please wait until I have accepted your Private Message.
  }
  if ($readini(privmsg.ini, deny, $address($nick,2)) !== $null) {
    close -m $nick
    .msg $nick 07 I am sorry but private messages from your host: " $+ $address($nick,2) $+ " is denied.
  }
  else {
    close -m $nick
    writeini privmsg.ini hold $nick 1
    askirc $nick $address($nick,2) $1-
    writeini privmsg.ini flood $nick 1
    .msg $nick 12Please Wait while I 03Accept or 04Reject Your Private message.
  }
}
dialog privmsg {
  title "Private Message"
  size -1 -1 179 64
  option dbu
  text "o.o", 1, 12 7 153 39
  button "Accept", 2, 27 50 37 12, ok
  button "Reject", 3, 94 50 37 12, ok
}
alias askirc {
  set %pmnick $1
  set %pmaddress $2
  set %pmtext $3-
  dialog -m privmsg privmsg
}
on *:DIALOG:privmsg:init:0:{
  did -r privmsg 1
  did -a privmsg 1 %pmnick just private messaged you. Accept or Reject?  - Message: %pmtext
}
on *:DIALOG:privmsg:sclick:2:{
  dialog -x privmsg
  query %pmnick
  remini privmsg.ini hold %pmnick
  remini privmsg.ini flood %pnick
  writeini privmsg.ini accepted %pmnick 1
  .msg %pmnick 03I have accepted your private messages. Thank you for waiting.
  unset %pmnick
  unset %pmtext
  unset %pmaddress
}
on *:DIALOG:privmsg:sclick:3:{
  dialog -x privmsg
  remini privmsg.ini hold %pmnick
  remini privmsg.ini flood %pmnick
  writeini privmsg.ini deny %pmaddress 1
  .msg %pmnick 07I have rejected your private message. Your pm's are now automaticly ignored by my client. Have a nice day %pmnick $+ .
  unset %pmnick
  unset %pmtext
  unset %pmaddress
}
alias pmreject {
  close -m $1
  dialog -x privmsg
  remini privmsg.ini hold $1
  remini privmsg.ini flood $1
  writeini privmsg.ini deny $address($1,2) 1
  .msg $1 07Pm flood detected. Auto Rejected. Your pm's are now automaticly ignored by my client. Have a nice day $1 $+ .
  unset %pmnick
  unset %pmtext
  unset %pmaddress
}
on *:CLOSE:?:{
  remini privmsg.ini accepted $nick
}
_________________________
http://ialex.info
ialex94wr@gmail.com
alex@ialex.info

Top
#3931 - 01/06/09 03:33 AM Re: Accept - Reject Pm script. Final Version. [Re: iAlex]
Kevin_28 Offline
n00b

Registered: 06/25/08
Posts: 7
Loc: CA, USA
Looks good. What happens when another person private messages you before you approved or rejected that last dialog popup?

Top
#3934 - 01/06/09 02:01 PM Re: Accept - Reject Pm script. Final Version. [Re: Kevin_28]
iAlex Offline
Over 100 posts

Registered: 09/01/08
Posts: 100
Loc: Kongsvinger, 2209 Norway.
When you approve it opens a pm window with the user. The pms will be sent to that window as usual as long as that window is up, if you close the pm window or restart mIRC. It will prompt you again the next time teh user pms you. If you reject the user. All private messages from that user will be ignored. Not shown to you, and not prompted. This ignore will be on until removed from the file.
_________________________
http://ialex.info
ialex94wr@gmail.com
alex@ialex.info

Top
#3935 - 01/06/09 02:04 PM Re: Accept - Reject Pm script. Final Version. [Re: iAlex]
Phil Offline
Over 200 posts

Registered: 10/23/06
Posts: 205
Loc: Warwick, UK
Not sure that really answers the question. I think he is talking about the fact the confirmation dialogues are modal.

Phil

Top


Moderator:  Jeff, mandy, usrbingeek