View Single Post
05/30/14, 12:43 AM   #5
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 655
I am going to try this Lua console from source forge, no idea how to use it yet though. ^_^

Does anyone know a good Lua console that is easy to run like Python and Ruby?

Lua Code:
  1. Harvest.langs = { "en", "de", "fr", }
  2.  
  3. Harvest.woodworking = {
  4.     ["en"] = {
  5.         "Ashtree",
  6.         "Beech",
  7.         "Birch",
  8.         "Hickory",
  9.         "Mahogany",
  10.         "Maple",
  11.         "Nightwood",
  12.         "Oak",
  13.         "Yew",
  14.     },
  15.     ["de"] = {
  16.         "Eschenholz",
  17.         "Buche", -- "Buchenholz"
  18.         "Birkenholz",
  19.         "Hickoryholz",
  20.         "Mahagoniholz",
  21.         "Ahornholz",
  22.         "Nachtholz",
  23.         "Eiche",
  24.         "Eibenholz",
  25.     },
  26.     ["fr"] = {
  27.         "Frêne",
  28.         "Hêtre",
  29.         "Bouleau",
  30.         "Hickory",
  31.         "Acajou",
  32.         "Érable",
  33.         "Bois de nuit",
  34.         "Chêne",
  35.         "If",
  36.     },
  37. }
  38.  
  39. function Harvest.IsValidWoodworkingName(name)
  40.     local nameMatch = false
  41.     for lang, langs in pairs(Harvest.langs) do
  42.         for k, v in pairs(Harvest.woodworking[langs]) do
  43.             if v == name then
  44.                 nameMatch = true
  45.             end
  46.         end
  47.     end
  48.  
  49.     return nameMatch
  50. end

That all works fine, so I have to build off of it and try to apply it to what I want with the map names.
  Reply With Quote