DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Auto Key-Exchange in Query?  (Read 10,015 times)

thede

  • Participant
  • Joined in 2007
  • *
  • Posts: 4
Auto Key-Exchange in Query?
« on: October 12, 2007, 09:22 PM »
Hi guys,
I have a little Question/Request.

Is it possible to somehow have an Auto Key-Exchange for Queries if theres no key for the Chat Partner yet?
(or something like that in FiSH)

If not... is it possible to add that to the next version please?  :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Auto Key-Exchange in Query?
« Reply #1 on: October 12, 2007, 09:30 PM »
i'm trying to remember if anyone made a little script for this.. it would be a good assignment for anyone learning basic mirc scripting, not very hard.

thede

  • Participant
  • Joined in 2007
  • *
  • Posts: 4
Re: Auto Key-Exchange in Query?
« Reply #2 on: October 13, 2007, 09:47 AM »
yeah, you are right mouser, its a very simple script ;)
i though i would need to use more complex stuff but hey, this is all:
Code
on *:SIGNAL:MircryptionSignalAll: {
  if ($1 = query) {
    ;; if ($2 = -sBNC) { halt } <-if youre using sbnc
    if ($4 = $false) {
      /mckeyx $3
    }
    if ($4 = $true) {
    }
  }
}

thx for your help

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Auto Key-Exchange in Query?
« Reply #3 on: October 13, 2007, 10:17 AM »
nice first try!
a problem is that if you speak to someone without mircryption or fish it's going to try to do a key exchange with them every time they say anything.

a nice solution would be to set a persistent variable (or hash entry) like %autokeyx_USERNAME (where USERNAME is the name of the person, i.e. $3) whenever you do the mckeyx in your routine, and only try they mckeyx if the variable for the user is not set yet.  that way, it will only ever try it once per user.

Original address: https://www.donationcoder.com/forum/index.php?topic=10354.0