Jump to content

Whisper Accept Or Decline


CharmedOne

Recommended Posts

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 by Warrior124
Link to comment
Share on other sites

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 by Warrior124
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...