View Single Post
11-10-12, 03:08 PM   #3
jeruku
A Cobalt Mageweaver
 
jeruku's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 223
Some clarity

Originally Posted by Farmbuyer View Post
What, exactly, are you referring to as "bytecode"?

That doesn't mean what you think it means in a Lua context. Or at least, not in a forum about Lua addons. Perhaps we can clear up any confusion.
Well in the context given it involves the string byte code to be precise. As seen in the ever popular addon Carbonite where it's used to condense values and coordinates. My question is whether or not it's possible to condense a "word" string such as that "Sharptalon's Claw" could be saved as something smaller in a "byte" string.


Also, I figured out the answer to my first question. This, when used in an addon, will output the values in an indexed format directly into the addons saved variables file and print it to the current chatframe.
Code:
if not aSavedVariable then aSavedVariable = {} end-- some SavedVariable table

aSavedVariable [0] = string.char(0)
print(0 .. " = " .. strbyte(string.char(0))
--tinsert(aSavedVariable , string.char(0))

for x = 1, 255 do
  aSavedVariable [x] = string.char(x)
  print(x .. " = " .. strbyte(string.char(x))
  --tinser(aSavedVariable , string.char(x))
end
__________________
"I have not failed, I simply found 10,000 ways that did not work." - Thomas Edison

Last edited by jeruku : 11-10-12 at 03:21 PM. Reason: typo: x outside loop
  Reply With Quote