Advertisement
BobMe

Text to ASCII numbers

Apr 11th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. --reconvert here: http://www.unit-conversion.info/texttools/ascii/#data
  2. --test the script here: https://rextester.com/l/lua_online_compiler
  3.  
  4. function byteentirestring(str)
  5. local kek = {}
  6. for i=1,#str do
  7. local i = (string.len(str) - i) + 1
  8. hec = string.sub(str,i,i)
  9. hec = string.byte(hec)
  10. table.insert(kek,1,hec)
  11. end
  12. return kek
  13. end
  14.  
  15. strin = "Baby shark, doo doo doo doo doo doo\nBaby shark, doo doo doo doo doo doo\nBaby shark, doo doo doo doo doo doo\nBaby shark!\nMommy shark, doo doo doo doo doo doo\nMommy shark, doo doo doo doo doo doo\nMommy shark, doo doo doo doo doo doo\nMommy shark!\nDaddy shark, doo doo doo doo doo doo\nDaddy shark, doo doo doo doo doo doo\nDaddy shark, doo doo doo doo doo doo\nDaddy shark!\nGrandma shark, doo doo doo doo doo doo\nGrandma shark, doo doo doo doo doo doo\nGrandma shark, doo doo doo doo doo doo\nGrandma shark!\nGrandpa shark, doo doo doo doo doo doo\nGrandpa shark, doo doo doo doo doo doo\nGrandpa shark, doo doo doo doo doo doo\nGrandpa shark!\nLet's go hunt, doo doo doo doo doo doo\nLet's go hunt, doo doo doo doo doo doo\nLet's go hunt, doo doo doo doo doo doo\nLet's go hunt!\nRun away, doo doo doo doo doo doo\nRun away, doo doo doo doo doo doo\nRun away, doo doo doo doo doo doo\nRun away!\nSafe at last, doo doo doo doo doo doo\nSafe at last, doo doo doo doo doo doo\nSafe at last, doo doo doo doo doo doo\nSafe at last!\nIt's the end, doo doo doo doo doo doo\nIt's the end, doo doo doo doo doo doo\nIt's the end, doo doo doo doo doo doo\nIt's the end!"
  16. heck = byteentirestring(strin)
  17.  
  18. strn = ""
  19.  
  20. for i=1,#heck do
  21. yes = false
  22. local kek = heck[i]
  23. if kek < 100 then yes = true end
  24. kek = tostring(kek)
  25. if yes == true then
  26. kek = "0"..kek
  27. else
  28. kek = kek
  29. end
  30. strn = strn..kek.." "
  31. end
  32.  
  33. print(strn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement