|
Lyriikka Beginner
Joined: 02 Oct 2002 Posts: 21 Location: Finland
|
Posted: Wed Oct 02, 2002 8:37 pm
Variables and difficult letters like #, @, % and * |
I want a variable @spells_vocals to contain following:
ziiiuuuuns wiz
habbi urblk
%
$ !^
# !(
huku mopo huku
hooooooooooowwwwwwwwwwwlllllllllllllll
# !#
^ !)
% !(
% !^
!(
$%&@ #*%@*@# $&*@#
demoni on pomoni
!( !!
!* *
yugzhrr paf
annihilar hzzz golum
These are examples. Ive used #additem, #file and %read to add them individually to @spells_vocals from a txt file, put #, @, !, ( etc letters always fuck it up.
How to store them correctly ? I'm using zmud 6,32.
Lyriikka the GenTnLadyLover |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Oct 03, 2002 1:28 am |
Using special characters for anything other than their intended purpose should be avoided. If they MUST be used, it's best to do so in a literal rather than a variable. That way, you can be certain all the necessary ~'s are where they need to be, and haven't been stripped by a previous command (like #VAR).
That is:
#AL curse {cast curse %1;say {~$~%~&~@ ~#~*~%~@~*~@~# ~$~&~*~@~# }}
LightBulb
Senior Member |
|
|
|
Lyriikka Beginner
Joined: 02 Oct 2002 Posts: 21 Location: Finland
|
Posted: Thu Oct 03, 2002 1:02 pm |
They work fine from a database, but I dont like to use database, becos I have a slow computer and it lags much.
When using them from a variable I can make my triggers to work almost instantly, but those special letters mix it up.
I'd wish that Zuggsoft would code some way to make this possible... =)
Lyriikka the GenTnLadyLover |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Oct 03, 2002 10:13 pm |
You can try using the %quote function to encapsulate all/some usages of that variable.
|
|
|
|
Evangelist Adept
Joined: 10 Oct 2000 Posts: 224 Location: USA
|
Posted: Thu Oct 03, 2002 10:59 pm |
Was the comment about it working from a database just a comment, or were you saying it doesn't work? I know if I want to send a special character to zmud, or capture a special character in another window, I just put a tilde before it, which is what lightbulb said. Anyway, say you wanted your email in, you could type YourName~@yourdomain.com and it would give you YourName@yourdomain.com.
Evangelist/Pernius
www.phidar.com/phidar.html |
|
|
|
Lyriikka Beginner
Joined: 02 Oct 2002 Posts: 21 Location: Finland
|
Posted: Sun Oct 06, 2002 11:25 pm |
My question is in the first post. ;)
Lyriikka the GenTnLadyLover |
|
|
|
kacp Newbie
Joined: 13 Sep 2002 Posts: 3 Location: USA
|
Posted: Sun Oct 13, 2002 1:34 am |
Have you tried using the %char function?
<%char(35)> would give you #
<%char(64)> would give you @
<%char(37)> would give you %
<%char(42)> would give you *
Not sure if that would work how you want to use it, but it's worth a shot.
kacp |
|
|
|
virtuous Wanderer
Joined: 08 Jan 2003 Posts: 60
|
Posted: Sat Mar 29, 2003 4:45 am |
Sorry to bring up an old post, but this might be useful for someone (especially for me, because this answered a problem I have even though I was searching for another problem altogether :P). I just now had the idea of using %replace when the text comes in (like in a tell or shout or something) and converting every special character to %char commands, and then they should work fine on output. I'm going to test it out myself, and if anyone else has success it'd be great if you tell us here.
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Mar 29, 2003 12:31 pm |
Yes, you could use %replace to convert all special characters to some other characters that you don't use but are also not one of zMUD's special characters. When it is time to use the stored text, just use %replace to restore the characters to how they are supposed to be. Sometimes this is easier than messing with the appropiate amount of ~'s.
If you use this method a lot, you could even create a function that replaces are special characters and another that reverses the process.
Kjata |
|
|
|
|
|