Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

3 877 Posts in 868 Topics- by 723 Members - Latest Member: tablarock

23 May 2012, 15:08
Select Language English | Russian ru | German
Main PageIRC Client KVIrc forumKVIrc discussionKVIrc scriptingHelp with window.setCryptEngine
Pages: [1]
Print
Author Topic: Help with window.setCryptEngine  (Read 3100 times)
0 Members and 1 Guest are viewing this topic.
oldhouse
Новичок
*

Репутация: 0
Posts: 5


View Profile
« on: 9 February 2010, 17:57 »

Hi.
I am trying to write a script that as soon as I join a channel, a crypt and decrypt key is set for that channel.

Right now, I have added these lines at "OnInvite" event:
Code:

if ($0 == "botnick")
 {
   mode mynick +h
   join #mychannel mypassword
 }

In this way, when I get an invite from bot, I automatically join channel protected by password.
How should I proceed to use the command window.setCryptEngine, setting Mircryption passwordencrypt passworddecrypt?

Could this work in OnMeJoin?

Code:
if ($chan.name == "#mychannel")
{
window.setCryptEngine Mircryption chankeytoencrypt chankeytodecrypt
}


If not, could you post a sample how to make it work with window variable?
Thanks
« Last Edit: 9 February 2010, 22:05 by oldhouse » Logged
ambossarm
Постоялец
***

Репутация: 11
Gender: Male
Posts: 113



View Profile
« Reply #1 on: 10 February 2010, 04:13 »

mynick should be $me

if the setCrypt command is right, it should work, you may try it just on the command line and if it works there, it should also work

I suggest using window.setCryptEngine $window Micryption ...
and perhaps $target instead of $chan.name, but they should do the same thing for your purpose, $target works also at queries
Logged
oldhouse
Новичок
*

Репутация: 0
Posts: 5


View Profile
« Reply #2 on: 10 February 2010, 13:02 »

Thanks for correction.
First part works fine, but second doesn't cause window.setCryptEngine requires a target window, therefore I get this error:

[KVS] Warning: Window with ID 'Mircryption' doesn't exist.

I have just tried window.setCryptEngine $window Micrcryption in script tester, but I get this error:

Warning: Current window is not a channel.

Have to try on real join.
« Last Edit: 10 February 2010, 13:04 by oldhouse » Logged
ambossarm
Постоялец
***

Репутация: 11
Gender: Male
Posts: 113



View Profile
« Reply #3 on: 10 February 2010, 14:24 »

you tried it on a query or a server context?
In a channel window it works for me
Quote
/window.setCryptEngine $window Mircryption ABCDEF

but the Key has to be in Hex, what is ugly, but I found nothing else
Logged
oldhouse
Новичок
*

Репутация: 0
Posts: 5


View Profile
« Reply #4 on: 10 February 2010, 14:37 »

Thanks, using command with / works fine when executed in channel window. I hope it will work the same with correct target $window when called with OnMeJoin event.

BTW, if anyone is interested, you can use this site to convert txt into hex, so that you have right key to use in script:

hxxp://nickciske.com/tools/hex.php

Remember to remove last 00 bytes otherwise your key will be wrong.
Logged
ambossarm
Постоялец
***

Репутация: 11
Gender: Male
Posts: 113



View Profile
« Reply #5 on: 13 February 2010, 23:41 »

He did not tell me why, but
Quote
<CtrlAltCa> ambossarm: /echo $asciiToHex("Hello!")
So you do not have to use webpages Wink
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic