HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Simples Questions, I need help.

03-19-2004, 05:36 PM#1
Silversuns
I tried to find a thread for this answer but I didnt found anything.
1-
Can any tell me how I can make something like hex system but it use all the letter like a to z and use 0 to 9 too, thats mean it use 0 to z. (36 characteres)
(0123456789abcdefghijklmnopqrstuvwxyz) and if its possible to use symbol...(±@£¢¤¬¦²³¼½¾~´*¯, for exemple)
2-
How can I separate a chat string in lot more, like each letter can be separate in a new variable array string.
For exemple: Chat entered:
hi-cool-happy
String(1) = h
String(2) = i
String(3) = -
String(4) = c
String(5) = o
...
Can you help me for this 2 littles questions, it's for a code system I have in mind.
Thank you!
03-19-2004, 08:48 PM#2
johnfn
Quote:
Originally Posted by Silversuns
(±@£¢¤¬¦²³¼½¾~´*¯, for exemple)

First let me mention that no one will know how to type these in (except with trial and error) so it might not be a good idea for these. BUT


Quote:
2-
How can I separate a chat string in lot more, like each letter can be separate in a new variable array string.

Here's a trigger, im not sure if its perfect as i am to lazy to open up WE


do the code for when they enter a chat string. Then assuming you have the string in a variable string called chatstr:

for each integer A from 1 to (length of(chatstr)) do multiple actions
set variable pieces_of_chat_str(integer A) = substring (chatstr, Integer A, 1)



The only potential worry with that is that im not sure if there is a length of() function. YOu might have to work around that somehow.
03-23-2004, 02:37 AM#3
Silversuns
Quote:
do the code for when they enter a chat string. Then assuming you have the string in a variable string called chatstr:

for each integer A from 1 to (length of(chatstr)) do multiple actions
set variable pieces_of_chat_str(integer A) = substring (chatstr, Integer A, 1)
I try to figure out how but I don't see anything to split it.
By the way, what is substring?
I need to find out, plz help me. Thank you!
03-23-2004, 04:23 AM#4
RaeVanMorlock
Quote:
Originally Posted by Silversuns
Can any tell me how I can make something like hex system but it use all the letter like a to z and use 0 to 9 too, thats mean it use 0 to z. (36 characteres)

0123456789ABCDEF is Hex because it's a number system that uses base 16, meaning each place value is worth 16 because there are 16 digits in the number system. So:

Code:
A2DE3 in base 10 is equal to...
  A * (16^4)
+ 2 * (16^3)
+ D * (16^2)
+ E * (16^1)
+ 3 * (16^0)

Using that methodology, you can create a number system with any number of digits in it.


Quote:
Originally Posted by Silversuns
I try to figure out how but I don't see anything to split it.
By the way, what is substring?
I need to find out, plz help me. Thank you!

Substring is a function that takes a part of a string.

If the variable MyStr = "I am bob" then
substring(MyStr, 3, 1) = "a"
substring(MyStr, 4, 3) = "m b"

Granted, this depends if WC3's string indexing starts at 0 or 1 (I assume 1) and if it's last paramater is the number of strings characters to get (as I assumed) or the index to stop at--but a very similiar example to this is posted in the comment of the function and will clear it up for you.

If any of this doesn't make sense, I suggest you devote some time to reading online tutorials about number systems and string manipulation.
03-24-2004, 04:54 AM#5
Silversuns
Ok I understand the substring thing I found a good tut for the string and substring. I know what is Hex system, but I want to make something with base of higher number Hex use like 16 characteres and i want to use like 36 or 62 characteres, but I don't know to make one system in trigger ... like this Hex. I will try to find a way, but you can help me tough to find a better solution.
Thank you!
-Silversuns