Skip to content
Buzzen Chat Network

Whisper Accept Or Decline

A TG007 community discussion started by CharmedOne.

Discussion 16 posts
Page 1 of 1
Open
Topic #13284 · 16 published posts · 3,725 views
:pizza: I am not sue how to set this up it is something I havent done or messed with can smeone help me ? I was never sure how to set my whispers to accept or decline to even begin to attempt it.

Haven't tried this, yet. However, here is something I came up with...

 

on *:TEXT:*:?: {
  var %wtext. [ $+ [ $nick ] ] = $nick $+ : $1-
  .msg $nick Waiting for $me to accept whisper. Please wait...
  if (!%wnick. [ $+ [ $nick ] ]) {
    if ($input(Do you want to accept incoming whisper from $nick $+ ?,n,Incoming Whisper from $nick $+ .) == $true) {
      set %wnick. [ $+ [ $nick ] ] $nick
      echo %wnick. [ $+ [ $nick ] ] %wtext. [ $+ [ $nick ] ]
    }
    else {
      .msg $nick Access to whisper has been denied.
      closemsg $nick
    }
  }
  else echo %wnick. [ $+ [ $nick ] ] %wtext. [ $+ [ $nick ] ]
}

on *:close:?: if (%wnick. [ $+ [ $nick ] ]) unset %wnick. [ $+ [ $nick ] ]

Edited Aug 18, 2009 1:32 AM by Warrior124

Does that script work for Buzzen?

 

 

 

I haven't tried it for Buzzen, yet. I did test it out yesterday, though. I got an error saying the $input doesn't work in an event. I'll see what else I can come up with. :)

 

Edit: Haven't tried the following code on Buzzen, but I've tested this on Koach.com, and it works. Here is the new code...

 

on *:TEXT:*:?: {
  set %wtext. [ $+ [ $nick ] ] = $nick $+ : $1-
  if (!%wnick. [ $+ [ $nick ] ]) {
     .msg $nick Waiting for $me to accept whisper. Please wait...
    .closemsg $nick
    dialog -md waccept. $+ $nick waccept
  }
}

on *:close:?: if (%wnick. [ $+ [ $nick ] ]) unset %wnick. [ $+ [ $nick ] ]

dialog waccept {
  title "Whisper From: "
  size -1 -1 134 45
  option dbu
  button "Yes", 1, 28 31 37 12
  button "No", 2, 68 31 37 12
  text "", 3, 1 1 131 28
}

on *:dialog:waccept*:*:*: {
  tokenize 32 $gettok($dname,2,$asc(.))
  if ($devent == init) {
    dialog -t $dname Whisper from $1- $+ ?
    did -ra $dname 3 Do you want to accept incoming whisper from $1- $+ ?
  }
  if ($devent == sclick) {
    if ($did == 1) {
      set %wnick. [ $+ [ $1- ] ] $1-
      query %wnick. [ $+ [ $1- ] ]
      .msg %wnick. [ $+ [ $1- ] ] Your whisper has been accepted, please continue.
      echo %wnick. [ $+ [ $1- ] ] %wtext. [ $+ [ $1- ] ]
      dialog -c $dname waccept
    }
    if ($did == 2) {
      .msg $1- Access to whisper has been denied.
      closemsg $1-
      dialog -c  $dname waccept
    }
  }
}

Edited Aug 18, 2009 2:44 PM by Warrior124

Nice work, Warrior. But don't you think it's obvious this request was made for Buzzen in the first place? Not to mention this is a Buzzen thread. lol

 

Amy you have had a whisper decline/accept code for years.

Fanfare, this should work for Buzzen, and yes I knew it was for Buzzen, because it is a Buzzen thread. However, unless Buzzen has drastically changed coding, this should work there. :)

Edited Aug 18, 2009 8:10 PM by Warrior124
Amy you have had a whisper decline/accept code for years.

Nope never had one :pizza:

name='CharmedOne' date='Aug 18 2009, 08:49 PM' post='73514'

 

Nope never had one :pizza: tho one I had for msn was way different wont work here on buzzen

Edited Aug 18, 2009 8:52 PM by CharmedOne

it should work with a little editing.

Edited Aug 18, 2009 8:51 PM by err0r

Get information about ircWx here

Just tested it on Buzzen, and it does work. Here is something else I was working on that you can use too if you wish. It is a combination of the previous code along with a message center addon for when you are away. :)

 

on *:TEXT:*:?: {
;This code will set the incoming text for future use.
  set %wtext. [ $+ [ $nick ] ] $nick $+ : $1-
  if (!%awaymsg) {
;%awaymsg is used to determine if the code utilizes the Message Center (Used when you are away), or if you're not away it will use the whisper access instead.
    if (!%wnick. [ $+ [ $nick ] ]) {
       .msg $nick Waiting for $me to accept whisper, please wait...
      .closemsg $nick
      dialog -md waccept. $+ $nick waccept
    }
  }
  else {
    .msg $nick I'm away right now. Your message has been copied, and will be read when I return. Thank you.
    write $nofile($mircexe) $+ messages.txt $date(mm/dd/yyyy) $time(hh:nn:ss) %wtext. [ $+ [ $nick ] ]
    .closemsg $nick
  }
}

on *:close:?: if (%wnick. [ $+ [ $nick ] ]) unset %wnick. [ $+ [ $nick ] ]

dialog MSGS {
  title "Message Center:"
  size -1 -1 341 252
  option dbu
  list 1, 2 12 89 225, size
  text "Messages From:", 2, 2 2 88 8, center
  text "Read Message From:", 3, 94 2 244 8, center
  list 4, 94 12 244 225, size
  button "Close:", 5, -1 240 343 12
}

