Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
nettalk:scripting:morsecode [2006/02/01 21:08] 192.168.0.50 |
nettalk:scripting:morsecode [2006/02/01 21:08] (aktuell) 192.168.0.50 |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== Morsecode ====== | ||
+ | Der Text muss mit AltGr+M gesendet werden damit er konvertiert wird | ||
+ | |||
+ | <code vb> | ||
+ | #NewScriptBegin Morsecode | ||
+ | |||
+ | Function Translate(Text) | ||
+ | StrOut="" | ||
+ | i=1 | ||
+ | do until i > len(Text) | ||
+ | a=0 | ||
+ | C=AscW(mid(Text,i,1)) | ||
+ | if mid(Text,i,2)="je" and a=0 Then | ||
+ | C=1077 | ||
+ | a=2 | ||
+ | End if | ||
+ | if mid(Text,i,4)="'sch" and a=0 Then | ||
+ | C=1078 | ||
+ | a=4 | ||
+ | End if | ||
+ | if mid(Text,i,2)="ch" and a=0 Then | ||
+ | C=1093 | ||
+ | a=2 | ||
+ | end if | ||
+ | if mid(Text,i,4)="tsch" and a=0 Then | ||
+ | C=1095 | ||
+ | a=4 | ||
+ | end if | ||
+ | if mid(Text,i,4)="scht" and a=0 Then | ||
+ | C=1097 | ||
+ | a=4 | ||
+ | end if | ||
+ | if mid(Text,i,3)="sch" and a=0 Then | ||
+ | C=1096 | ||
+ | a=3 | ||
+ | End if | ||
+ | if mid(Text,i,2)="ie" and a=0 Then | ||
+ | C=1099 | ||
+ | a=2 | ||
+ | End if | ||
+ | if mid(Text,i,2)="je" and a=0 Then | ||
+ | C=1101 | ||
+ | a=2 | ||
+ | End if | ||
+ | if mid(Text,i,2)="ju" and a=0 Then | ||
+ | C=1102 | ||
+ | a=2 | ||
+ | End if | ||
+ | if mid(Text,i,2)="ja" and a=0 Then | ||
+ | C=1103 | ||
+ | a=2 | ||
+ | End if | ||
+ | if mid(Text,i,2)="jo" and a=0 Then | ||
+ | C=1105 | ||
+ | a=2 | ||
+ | End if | ||
+ | if a=0 Then | ||
+ | a=1 | ||
+ | tch=mid(Text,i,1) | ||
+ | if tch="a" Then C=1072 | ||
+ | if tch="b" Then C=1073 | ||
+ | if tch="w" Then C=1074 | ||
+ | if tch="v" Then C=1074 | ||
+ | if tch="g" Then C=1075 | ||
+ | if tch="d" Then C=1076 | ||
+ | if tch="s" Then C=1079 | ||
+ | if tch="i" Then C=1080 | ||
+ | if tch="j" Then C=1081 | ||
+ | if tch="k" Then C=1082 | ||
+ | if tch="l" Then C=1083 | ||
+ | if tch="m" Then C=1084 | ||
+ | if tch="n" Then C=1085 | ||
+ | if tch="o" Then C=1086 | ||
+ | if tch="p" Then C=1087 | ||
+ | if tch="r" Then C=1088 | ||
+ | if tch="ß" Then C=1089 | ||
+ | if tch="t" Then C=1090 | ||
+ | if tch="u" Then C=1091 | ||
+ | if tch="f" Then C=1092 | ||
+ | if tch="z" Then C=1094 | ||
+ | if tch="'" Then C=1100 | ||
+ | if tch="e" Then C=1077 | ||
+ | End if | ||
+ | i=i+a | ||
+ | StrOut=StrOut & C | ||
+ | loop | ||
+ | Translate=StrOut | ||
+ | End Function | ||
+ | |||
+ | Sub KeyShortcut(KeyCode, Shift) | ||
+ | if Shift=6 and KeyCode=Asc("M") Then | ||
+ | Send Translate(TextBox), FrontFrameID | ||
+ | TextBox="" | ||
+ | skipevent | ||
+ | End if | ||
+ | End Sub | ||
+ | </code> |