Advertisement
Guest User

HarvestMap Import Data Update

a guest
Apr 11th, 2014
2,041
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. function Harvest.importFromEsohead()
  2.     d("import data from Esohead")
  3.     local profession
  4.  
  5.     d("Import harvest nodes:")
  6.     for map, data in pairs(EH.savedVars["harvest"].data) do
  7.         if string.find(map, "^", 1, true) == nil then
  8.             d("Importing data from "..map)
  9.             for index, nodes in pairs(data) do
  10.                 profession = index
  11.                 if profession == 6 then
  12.                     profession = 5
  13.                 end
  14.                 for _, node in pairs(nodes) do
  15.                     Harvest.saveData( map, node[1], node[2], profession, node[4], node[5] )
  16.                 end
  17.             end
  18.         end
  19.     end
  20.  
  21.     d("Import chests:")
  22.     for map, nodes in pairs(EH.savedVars["chest"].data) do
  23.         if string.find(map, "^", 1, true) == nil then
  24.             d("Importing data from "..map)
  25.             for _, node in pairs(nodes) do
  26.                 Harvest.saveData( map, node[1], node[2], 6, "chest", nil )
  27.             end
  28.         end
  29.     end
  30.  
  31.     d("finished")
  32.     Harvest.RefreshPins()
  33. end
  34.  
  35. SLASH_COMMANDS["/import"] = Harvest.importFromEsohead
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement