mIRC Home    About    Download    Register    News    Help

Print Thread
#91974 28/07/04 01:58 AM
Joined: Jul 2004
Posts: 6
I
InAkI Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Jul 2004
Posts: 6
I need help making a script where you turn on/off translation trough /albhed-on and /albhed-off
the translation table is

A = E
G = K
M = L
S = M
Y = A
B = P
H = N
N = R
T = D
Z = J
C = S
I = U
O = Y
U = O
D = T
J = V
P = B
V = F
E = I
K = G
Q = X
W = Z
F = W
L = C
R = H
X = Q

thats it, if i could get help , thanks

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Copy & Paste into the Remote (Alt+R)
  • alias albhed-on .enable #albhed
    alias albhed-off .disable #albhed

    #albhed off
    On *:input:#:{
    if /* iswm $1 || $ctrlenter || $inpaste { return }
    say $albhed_enc($1-)
    halt
    }
    #albhed end

    alias albhed_enc {
    return $replacex($1-,a,e, g,k, m,l, s,m, y,a, b,p, h,n, n,r, t,d, z,j, c,s, $&
    i,u, o,y, u,o, d,t, j,v, p,b, v,f, e,i, k,g, q,x, w,z, f,w, l,c, r,h, x,q)
    }

    alias albhed_dec {
    return $replacex($1-,e,a, k,g, l,m, m,s, a,y, p,b, n,h, r,n, d,t, j,z, s,c, $&
    u,i, y,o, o,u, t,d, v,j, b,p, f,v, i,e, g,k, x,q, z,w, w,f, c,l, h,r, q,x)
    }
The following sections of the help file might interest you:
  • /help on input
    /help on text [color:black]- if you wish to decode incoming messages.

    /help $replacexs
    /help groups[/color]
If you want the uppercase smiley letters (laugh, :P) to remain intact, use $replacexcs() in your encoding and decoding functions.

By pressing Ctrl+Enter in the editbox you can bypass the script and have your text sent to the chat window without being processed.

Also, you can use the identifier $group(#albhed) as an indicator of the script state (on/off)

Joined: Jul 2004
Posts: 6
I
InAkI Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Jul 2004
Posts: 6
it doesnt work.

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
$replacex was added in 6.15. Maybe you're using an older version?

Joined: Jul 2004
Posts: 6
I
InAkI Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Jul 2004
Posts: 6
I'm using 6.01. It's my standard scripting unit i'm testing it out on, but if you could redo it for 6.01, i'd be grateful. Also,
I do wish it to decode incoming messages.
BTW--
e=a
k=g
l=m
m=s
a=y
p=b
n=h
r=n
d=t
j=z
s=c
u=i
y=o
o=u
t=d
v=j
b=p
f=v
i=e
g=k
x=q
z=w
w=f
c=m
h=r
q=x
The table was reversed, sorry.

Last edited by InAkI; 28/07/04 02:00 PM.
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I wrote a $replacex alias, before $replacex was added in mirc, you may want to give it a try.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
To decode, add this anywhere between #albed off and #albhed end:
  • On ^*:text:*:[color:blue]#channel:{
    echo -cmbflirt normal # $+(<,$nick,>) $albhed_dec($1-)
    haltdef
    }[/color]
Use # instead of #channel if you want the script to decode incoming messages on all channels.

Joined: Jul 2004
Posts: 6
I
InAkI Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Jul 2004
Posts: 6
It still doesnt work after i put the $replacex

Joined: Jul 2004
Posts: 6
I
InAkI Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Jul 2004
Posts: 6
It stil doesn't work! I don't get the /say error after i got the $replacex script but it doesnt work
and the tables were messed up but they should work now

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
There's a problem with copying and pasting code that is inside the forum's [[/i]code] tags. If you're using Internet Explorer, the multiline code will lose its line-breaks, and the script will become messed-up.

Try to take the alias from here,
  • alias replacex {
    if $0 == 1 || $0 !& 1 { echo -seic info * Invalid parameters: $!replacex | halt }
    var %i = 2, %s = $1, %c = $iif($prop != cs,i)
    while %i < $0 {
    !.echo -q $regsub(%s,$+(/\Q,$replacecs($ [ $+ [ %i ] ],\E,\E\\E\Q),\E(?=[^\n\r]*(?:$|\n))/g,%c),$+($lf,$replace($ [ $+ [ $calc(%i + 1) ] ],\,\\,$,\$),$cr),%s)
    inc %i 2
    }
    $iif($isid,return,echo -a) $remove(%s,$cr,$lf)
    }
After you put it in the remote, make sure all of these commands display something
  1. //echo -a $replacex(ab,a,b,b,a)
  2. //echo -a $albhed_dec(zyhgm)
  3. //echo -a $albhed_enc(rammu)

Joined: Jul 2004
Posts: 6
I
InAkI Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Jul 2004
Posts: 6
I got the replacex fine, the code pops up, but it's NOT translated. confused help PLEASE

Joined: Mar 2004
Posts: 96
G
Babel fish
Offline
Babel fish
G
Joined: Mar 2004
Posts: 96
okay, try this code. First step is to place this in your remote section

Code:
alias albhedon {
  /load -rs "albhed.mrc"
}
alias albhedoff {
  /unload -rs "albhed.mrc"
}  


Then open up notepad and put this code in it.

Code:
 On *:input:#: if /* !iswm $1 { say $replace($1-,A,E,B,P,C,S,D,T,E,I,F,W,G,K,H,N,I,U,J,V,K,G,L,C,M,L,N,R,O,Y,P,B,Q,X,R,H,S,M,T,D,U,O,V,F,W,Z,X,Q,Y,A,Z,J) | halt }  


Then save the file as a .mrc file by saving it as "albhed.mrc"
Note in order to get the .mrc extension and not the .txt extension you must include the " in the file name. so the file name should be: "albhed.mrc"

then when ever you want the script to work, just type /albhedon and hit enter. After that, anytime you say soemthing it wil come out in albhed.

There might be some way of making this simplier but I like having very little code in my reomte section, having most of my scripts being loadable and unloadable.

Last edited by Gremel; 29/07/04 04:14 AM.

Link Copied to Clipboard