;The following is used for your Message Center.
on *:dialog:msgs:*:*: {
  if ($devent == init) {
    :If on init this code will gather a list of names who sent you messages.
    var %l = 1
    while (%l <= $lines($nofile($mircexe) $+ messages.txt)) {
      if (!$didwm($dname,1,$left($gettok($read($nofile($mircexe) $+ messages.txt,%l),3,32),-1))) did -a $dname 1 $left($gettok($read($nofile($mircexe) $+ messages.txt,%l),3,32),-1)
      inc %l
    }
  }
;When you click on each name it will show you a list of messages that person sent you.
  if ($devent == sclick) {
    if ($did == 1) {
      did -r $dname 4
      did -ra $dname 2 Messages From: $did(1).seltext
      did -ra $dname 3 Read Message From: $did(1).seltext
      var %s = 1
      while (%s <= $lines($nofile($mircexe) $+ messages.txt)) {
        if ($left($gettok($read($nofile($mircexe) $+ messages.txt,%s),3,32),-1) == $did(1).seltext) did -a $dname 4 $chr(40) $+ $gettok($read($nofile($mircexe) $+ messages.txt,%s),1-2,32) $+ $chr(41) $gettok($read($nofile($mircexe) $+ messages.txt,%s),4-,32)
        inc %s
      }
    }
    elseif ($did == 5) dialog -c $dname $dname
  }
;When you close the Message Center it will ask you if you want to delete all messages. If you click OK it will delete all messages that was sent you.
  if ($devent == close) {
    if ($input(Do you want to delete your messages?,y,Message Center:) == $true) .remove $nofile($mircexe) $+ messages.txt
  }
}

;The following dialog is used just like an $input event. It will ask you if you want to accept an incoming whisper from someone. If you don't want to just click the No button. It will send a message to the person saying their whisper to you has been denied. Otherwise if you accept the whisper it will open the whisper window, and echo what was said. It will also let the person know you have accepted their whisper, and to continue.
dialog waccept {
  title "Whisper From: "
  size -1 -1 134 45
  option dbu
  button "Yes", 1, 28 31 37 12
  button "No", 2, 68 31 37 12
  text "", 3, 1 1 131 28
}

;The following lets your script know whether to use the Message Center when you're away, or not.
raw *:*: {
  if ($network != Buzzen) {
    if ($numeric == 306) set %awaymsg $true
    if ($numeric == 305) {
      unset %awaymsg
      if ($exists($nofile($mircexe) $+ messages.txt)) dialog -md msgs msgs
    }
  }
  else {
    if ($numeric == 822) set %awaymsg $true
    if ($numeric == 821) {
      unset %awaymsg
      if ($exists($nofile($mircexe) $+ messages.txt)) dialog -md msgs msgs
    }
  }
}

;The following code is used just like an $input event. It will ask you if you want to accept an incoming whisper from someone. If you don't want to just click the No button. It will send a message to the person saying their whisper to you has been denied. Otherwise if you accept the whisper it will open the whisper window, and echo what was said. It will also let the person know you have accepted their whisper, and to continue.
on *:dialog:waccept*:*:*: {
  tokenize 32 $gettok($dname,2,$asc(.))
  if ($devent == init) {
    dialog -t $dname Whisper from $1- $+ ?
    did -ra $dname 3 Do you want to accept incoming whisper from $1- $+ ?
  }
  if ($devent == sclick) {
    if ($did == 1) {
      set %wnick. [ $+ [ $1- ] ] $1-
      query %wnick. [ $+ [ $1- ] ]
      .msg %wnick. [ $+ [ $1- ] ] Your whisper has been accepted, please continue.
      echo %wnick. [ $+ [ $1- ] ] %wtext. [ $+ [ $1- ] ]
      dialog -c $dname waccept
    }
    if ($did == 2) {
      .msg $1- Access to whisper has been denied.
      closemsg $1-
      dialog -c  $dname waccept
    }
  }
}

Edited Aug 19, 2009 1:36 AM by Warrior124

To use buzzens whisper accept/deny feature you need to listen to the raw data event.

Actually, I did test it on Buzzen using 2 different accounts. One whispering to the other, and it worked. :)

 

P.S.: I am using the vIRC Buzzen connection addon to connect to Buzzen.

Edited Aug 18, 2009 10:08 PM by Warrior124

he wasn't saying it wouldn't work that way.. what travis was saying is that buzzen uses raw data to accomplish what you are doing.

 

;err0r whispering err0r1885
;example sending request
<- :err0r1885!6492d38d732122c58b44e3fdc3e9e9f3@BuzzenPassport DATA %#err0rtest err0r CMWHISP :WHISPACCEPTNEEDED
;example request accepted
<- :err0r1885!6492d38d732122c58b44e3fdc3e9e9f3@BuzzenPassport DATA %#err0rtest err0r CMWHISP :WHISPACCEPTED
;example user declined
<- :err0r1885!6492d38d732122c58b44e3fdc3e9e9f3@BuzzenPassport DATA %#err0rtest err0r CMWHISP :WHISPDECLINED
;example user closed query window
<- :err0r1885!6492d38d732122c58b44e3fdc3e9e9f3@BuzzenPassport DATA %#err0rtest err0r CMWHISP :WHISPWNDCLOSED

Get information about ircWx here

Ahh, okay. Thanks err0r. :)

I've edited the following addon to include information on its functions. Click Here :)