Nee help to extract some variables!
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Nee help to extract some variables!

Started by Lassi, 07 April, 2005, 16:34:51

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lassi

Hi!

This is working lua-code, right?

---------------------------------------
GatherItems = {
   [1] = {
      [8] = {
         ["eisenablagerung"] = {
            [1] = {
               ["y"] = 41.14,
               ["x"] = 72.77,
               ["absy"] = 0.2952,
               ["absx"] = 0.5336,
               ["count"] = 6,
               ["icon"] = "eisenablag",
               ["gtype"] = "Ore",
            },
            [2] = {
               ["y"] = 70.44,
               ["x"] = 76.21,
               ["absy"] = 0.341,
               ["absx"] = 0.539,
               ["count"] = 4,
               ["icon"] = "eisenablag",
               ["gtype"] = "Ore",
            },
         },
         ["kupfervorkommen"] = {
            [1] = {
               ["y"] = 33.31,
               ["x"] = 73.33,
               ["absy"] = 0.283,
               ["absx"] = 0.5345,
               ["count"] = 3,
               ["icon"] = "kupfer",
               ["gtype"] = "Ore",
            },
         },
      },
   },
   [2] = {
      [5] = {
         ["pyrophor-mineralvorkommen"] = {
            [1] = {
               ["y"] = 60.92,
               ["x"] = 49.36,
               ["absy"] = 0.6685,
               ["absx"] = 0.0872,
               ["gtype"] = "Ore",
               ["icon"] = "pyrophor-mineral",
               ["count"] = 2,
            },
            [2] = {
               ["y"] = 63.33,
               ["x"] = 47.63,
               ["absy"] = 0.6705,
               ["absx"] = 0.0858,
               ["gtype"] = "Ore",
               ["icon"] = "pyrophor-mineral",
               ["count"] = 2,
            },
         },
         ["zinnvorkommen"] = {
            [1] = {
               ["y"] = 67.04,
               ["x"] = 53.45,
               ["absy"] = 0.6735,
               ["absx"] = 0.0906,
               ["gtype"] = "Ore",
               ["icon"] = "zinn",
               ["count"] = 2,
            },
            [2] = {
               ["y"] = 59.29,
               ["x"] = 50.94,
               ["absy"] = 0.6671,
               ["absx"] = 0.0886,
               ["gtype"] = "Ore",
               ["icon"] = "zinn",
               ["count"] = 3,
            },
            [3] = {
               ["y"] = 61.63,
               ["x"] = 46.92,
               ["absy"] = 0.669,
               ["absx"] = 0.0852,
               ["gtype"] = "Ore",
               ["icon"] = "zinn",
               ["count"] = 2,
            },
            [4] = {
               ["y"] = 61.13,
               ["x"] = 49.11,
               ["absy"] = 0.6686,
               ["absx"] = 0.087,
               ["gtype"] = "Ore",
               ["icon"] = "zinn",
               ["count"] = 2,
            },
            [5] = {
               ["y"] = 57.6,
               ["x"] = 54.05,
               ["absy"] = 0.6657,
               ["absx"] = 0.0911,
               ["gtype"] = "Ore",
               ["icon"] = "zinn",
               ["count"] = 3,
            },
            [6] = {
               ["y"] = 48.77,
               ["x"] = 36.58,
               ["absy"] = 0.6583,
               ["absx"] = 0.0766,
               ["gtype"] = "Ore",
               ["icon"] = "zinn",
               ["count"] = 3,
            },
         },
      },
      [20] = {
         ["kupfervorkommen"] = {
            [1] = {
               ["y"] = 56.43,
               ["x"] = 36.06,
               ["absy"] = 0.3174,
               ["absx"] = 0.5387,
               ["count"] = 3,
               ["icon"] = "kupfer",
               ["gtype"] = "Ore",
            },
            [2] = {
               ["y"] = 66.32,
               ["x"] = 42.76,
               ["absy"] = 0.3282,
               ["absx"] = 0.546,
               ["count"] = 4,
               ["icon"] = "kupfer",
               ["gtype"] = "Ore",
            },
            [3] = {
               ["y"] = 70.4,
               ["x"] = 44.09,
               ["absy"] = 0.3326,
               ["absx"] = 0.5475,
               ["count"] = 2,
               ["icon"] = "kupfer",
               ["gtype"] = "Ore",
            },
            [4] = {
               ["y"] = 78.27,
               ["x"] = 58.53,
               ["absy"] = 0.3412,
               ["absx"] = 0.5633,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 2,
            },
            [5] = {
               ["y"] = 68.36,
               ["x"] = 70.38,
               ["absy"] = 0.3304,
               ["absx"] = 0.5762,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 4,
            },
            [6] = {
               ["y"] = 53.57,
               ["x"] = 67.82,
               ["absy"] = 0.3142,
               ["absx"] = 0.5734,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 2,
            },
            [7] = {
               ["y"] = 48.26,
               ["x"] = 73.55,
               ["absy"] = 0.3084,
               ["absx"] = 0.5797,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 4,
            },
            [8] = {
               ["y"] = 22.08,
               ["x"] = 74.04,
               ["absy"] = 0.2798,
               ["absx"] = 0.5802,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 3,
            },
            [9] = {
               ["y"] = 26.9,
               ["x"] = 68.03,
               ["absy"] = 0.2851,
               ["absx"] = 0.5736,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 3,
            },
            [10] = {
               ["y"] = 14.27,
               ["x"] = 57.91,
               ["absy"] = 0.2712,
               ["absx"] = 0.5626,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 4,
            },
            [11] = {
               ["y"] = 13,
               ["x"] = 41.64,
               ["absy"] = 0.2699,
               ["absx"] = 0.5448,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 3,
            },
            [12] = {
               ["y"] = 9.11,
               ["x"] = 40.87,
               ["absy"] = 0.2656,
               ["absx"] = 0.5439,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 3,
            },
            [13] = {
               ["y"] = 9.62,
               ["x"] = 30.86,
               ["absy"] = 0.2662,
               ["absx"] = 0.533,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 2,
            },
         },
         ["zinnvorkommen"] = {
            [1] = {
               ["y"] = 63.31,
               ["x"] = 69.96,
               ["absy"] = 0.3249,
               ["absx"] = 0.5758,
               ["gtype"] = "Ore",
               ["icon"] = "zinn",
               ["count"] = 3,
            },
            [2] = {
               ["y"] = 28.19,
               ["x"] = 72.16,
               ["absy"] = 0.2865,
               ["absx"] = 0.5782,
               ["gtype"] = "Ore",
               ["icon"] = "zinn",
               ["count"] = 2,
            },
            [3] = {
               ["y"] = 25.74,
               ["x"] = 74.01,
               ["absy"] = 0.2838,
               ["absx"] = 0.5802,
               ["gtype"] = "Ore",
               ["icon"] = "zinn",
               ["count"] = 4,
            },
            [4] = {
               ["y"] = 18.53,
               ["x"] = 68.1,
               ["absy"] = 0.2759,
               ["absx"] = 0.5737,
               ["gtype"] = "Ore",
               ["icon"] = "zinn",
               ["count"] = 4,
            },
         },
      },
      [17] = {
         ["kupfervorkommen"] = {
            [1] = {
               ["y"] = 49.97,
               ["x"] = 53.45,
               ["absy"] = 0.69,
               ["absx"] = 0.4357,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 4,
            },
            [2] = {
               ["y"] = 61.07,
               ["x"] = 65.61,
               ["absy"] = 0.6943,
               ["absx"] = 0.4403,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 2,
            },
            [3] = {
               ["y"] = 57.34,
               ["x"] = 71.24,
               ["absy"] = 0.6928,
               ["absx"] = 0.4425,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 4,
            },
            [4] = {
               ["y"] = 52.85,
               ["x"] = 68.82,
               ["absy"] = 0.6911,
               ["absx"] = 0.4416,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 4,
            },
            [5] = {
               ["y"] = 59.51,
               ["x"] = 70.68,
               ["absy"] = 0.6937,
               ["absx"] = 0.4423,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 2,
            },
            [6] = {
               ["y"] = 57.35,
               ["x"] = 68.86,
               ["absy"] = 0.6928,
               ["absx"] = 0.4416,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 4,
            },
            [7] = {
               ["y"] = 63.14,
               ["x"] = 73.74,
               ["absy"] = 0.695,
               ["absx"] = 0.4434,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 3,
            },
            [8] = {
               ["y"] = 62.52,
               ["x"] = 71.23,
               ["absy"] = 0.6948,
               ["absx"] = 0.4425,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 3,
            },
            [9] = {
               ["y"] = 58.81,
               ["x"] = 67.06,
               ["absy"] = 0.6934,
               ["absx"] = 0.4409,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 2,
            },
         },
      },
      [18] = {
         ["silbervorkommen"] = {
            [1] = {
               ["y"] = 62.74,
               ["x"] = 81.69,
               ["absy"] = 0.9078,
               ["absx"] = 0.5395,
               ["count"] = 3,
               ["icon"] = "silber",
               ["gtype"] = "Ore",
            },
         },
         ["kupfervorkommen"] = {
            [1] = {
               ["y"] = 51.16,
               ["x"] = 82.29,
               ["absy"] = 0.8868,
               ["absx"] = 0.5406,
               ["count"] = 3,
               ["icon"] = "kupfer",
               ["gtype"] = "Ore",
            },
            [2] = {
               ["y"] = 55.54,
               ["x"] = 84.16,
               ["absy"] = 0.8948,
               ["absx"] = 0.544,
               ["count"] = 3,
               ["icon"] = "kupfer",
               ["gtype"] = "Ore",
            },
         },
      },
      [22] = {
         ["silbervorkommen"] = {
            [1] = {
               ["y"] = 12.84,
               ["x"] = 44.89,
               ["absy"] = 0.2416,
               ["absx"] = 0.4419,
               ["gtype"] = "Ore",
               ["icon"] = "silber",
               ["count"] = 2,
            },
         },
      },
   },
   [0] = {
      [0] = {
         ["kupfervorkommen"] = {
            [1] = {
               ["y"] = 53.31,
               ["x"] = 70.19,
               ["absy"] = 0.5331,
               ["absx"] = 0.7019,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 2,
            },
            [2] = {
               ["y"] = 51.47,
               ["x"] = 71.55,
               ["absy"] = 0.5147,
               ["absx"] = 0.7155,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 4,
            },
            [3] = {
               ["y"] = 54.17,
               ["x"] = 72.98,
               ["absy"] = 0.5417,
               ["absx"] = 0.7298,
               ["gtype"] = "Ore",
               ["icon"] = "kupfer",
               ["count"] = 4,
            },
         },
      },
   },
}
---------------------------------

I extracted this piece of code from some kind of savegame-file of the game world of warcraft. (savedvariables.lua).
I tried to extract the values and the variable's names with perl, but I had not enough time and so no success.

I thought that it would be much easier to run this code in lua and put the vars into a file or db to read them later with perl.
But the problem is: I can't code lua! (sorry for bad english, how would this sentence be correct?)

Can you help me with some lines of code, that executes thes vars an write them into a db or a file?


Thanks
L'assi

P.S.:
Sorry for bad english, i'm going still to school (10th grade)
If you find some mistakes (I think you will  ;) ), please correct them.

plop

it's a lua table which can simply be executed with:
dofile("savedvariables.lua")

for the rest we need some more info, like file layout or db type.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Lassi

Ok, thx for the answer.

Finally, I coded it with perl, because the perl syntax is very similar to the lua syntax, I only had to chance some
'[' and '=' to '=>', and it worked :)

SMF spam blocked by CleanTalk