|
tanja Newbie
Joined: 14 Jul 2005 Posts: 8
|
Posted: Fri Jul 15, 2005 4:48 am
%replace or any other method |
hello i wanted to make an alias called ssay so when i typed ssay hello it'll go through a %replace and come out as olleh
here's what i've done so far
#var {forward} {abcdefghijklmnopqrstuvwxyz}
#var {backward} {zyxwvutsrqponmlkjihgfedcba}
#alias {ssay} {text=%1;%replace(@text,@forward,@backward);say @text}
i've always tried just using the %1 instead of making it into a variable of @text but it doesnt seem to work either >< could someone help me out or point me in the right direction >< thanks.
i've always tried seperating each letter in the forward and backward variable with | but that didnt work either >< |
|
|
|
Vorax Apprentice
Joined: 29 Jun 2001 Posts: 198 Location: USA
|
Posted: Fri Jul 15, 2005 7:59 am |
Code: |
#ALIAS {ssay} {
#VARIABLE originaltext {%-1}
#VARIABLE backwardstext ""
#LOOP %len( @originaltext),1 {backwardstext = @backwardstext%copy( @originaltext, %i, 1)}
say @backwardstext
#UNVAR originaltext
#UNVAR backwardstext
} |
Usage:
ssay some sample text
Output:
say txet elpmas emos |
|
|
|
Orang Apprentice
Joined: 22 Jul 2004 Posts: 118 Location: USA
|
Posted: Fri Jul 15, 2005 1:23 pm |
i tried that and here's what i get:
Input:
say some sample text
Output:
say @backwardstext
Variable originaltext removed.
Variable backwardstext removed. |
|
|
|
tanja Newbie
Joined: 14 Jul 2005 Posts: 8
|
Posted: Fri Jul 15, 2005 1:25 pm |
well it works fine for me ^_^
but that was an example i wanted to make another language oO but i'll continue to tinker with it and see if anything works >< |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Fri Jul 15, 2005 1:30 pm |
Alias works fine for me. Orang, have you changed your variable character to something other than @ (or disabled it)?
Check View, Preferences, Special Characters |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Orang Apprentice
Joined: 22 Jul 2004 Posts: 118 Location: USA
|
Posted: Fri Jul 15, 2005 1:32 pm |
no i have not
|
|
|
|
tanja Newbie
Joined: 14 Jul 2005 Posts: 8
|
Posted: Fri Jul 15, 2005 1:33 pm |
is there a way that i could replace the normal english letters
a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z
with this alphabet each letter from front to back would replace english from front to back,
e|p|s|t|i|w|k|n|u|v|g|c|l|r|y|b|w|h|m|d|o|f|x|q|a|g|
i was able todo a little with this, but i found a problem when i wrote a sentence it would run through, and if that changed letter were to pass by again it'll change it once again making the language incorrect |
|
|
|
Orang Apprentice
Joined: 22 Jul 2004 Posts: 118 Location: USA
|
Posted: Fri Jul 15, 2005 1:34 pm |
i changed it to: #SEND {say @backwardstext} and works fine.. weird
|
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Fri Jul 15, 2005 7:40 pm |
VBSCRIPT! (must have allow vb script checked in prefrences and VB script must be installed (in most cases it is)
#ALIAS ssay {
#MSS {reverse=strReverse(~""%-1"~")}
say %mss(reverse)
} |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jul 15, 2005 9:18 pm |
You could use %subchar(). That does exactly what Tanja wants, but it also applies to the original question.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
tanja Newbie
Joined: 14 Jul 2005 Posts: 8
|
Posted: Fri Jul 15, 2005 11:29 pm |
could you explain how? i'm a bit noobish when it comes to new functions that i've never used before
|
|
|
|
Kiasyn Apprentice
Joined: 05 Dec 2004 Posts: 196 Location: New Zealand
|
Posted: Sat Jul 16, 2005 12:18 am |
#ALIAS ssay {
say %subchar("%-1", "abcdefghijklmnopqrstuvwxyz", "zyxwvutsrqponmlkjihgfedcba")
} |
|
|
|
|
|