mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Hi all.

I was making a new dialog window, and i wanted to have a combobox with 10 presets, on selecteing one of them, and clicking on apply i want them to be put to use:

The dialog is for "Blowfish" i wasnted to add 10 presets to the encryption box and 10 to the decryption box, i already have 2 test boxs which work all right. How would i go about adding these preset to the combo box?

Code:

alias blow {
if (%bencrypt == $null || %bdecrypt == $null) {
$input(You must set the keys first!,oh,Blowfish - Error)
/blowfish
/halt
}
echo $timestamp < $+ $me $+ @VCryp> $$1-
/.msg $active VCryp $gettok($dll(blowfish/blowfish.dll,Encrypt,%bencrypt $$1-),2-,32)
}

on ^1:TEXT:VCryp *:#:echo $chan $timestamp < $+ $nick $+ @VCryp> $gettok($dll(blowfish/blowfish.dll,Decrypt,%bdecrypt $$2-),2-,32) | haltdef
on ^1:TEXT:VCryp *:?:query $nick | echo $query($nick) $timestamp < $+ $nick $+ @VCryp> $gettok($dll(blowfish/blowfish.dll,Decrypt,%bdecrypt $$2-),2-,32) | haltdef
on ^1:CHAT:VCryp *:echo =$nick $timestamp < $+ $nick $+ @VCryp> $gettok($dll(blowfish/blowfish.dll,Decrypt,%bdecrypt $$2-),2-,32) | haltdef
alias blowfish {
/dialog -m blow blow
}
dialog blow {
title "VTECrypto® II"
icon blowfish/blowfish.ico, 0
size -1 -1 104 168, size
option dbu
box "VTEC §cript II ® Crypto...", 2, 0 73 89 81
text "Encrypt", 3, 4 85 24 8
edit %bencrypt, 4, 29 83 58 10
edit %bdecrypt, 5, 29 94 58 10
text "Decrypt", 6, 4 96 24 8
button "Apply", 32, 60 155 28 12
button "Cancel", 31, 30 155 28 12, cancel
button "OK", 30, 0 155 28 12, ok
combo 99, 29 108 58 80,drop ,vsbar
combo 98, 29 120 58 80,drop ,vsbar
text "En Preset", 97, 4 110 24 8
text "De Preset", 96, 4 122 24 8

check "Encrypt text by default?", 7, 3 143 83 10, left
icon 1, 2 -6 86 86, blowfish\blowfish.jpg
icon 29, 74 2 45 164,$mircdir/pictures/K-TEK V-TEC Menubar.jpg
}

on *:dialog:blow:sclick:32,30,7,99,98:{
;echo -a Did: $did
if ($did == 7) {
if ($did(blow,$did).state == 1) {
set %blowcrypt yes
;echo -a Encryption: Yes
}
else {
set %blowcrypt no
;echo -a Encryption: No
}
}
/set %bencrypt $did(blow,4)
/set %bdecrypt $did(blow,5)
/set %bencrypt $did(blow,99)
/set %bdecrypt $did(blow,98)
}

on *:dialog:blow:init:0:{
if (%blowcrypt == yes) { did -c blow 7 }
}

on 1:INPUT:*:{
if (($left($1,1) == /) && (!$ctrlenter)) { return }
if (%blowcrypt == yes) {
/blow $$1-
haltdef
}


sub-zero.homeip.net:6667

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Never used Blowfish mate so I don't know what it is or does to the full extent of it's capabilities, is this what you mean..

Code:
On *:Dialog:blow:init:0: {
  var %encrypt = 1, %decrypt = 1
  while (%encrypt &lt;= 10) &amp;&amp; (%decrypt &lt;= 10) {
    did -a blow 99 Encrypt %decrypt
    did -a blow 98 Decrypt %decrypt
    inc %encrypt
    inc %decrypt
  }
  did -c blow 99 1
  did -c blow 98 1
}


Minor note, when pasting code, make sure you insert CODE tags. smile

Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Well where i have the Combo boxes, I would like the 10 presets there, ie. i click on the drop down box and then i have 10 differant encrypt/decrypt keys to choose from, on selecting them and applying, i can then decrypt and enctypt on those certain keys.

Each key needs to be 19 characters long and there need to 20 of them, 10 for encrypt and 10 for decrypt.

Hyperthetical:

On *:Dialog:blow:init:0: {

£%^£$%£$%£$%
£%£%£%£$%$£%

}
}

But now i dont know how to code it.

Any ideas?


sub-zero.homeip.net:6667

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Well I really have no idea how you'd encrypt/decrypt with Blowfish (or whatever).. But my example earlier will have this in the combos..

Encrypt
Encrypt 1
Encrypt 2
Encrypt 3
Encrypt 4
Encrypt 5
..up to 10..

And..

Decrypt
Decrypt 1
Decrypt 2
Decrypt 3
Decrypt 4
Decrypt 5
..up to 10..

If you can somehow adapt to that, as I said I've never used blowfish so you guess would be as good as mine. frown

Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Thanks mate, i will give that a try grin


sub-zero.homeip.net:6667

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You're welcome. smile


Link Copied to Clipboard