Advertisement
IHATEMICROWAVEOVEN

best universe movedex code

May 18th, 2023
1,029
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.19 KB | None | 0 0
  1. local x = "DracoMeteor  Dragon  150 RoarOfTime  Dragon  150 HyperBeam   Normal  150 ShadowForce Ghost   120 FireBlast   Fire    120 SacredFire  Fire    120 SeedFlare   Grass   120 Solarbeam   Grass   120 ZapCannon   Electric    120 Judgment    Normal  120 HydroPump   Water   110 Thunder Electric    110 DarkVoid    Dark    100 SpatialRend Dragon  100 Earthquake  Ground  100 IronTail    Steel   100 DragonPulse Dragon  90 Psychic  Psychic 90 Surf Water   90 Thunderbolt  Electric    90 AuraSphere   Fighting    80 DarkPulse    Dark    80 HyperFang    Normal  80 ShadowBall   Ghost   80 Bubblebeam   Water   75 AirSlash Flying  75 BodySlam Normal  70 Slash    Normal  70 FalseSwipe   Normal  65 AuroraBeam   Ice 65 Psybeam  Psychic 65 AncientPower Rock    60 Bite Dark    60 Dragonbreath Dragon  60 MagicLeaf    Grass   60 RockThrow    Rock    60 IcyWind  Ice 55 MetalClaw    Steel   55 RazorLeaf    Grass   55 MegaDrain    Grass   50 Bubble   Water   40 Confusion    Psychic 40 Ember    Fire    40 FuryCutter   Bug 40 Gust Flying  40 Pound    Normal  40 QuickAttack  Normal  40 Scratch  Normal  40 Tackle   Normal  40 Absorb   Grass   25 LeechLife    Bug 25 TheTruth Normal  0 Metronome Normal  0 Recover   Normal  0"
  2.  
  3. local types = {
  4.     ["None"] = 1,
  5.     ["Normal"] = 2,
  6.     ["Fire"] = 3,
  7.     ["Water"] = 4,
  8.     ["Electric"] = 5,
  9.     ["Grass"] = 6,
  10.     ["Ice"] = 7,
  11.     ["Fighting"] = 8,
  12.     ["Poison"] = 9,
  13.     ["Ground"] = 10,
  14.     ["Flying"] = 11,
  15.     ["Psychic"]  =12,
  16.     ["Bug"] = 13,
  17.     ["Rock"] = 14,
  18.     ["Ghost"] = 15,
  19.     ["Dragon"] = 16,
  20.     ["Dark"] = 17,
  21.     ["Steel"] = 18,
  22.     ["Fairy"] = 19
  23. }
  24.  
  25. print("local movedex = {")
  26. --for i = 1, 3 do
  27. while string.len(x)>1 do
  28.     io.write("\t")
  29.     local i = 1
  30.     while string.sub(x, i+1, i+1)~="\t" do i=i+1 end
  31.     local myMove = string.sub(x, 1, i)
  32.     for n = string.len(myMove), 1, -1 do
  33.         if string.sub(myMove, n, n) == " " then myMove = string.sub(myMove, 1, n-1)..string.sub(myMove, n+1) end
  34.     end
  35.     io.write("[\""..myMove.."\"] = {")
  36.    
  37.     x = string.sub(x, i+2)
  38.     i = 1
  39.     while string.sub(x, i+1, i+1)~="\t" do i=i+1 end
  40.     local myType = types[string.sub(x, 1, i)]
  41.     x = string.sub(x, i+2)
  42.     i = 1
  43.     while string.sub(x, i+1, i+1)~=" " and string.len(x)>=i+1 do i=i+1 end
  44.     io.write(string.sub(x, 1, i)..", acc, "..myType.."},\n")
  45.     x = string.sub(x, i+2)
  46. end
  47. io.write("}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement