This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Encrypter Problems

Old posts that have not been replied to for several years.
Locked
s
spyda
Halfop
Posts: 64
Joined: Mon Aug 12, 2002 2:22 am
Location: Australia

Encrypter Problems

Post by spyda »

I started to write a encrption program that will work with my mirc one. But i cant get it to tell me what the number of the $chr is.

Code: Select all

Mirc. : $calc($asc($mid($1-,%enc.letter,1))+$asc($left(%key,1))
Tcl : [expr [string index [split $vasus] $asus_quest]]] + [string index [split $vasus] 0]]]

But i cant work out how get use $asc in TCL.. looked everywhere (about 5 hours all up) hope some one can help me

------------
ThePope
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You can do this using the scan command.
s
spyda
Halfop
Posts: 64
Joined: Mon Aug 12, 2002 2:22 am
Location: Australia

another problem!

Post by spyda »

When a nick has of course {}()_ or any of them other ones.. I have been working on my script and still cant make it take the {} from around value for the last two days.. I have come to my last idea!

Code: Select all

while {$asus_number <= [string length [lrange $msg 0 end]]} {
  set asus_key [string index [split $asus(key)] $asus_poss]
  set asus_word [string index $msg $asus_quest]
It works file with normal nicks.. but i can;t get it to work with nick with them chr in it.. I have looked at http://www.soft.net.uk/staffs/eggdrop/characters.html and still dont totally understand it... I hope someone can just give me a bump in the right direction.

------------
ThePope
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

If you have { } around your text, you're probably passing the function a list ($args) when it wants a string.

To go through each character of a string, use this:

foreach char [split $text ""] {
...
}

To turn a char into a number, use the "scan" command like ppslim said.

From the man page: scan string format ?varName varName ...?

So your string is $char, and your format is "c". You choose the varname.
Locked