SHARE
TWEET

Minecraft 1.13 Datapack Updater 2.0

UncleThaodan Mar 25th, 2018 (edited) 2,372 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <File.au3>
  2. #include <GUIConstantsEx.au3>
  3. #include <FileConstants.au3>
  4. #include <ProgressConstants.au3>
  5. #include <File.au3>
  6. ;~ #include <Excel.au3>
  7. $gui = GUICreate("Minecraft Updater", 430, 150)
  8. ;~ global $path = @AppDataDir &"\.minecraft\saves\world\"
  9. global $path = "G:\Users\John Snow\AppData\Roaming\.minecraft\saves\LOL 0.85"
  10. $box1 = GUICtrlCreateInput($path,15,10, 400)
  11. $box2 = GUICtrlCreateInput("datapack_name",15,40, 400)
  12. $prog = GUICtrlCreateProgress(15, 70, 400, 20)
  13. $search = GUICtrlCreateButton("Update",175,100,80)
  14. GUISetState(@SW_SHOW, $gui)
  15.  
  16. func libs()
  17. global $commands = 50
  18. global $tags = 8
  19. global $lib[$commands][2][$tags] = [ _
  20.    [["scoreboard", "players","tag","","add","","",""],["","","tag","*","add","*","*","*"]], _
  21.    [["scoreboard", "players","tag","","remove","","",""],["","","tag","*","remove","*","*","*"]], _
  22.    [["scoreboard", "teams","","","","","",""],["team","","*","*","*","*","*","*"]], _
  23.    [["","","","scoreboard","players","tag","","add"],["*","*","*","","run","tag","*","add"]], _
  24.    [["","","","scoreboard","players","tag","","remove"],["*","*","*","","run","tag","*","remove"]], _
  25.    [["","","","scoreboard","teams","","",""],["*","*","*","run","team","*","*","*"]], _
  26.    [["","","","scoreboard","team","","",""],["*","*","*","run","team","*","*","*"]], _
  27.    [["gamemode","0","","","","","",""],["gamemode","survival","*","*","*","*","*","*"]], _
  28.    [["gamemode","1","","","","","",""],["gamemode","creative","*","*","*","*","*","*"]], _
  29.    [["gamemode","2","","","","","",""],["gamemode","adventure","*","","","","*","*"]], _
  30.    [["gamemode","3","","","","","",""],["gamemode","spectator","*","","","","*","*"]], _
  31.    [["gamemode","s","","","","","",""],["gamemode","survival","*","*","*","*","*","*"]], _
  32.    [["gamemode","c","","","","","",""],["gamemode","creative","*","*","*","*","*","*"]], _
  33.    [["gamemode","a","","","","","",""],["gamemode","adventure","*","","","","*","*"]], _
  34.    [["gamemode","s","","","","","",""],["gamemode","spectator","*","","","","*","*"]], _
  35.    [["effect","","clear","","","","",""],["effect clear","*","","","","","*","*"]], _
  36.    [["effect","","","0","","","",""],["effect clear","*","*","","","","*","*"]], _
  37.    [["effect","","","","","","",""],["effect give","*","*","*","*","*","*","*"]], _
  38.    [["","function","","","","","",""],["*","run function","*","*","*","*","*","*"]], _
  39.    [["","say","","","","","",""],["*","run say","*","*","*","*","*","*"]], _
  40.    [["","scoreboard","","","","","",""],["*","run scoreboard","*","*","*","*","*","*"]], _
  41.    [["","gamemode","","","","","",""],["*","run gamemode","*","*","*","*","*","*"]], _
  42.    [["","fill","","","","","",""],["*","run fill","*","*","*","*","*","*"]], _
  43.    [["","playsound","","","","","",""],["*","run playsound","*","*","*","*","*","*"]], _
  44.    [["","replaceitem","","","","","",""],["*","run replaceitem","*","*","*","*","*","*"]], _
  45.    [["","kill","","","","","",""],["*","run kill","*","*","*","*","*","*"]], _
  46.    [["","summon","","","","","",""],["*","run summon","*","*","*","*","*","*"]], _
  47.    [["","spreadplayers","","","","","",""],["*","run spreadplayers","*","*","*","*","*","*"]], _
  48.    [["","particle","","","","","",""],["*","run particle","*","*","*","*","*","*"]], _
  49.    [["","","","","title","","title",""],["*","*","*","*","run title","*","title","*"]], _
  50.    [["","","","","title","","actionbar",""],["*","*","*","*","run title","*","actionbar","*"]], _
  51.    [["","","","","title","","clear",""],["*","*","*","*","run title","*","clear","*"]], _
  52.    [["","","","","title","","reset",""],["*","*","*","*","run title","*","reset","*"]], _
  53.    [["","","","","title","","subtitle",""],["*","*","*","*","run title","*","subtitle","*"]], _
  54.    [["","","","","title","","times",""],["*","*","*","*","run title","*","times","*"]], _
  55.    [["","","","","at","","title",""],["*","*","*","*","at","*","run title","*"]], _
  56.    [["","","","","","at @s","title",""],["*","*","*","*","*","at @s","run title","*"]], _
  57.    [["","","","at @s","","","title",""],["*","*","*","*","*","*","run title","*"]], _
  58.    [["title","[]","","","","","",""],["title",'[""]',"*","*","*","*","*","*"]], _
  59.    [["","tp","","","","","",""],["*","run tp","*","*","*","*","*","*"]], _
  60.    [["","effect","","clear","","","",""],["*","run effect clear","*","","","","",""]], _
  61.    [["","effect","","","0","","",""],["*","run effect clear","*","*","","","",""]], _
  62.    [["","effect","","","","","",""],["*","run effect give","*","*","*","*","*","*"]], _
  63.    [["","clone","","","","","",""],["*","run clone","*","*","*","*","*","*"]], _
  64.    [["","entitydata","","","","","",""],["*","run data merge entity","*","*","*","*","*","*"]], _
  65.    [["","give","","","","","",""],["*","run give","*","*","*","*","*","*"]], _
  66.    [["xp","","","","","","",""],["experience add","*","*","*","*","*","*","*"]], _
  67.    [["","","","detect","","","",""],["*","*","*","if block","*","*","*","*"]], _
  68.    [["","","","","","","","entitydata"],["*","*","*","*","*","*","*","data merge entity"]], _
  69.    [["entitydata","","","","","","",""],["data merge entity","*","*","*","*","*","*","*"]] _
  70.    ]
  71.  
  72.  
  73.  
  74. ;~       [["","","","","","tag","",""],["*","*","*","*","*","run tag","*","*"]], _
  75. ;~    [["","","","","","team","",""],["*","*","*","*","*","run team","*","*"]], _
  76.  
  77. global $short = 20
  78. global $shortlib[$short][2] = [ _
  79.    ["m=0","gamemode=survival"], _
  80.    ["m=1","gamemode=creative"], _
  81.    ["m=2","gamemode=adventure"], _
  82.    ["m=3","gamemode=spectator"], _
  83.    ["m=s","gamemode=survival"], _
  84.    ["m=c","gamemode=creative"], _
  85.    ["m=a","gamemode=adventure"], _
  86.    ["m=s","gamemode=spectator"], _
  87.    ["m=!0","gamemode=!survival"], _
  88.    ["m=!1","gamemode=!creative"], _
  89.    ["m=!2","gamemode=!adventure"], _
  90.    ["m=!3","gamemode=!spectator"], _
  91.    ["m=!s","gamemode=!survival"], _
  92.    ["m=!c","gamemode=!creative"], _
  93.    ["m=!a","gamemode=!adventure"], _
  94.    ["m=!s","gamemode=!spectator"], _
  95.    ["c=","limit="], _
  96.    ["m=","gamemode="], _
  97.    ["entitydata","data merge entity"] _
  98.    ]
  99.  
  100. global $particle = 45
  101. global $particlelib[$particle][2] = [ _
  102.    ["angryVillager","minecraft:angry_villager"], _
  103.    ["barrier","minecraft:barrier"], _
  104.    ["blockcrack","minecraft:block"], _
  105.    ["blockdust","minecraft:block"], _
  106.    ["bubble","minecraft:bubble"], _
  107.    ["cloud","minecraft:cloud"], _
  108.    ["crit","minecraft:crit"], _
  109.    ["dragonbreath","minecraft:dragon_breath"], _
  110.    ["dripLava","minecraft:dripping_lava"], _
  111.    ["dripWater","minecraft:dripping_water"], _
  112.    ["droplet","minecraft:rain"], _
  113.    ["enchantmenttable","minecraft:enchant"], _
  114.    ["endRod","minecraft:end_rod"], _
  115.    ["explode","minecraft:poof"], _
  116.    ["fallingdust","minecraft:falling_dust"], _
  117.    ["fireworksSpark","minecraft:firework"], _
  118.    ["flame","minecraft:flame"], _
  119.    ["happyVillager","minecraft:happy_villager"], _
  120.    ["heart","minecraft:heart"], _
  121.    ["hugeexplosion","minecraft:explosion_emitter"], _
  122.    ["iconcrack","minecraft:item"], _
  123.    ["instantSpell","minecraft:instant_effect"], _
  124.    ["largeexplode","minecraft:explosion"], _
  125.    ["largesmoke","minecraft:large_smoke"], _
  126.    ["lava","minecraft:lava"], _
  127.    ["mobappearance","minecraft:elder_guardian"], _
  128.    ["mobSpell","minecraft:entity_effect"], _
  129.    ["mobSpellAmbient","minecraft:ambient_entity_effect"], _
  130.    ["note","minecraft:note"], _
  131.    ["portal","minecraft:portal"], _
  132.    ["reddust","minecraft:dust"], _
  133.    ["slime","minecraft:item_slime"], _
  134.    ["smoke","minecraft:smoke"], _
  135.    ["snowballpoof","minecraft:item_snowball"], _
  136.    ["snowshovel","minecraft:poof"], _
  137.    ["spell","minecraft:effect"], _
  138.    ["spit","minecraft:spit"], _
  139.    ["splash","minecraft:splash"], _
  140.    ["suspended","minecraft:underwater"], _
  141.    ["sweepAttack","minecraft:sweep_attack"], _
  142.    ["totem","minecraft:totem_of_undying"], _
  143.    ["townaura","angry_villager"], _
  144.    ["townaura","minecraft:mycelium"], _
  145.    ["wake","minecraft:fishing"], _
  146.    ["witchMagic","minecraft:witch"] _
  147.    ]
  148.  
  149. global $ent = 84
  150. global $entlib[$ent] = [ _
  151.    "item", _
  152.    "xp_orb", _
  153.    "area_effect_cloud", _
  154.    "leash_knot", _
  155.    "painting", _
  156.    "item_frame", _
  157.    "armor_stand", _
  158.    "evocation_fangs", _
  159.    "ender_crystal", _
  160.    "egg", _
  161.    "arrow", _
  162.    "snowball", _
  163.    "fireball", _
  164.    "small_fireball", _
  165.    "ender_pearl", _
  166.    "eye_of_ender_signal", _
  167.    "potion", _
  168.    "xp_bottle", _
  169.    "wither_skull", _
  170.    "fireworks_rocket", _
  171.    "spectral_arrow", _
  172.    "shulker_bullet", _
  173.    "dragon_fireball", _
  174.    "llama_spit", _
  175.    "tnt", _
  176.    "falling_block", _
  177.    "commandblock_minecart", _
  178.    "boat", _
  179.    "minecart", _
  180.    "chest_minecart", _
  181.    "furnace_minecart", _
  182.    "tnt_minecart", _
  183.    "hopper_minecart", _
  184.    "spawner_minecart", _
  185.    "elder_guardian", _
  186.    "wither_skeleton", _
  187.    "stray", _
  188.    "husk", _
  189.    "zombie_villager", _
  190.    "evocation_illager", _
  191.    "vex", _
  192.    "vindication_illager", _
  193.    "illusion_illager", _
  194.    "creeper", _
  195.    "skeleton", _
  196.    "spider", _
  197.    "giant", _
  198.    "zombie", _
  199.    "slime", _
  200.    "ghast", _
  201.    "zombie_pigman", _
  202.    "enderman", _
  203.    "cave_spider", _
  204.    "silverfish", _
  205.    "blaze", _
  206.    "magma_cube", _
  207.    "ender_dragon", _
  208.    "wither", _
  209.    "witch", _
  210.    "endermite", _
  211.    "guardian", _
  212.    "shulker", _
  213.    "skeleton_horse", _
  214.    "zombie_horse", _
  215.    "donkey", _
  216.    "mule", _
  217.    "bat", _
  218.    "pig", _
  219.    "sheep", _
  220.    "cow", _
  221.    "chicken", _
  222.    "squid", _
  223.    "wolf", _
  224.    "mooshroom", _
  225.    "snowman", _
  226.    "ocelot", _
  227.    "villager_golem", _
  228.    "horse", _
  229.    "rabbit", _
  230.    "polar_bear", _
  231.    "llama", _
  232.    "parrot", _
  233.    "villager", _
  234.    "lightning_bolt" _
  235.    ]
  236.  
  237. global $clean = 12
  238. global $cleanlib[$clean][2] = [ _
  239.    ["at @s positioned ~ ~ ~","at @s"], _
  240.    ["as as","as"], _
  241.    ["at at","at"], _
  242.    ["@s[]","@s"], _
  243.    ["@a[]","@a"], _
  244.    ["@e[]","@e"], _
  245.    ["@p[]","@p"], _
  246.    ["armorstand","armor_stand"], _
  247.    [" slot."," "], _
  248.    [",]","]"], _
  249.    ["  "," "], _
  250.    ["!=","=!"] _
  251.    ]
  252.  
  253.    global $types = 327
  254. global $blocks[$types][3] = [["minecraft:stone","-1","minecraft:stone"], _
  255. ["minecraft:stone","0","minecraft:stone"], _
  256. ["minecraft:stone","1","minecraft:granite"], _
  257. ["minecraft:stone","2","minecraft:polished_granite"], _
  258. ["minecraft:stone","3","minecraft:diorite"], _
  259. ["minecraft:stone","4","minecraft:polished_diorite"], _
  260. ["minecraft:stone","5","minecraft:andesite"], _
  261. ["minecraft:stone","6","minecraft:polished_andesite"], _
  262. ["minecraft:grass","-1","minecraft:grass_block"], _
  263. ["minecraft:grass","0","minecraft:grass_block"], _
  264. ["minecraft:tallgrass","-1","minecraft:grass"], _
  265. ["minecraft:tallgrass","0","minecraft:dead_bush"], _
  266. ["minecraft:tallgrass","1","minecraft:grass"], _
  267. ["minecraft:tallgrass","2","minecraft:fern"], _
  268. ["minecraft:deadbush","0","minecraft:dead_bush"], _
  269. ["minecraft:dirt","-1","minecraft:dirt"], _
  270. ["minecraft:dirt","0","minecraft:dirt"], _
  271. ["minecraft:dirt","1","minecraft:coarse_dirt"], _
  272. ["minecraft:dirt","2","minecraft:podzol"], _
  273. ["minecraft:planks","-1","minecraft:oak_planks"], _
  274. ["minecraft:planks","0","minecraft:oak_planks"], _
  275. ["minecraft:planks","1","minecraft:spruce_planks"], _
  276. ["minecraft:planks","2","minecraft:birch_planks"], _
  277. ["minecraft:planks","3","minecraft:jungle_planks"], _
  278. ["minecraft:planks","4","minecraft:acacia_planks"], _
  279. ["minecraft:planks","5","minecraft:dark_oak_planks"], _
  280. ["minecraft:sapling","-1","minecraft:oak_sapling"], _
  281. ["minecraft:sapling","0","minecraft:oak_sapling"], _
  282. ["minecraft:sapling","1","minecraft:spruce_sapling"], _
  283. ["minecraft:sapling","2","minecraft:birch_sapling"], _
  284. ["minecraft:sapling","3","minecraft:jungle_sapling"], _
  285. ["minecraft:sapling","4","minecraft:acacia_sapling"], _
  286. ["minecraft:sapling","5","minecraft:dark_oak_sapling"], _
  287. ["minecraft:gold_block","-1","minecraft:gold_block"], _
  288. ["minecraft:gold_block","0","minecraft:gold_block"], _
  289. ["minecraft:sand","-1","minecraft:sand"], _
  290. ["minecraft:sand","0","minecraft:sand"], _
  291. ["minecraft:sand","1","minecraft:red_sand"], _
  292. ["minecraft:pumpkin","-1","minecraft:carved_pumpkin"], _
  293. ["minecraft:pumpkin","0","minecraft:carved_pumpkin"], _
  294. ["minecraft:log","-1","#minecraft:logs"], _
  295. ["minecraft:log","0","minecraft:oak_log"], _
  296. ["minecraft:log","1","minecraft:spruce_log"], _
  297. ["minecraft:log","2","minecraft:birch_log"], _
  298. ["minecraft:log","3","minecraft:jungle_log"], _
  299. ["minecraft:log","4","minecraft:oak_bark"], _
  300. ["minecraft:log","5","minecraft:spruce_bark"], _
  301. ["minecraft:log","6","minecraft:birch_bark"], _
  302. ["minecraft:log","7","minecraft:jungle_bark"], _
  303. ["minecraft:leaves","-1","minecraft:oak_leaves"], _
  304. ["minecraft:leaves","0","minecraft:oak_leaves"], _
  305. ["minecraft:leaves","1","minecraft:spruce_leaves"], _
  306. ["minecraft:leaves","2","minecraft:birch_leaves"], _
  307. ["minecraft:leaves","3","minecraft:jungle_leaves"], _
  308. ["minecraft:sponge","-1","minecraft:sponge"], _
  309. ["minecraft:sponge","0","minecraft:sponge"], _
  310. ["minecraft:sponge","1","minecraft:wet_sponge"], _
  311. ["minecraft:sandstone","-1","minecraft:sandstone"], _
  312. ["minecraft:sandstone","0","minecraft:sandstone"], _
  313. ["minecraft:sandstone","1","minecraft:chiseled_sandstone"], _
  314. ["minecraft:sandstone","2","minecraft:cut_sandstone"], _
  315. ["minecraft:noteblock","-1","minecraft:note_block"], _
  316. ["minecraft:noteblock","0","minecraft:note_block"], _
  317. ["minecraft:bed","-1","minecraft:red_bed"], _
  318. ["minecraft:bed","0","minecraft:white_bed"], _
  319. ["minecraft:bed","1","minecraft:orange_bed"], _
  320. ["minecraft:bed","2","minecraft:magenta_bed"], _
  321. ["minecraft:bed","3","minecraft:light_blue_bed"], _
  322. ["minecraft:bed","4","minecraft:yellow_bed"], _
  323. ["minecraft:bed","5","minecraft:lime_bed"], _
  324. ["minecraft:bed","6","minecraft:pink_bed"], _
  325. ["minecraft:bed","7","minecraft:gray_bed"], _
  326. ["minecraft:bed","8",""], _
  327. ["minecraft:bed","9","minecraft:cyan_bed"], _
  328. ["minecraft:bed","10","minecraft:purple_bed"], _
  329. ["minecraft:bed","11","minecraft:blue_bed"], _
  330. ["minecraft:bed","12","minecraft:brown_bed"], _
  331. ["minecraft:bed","13","minecraft:green_bed"], _
  332. ["minecraft:bed","14","minecraft:red_bed"], _
  333. ["minecraft:bed","15","minecraft:black_bed"], _
  334. ["minecraft:golden_rail","-1","minecraft:powered_rail"], _
  335. ["minecraft:golden_rail","0","minecraft:powered_rail"], _
  336. ["minecraft:golden_rail","0","minecraft:cobweb"], _
  337. ["minecraft:golden_rail","-1","minecraft:cobweb"], _
  338. ["minecraft:tallgrass","-1",""], _
  339. ["minecraft:tallgrass","0","minecraft:dead_bush"], _
  340. ["minecraft:tallgrass","1","minecraft:grass"], _
  341. ["minecraft:tallgrass","2","minecraft:fern"], _
  342. ["minecraft:deadbush","-1","minecraft:dead_bush"], _
  343. ["minecraft:deadbush","0","minecraft:dead_bush"], _
  344. ["minecraft:piston_extension","-1","minecraft:moving_piston"], _
  345. ["minecraft:piston_extension","0","minecraft:moving_piston"], _
  346. ["minecraft:wool","-1","#minecraft:wool"], _
  347. ["minecraft:wool","0","minecraft:white_wool"], _
  348. ["minecraft:wool","1","minecraft:orange_wool"], _
  349. ["minecraft:wool","2","minecraft:magenta_wool"], _
  350. ["minecraft:wool","3","minecraft:light_blue_wool"], _
  351. ["minecraft:wool","4","minecraft:yellow_wool"], _
  352. ["minecraft:wool","5","minecraft:lime_wool"], _
  353. ["minecraft:wool","6","minecraft:pink_wool"], _
  354. ["minecraft:wool","7","minecraft:gray_wool"], _
  355. ["minecraft:wool","8","minecraft:light_gray_wool"], _
  356. ["minecraft:wool","9","minecraft:cyan_wool"], _
  357. ["minecraft:wool","10","minecraft:purple_wool"], _
  358. ["minecraft:wool","11","minecraft:blue_wool"], _
  359. ["minecraft:wool","12","minecraft:brown_wool"], _
  360. ["minecraft:wool","13","minecraft:green_wool"], _
  361. ["minecraft:wool","14","minecraft:red_wool"], _
  362. ["minecraft:wool","15","minecraft:black_wool"], _
  363. ["minecraft:yellow_flower","-1","minecraft:dandelion"], _
  364. ["minecraft:yellow_flower","0","minecraft:dandelion"], _
  365. ["minecraft:red_flower","-1","minecraft:poppy"], _
  366. ["minecraft:red_flower","0","minecraft:poppy"], _
  367. ["minecraft:red_flower","1","minecraft:blue_orchid"], _
  368. ["minecraft:red_flower","2","minecraft:allium"], _
  369. ["minecraft:red_flower","3","minecraft:azure_bluet"], _
  370. ["minecraft:red_flower","4","minecraft:red_tulip"], _
  371. ["minecraft:red_flower","5","minecraft:orange_tulip"], _
  372. ["minecraft:red_flower","6","minecraft:white_tulip"], _
  373. ["minecraft:red_flower","7","minecraft:pink_tulip"], _
  374. ["minecraft:red_flower","8","minecraft:oxeye_daisy"], _
  375. ["minecraft:double_stone_slab","-1","#minecraft:slabs"], _
  376. ["minecraft:double_stone_slab","0","minecraft:stone_slab"], _
  377. ["minecraft:double_stone_slab","1","minecraft:sandstone_slab"], _
  378. ["minecraft:double_stone_slab","2","minecraft:petrified_oak_slab"], _
  379. ["minecraft:double_stone_slab","3","minecraft:cobblestone_slab"], _
  380. ["minecraft:double_stone_slab","4","minecraft:brick_slab"], _
  381. ["minecraft:stone_slab","-1","#minecraft:slabs"], _
  382. ["minecraft:stone_slab","0","minecraft:stone_brick_slab"], _
  383. ["minecraft:stone_slab","1","minecraft:nether_brick_slab"], _
  384. ["minecraft:stone_slab","2","minecraft:quartz_slab"], _
  385. ["minecraft:stone_slab","3","minecraft:smooth_sandstone"], _
  386. ["minecraft:stone_slab","4","minecraft:smooth_stone"], _
  387. ["minecraft:stone_slab","5","minecraft:smooth_quartz"], _
  388. ["minecraft:brick_block","-1","minecraft:bricks"], _
  389. ["minecraft:brick_block","0","minecraft:bricks"], _
  390. ["minecraft:stained_glass","-1","minecraft:white_stained_glass"], _
  391. ["minecraft:stained_glass","0","minecraft:white_stained_glass"], _
  392. ["minecraft:stained_glass","1","minecraft:orange_stained_glass"], _
  393. ["minecraft:stained_glass","2","minecraft:magenta_stained_glass"], _
  394. ["minecraft:stained_glass","3","minecraft:light_blue_stained_glass"], _
  395. ["minecraft:stained_glass","4","minecraft:yellow_stained_glass"], _
  396. ["minecraft:stained_glass","5","minecraft:lime_stained_glass"], _
  397. ["minecraft:stained_glass","6","minecraft:pink_stained_glass"], _
  398. ["minecraft:stained_glass","7","minecraft:gray_stained_glass"], _
  399. ["minecraft:stained_glass","8","minecraft:light_gray_stained_glass"], _
  400. ["minecraft:stained_glass","9","minecraft:cyan_stained_glass"], _
  401. ["minecraft:stained_glass","10","minecraft:purple_stained_glass"], _
  402. ["minecraft:stained_glass","11","minecraft:blue_stained_glass"], _
  403. ["minecraft:stained_glass","12","minecraft:brown_stained_glass"], _
  404. ["minecraft:stained_glass","13","minecraft:green_stained_glass"], _
  405. ["minecraft:stained_glass","14","minecraft:red_stained_glass"], _
  406. ["minecraft:stained_glass","15","minecraft:black_stained_glass"], _
  407. ["minecraft:stained_hardened_clay","-1","minecraft:white_terracotta"], _
  408. ["minecraft:stained_hardened_clay","0","minecraft:white_terracotta"], _
  409. ["minecraft:stained_hardened_clay","1","minecraft:orange_terracotta"], _
  410. ["minecraft:stained_hardened_clay","2","minecraft:magenta_terracotta"], _
  411. ["minecraft:stained_hardened_clay","3","minecraft:light_blue_terracotta"], _
  412. ["minecraft:stained_hardened_clay","4","minecraft:yellow_terracotta"], _
  413. ["minecraft:stained_hardened_clay","5","minecraft:lime_terracotta"], _
  414. ["minecraft:stained_hardened_clay","6","minecraft:pink_terracotta"], _
  415. ["minecraft:stained_hardened_clay","7","minecraft:gray_terracotta"], _
  416. ["minecraft:stained_hardened_clay","8","minecraft:light_gray_terracotta"], _
  417. ["minecraft:stained_hardened_clay","9","minecraft:cyan_terracotta"], _
  418. ["minecraft:stained_hardened_clay","10","minecraft:purple_terracotta"], _
  419. ["minecraft:stained_hardened_clay","11","minecraft:blue_terracotta"], _
  420. ["minecraft:stained_hardened_clay","12","minecraft:brown_terracotta"], _
  421. ["minecraft:stained_hardened_clay","13","minecraft:green_terracotta"], _
  422. ["minecraft:stained_hardened_clay","14","minecraft:red_terracotta"], _
  423. ["minecraft:stained_hardened_clay","15","minecraft:black_terracotta"], _
  424. ["minecraft:stained_glass_pane","-1","minecraft:white_stained_glass_pane"], _
  425. ["minecraft:stained_glass_pane","0","minecraft:white_stained_glass_pane"], _
  426. ["minecraft:stained_glass_pane","1","minecraft:orange_stained_glass_pane"], _
  427. ["minecraft:stained_glass_pane","2","minecraft:magenta_stained_glass_pane"], _
  428. ["minecraft:stained_glass_pane","3","minecraft:light_blue_stained_glass_pane"], _
  429. ["minecraft:stained_glass_pane","4","minecraft:yellow_stained_glass_pane"], _
  430. ["minecraft:stained_glass_pane","5","minecraft:lime_stained_glass_pane"], _
  431. ["minecraft:stained_glass_pane","6","minecraft:pink_stained_glass_pane"], _
  432. ["minecraft:stained_glass_pane","7","minecraft:gray_stained_glass_pane"], _
  433. ["minecraft:stained_glass_pane","8","minecraft:light_gray_stained_glass_pane"], _
  434. ["minecraft:stained_glass_pane","9","minecraft:cyan_stained_glass_pane"], _
  435. ["minecraft:stained_glass_pane","10","minecraft:purple_stained_glass_pane"], _
  436. ["minecraft:stained_glass_pane","11","minecraft:blue_stained_glass_pane"], _
  437. ["minecraft:stained_glass_pane","12","minecraft:brown_stained_glass_pane"], _
  438. ["minecraft:stained_glass_pane","13","minecraft:green_stained_glass_pane"], _
  439. ["minecraft:stained_glass_pane","14","minecraft:red_stained_glass_pane"], _
  440. ["minecraft:stained_glass_pane","15","minecraft:black_stained_glass_pane"], _
  441. ["minecraft:carpet","-1","minecraft:white_carpet"], _
  442. ["minecraft:carpet","0","minecraft:white_carpet"], _
  443. ["minecraft:carpet","1","minecraft:orange_carpet"], _
  444. ["minecraft:carpet","2","minecraft:magenta_carpet"], _
  445. ["minecraft:carpet","3","minecraft:light_blue_carpet"], _
  446. ["minecraft:carpet","4","minecraft:yellow_carpet"], _
  447. ["minecraft:carpet","5","minecraft:lime_carpet"], _
  448. ["minecraft:carpet","6","minecraft:pink_carpet"], _
  449. ["minecraft:carpet","7","minecraft:gray_carpet"], _
  450. ["minecraft:carpet","8","minecraft:light_gray_carpet"], _
  451. ["minecraft:carpet","9","minecraft:cyan_carpet"], _
  452. ["minecraft:carpet","10","minecraft:purple_carpet"], _
  453. ["minecraft:carpet","11","minecraft:blue_carpet"], _
  454. ["minecraft:carpet","12","minecraft:brown_carpet"], _
  455. ["minecraft:carpet","13","minecraft:green_carpet"], _
  456. ["minecraft:carpet","14","minecraft:red_carpet"], _
  457. ["minecraft:carpet","15","minecraft:black_carpet"], _
  458. ["minecraft:banner","-1","minecraft:white_banner"], _
  459. ["minecraft:banner","0","minecraft:white_banner"], _
  460. ["minecraft:banner","1","minecraft:orange_banner"], _
  461. ["minecraft:banner","2","minecraft:magenta_banner"], _
  462. ["minecraft:banner","3","minecraft:light_blue_banner"], _
  463. ["minecraft:banner","4","minecraft:yellow_banner"], _
  464. ["minecraft:banner","5","minecraft:lime_banner"], _
  465. ["minecraft:banner","6","minecraft:pink_banner"], _
  466. ["minecraft:banner","7","minecraft:gray_banner"], _
  467. ["minecraft:banner","8","minecraft:light_gray_banner"], _
  468. ["minecraft:banner","9","minecraft:cyan_banner"], _
  469. ["minecraft:banner","10","minecraft:purple_banner"], _
  470. ["minecraft:banner","11","minecraft:blue_banner"], _
  471. ["minecraft:banner","12","minecraft:brown_banner"], _
  472. ["minecraft:banner","13","minecraft:green_banner"], _
  473. ["minecraft:banner","14","minecraft:red_banner"], _
  474. ["minecraft:banner","15","minecraft:black_banner"], _
  475. ["minecraft:standing_banner","-1","minecraft:white_banner"], _
  476. ["minecraft:standing_banner","0","minecraft:white_banner"], _
  477. ["minecraft:standing_banner","1","minecraft:orange_banner"], _
  478. ["minecraft:standing_banner","2","minecraft:magenta_banner"], _
  479. ["minecraft:standing_banner","3","minecraft:light_blue_banner"], _
  480. ["minecraft:standing_banner","4","minecraft:yellow_banner"], _
  481. ["minecraft:standing_banner","5","minecraft:lime_banner"], _
  482. ["minecraft:standing_banner","6","minecraft:pink_banner"], _
  483. ["minecraft:standing_banner","7","minecraft:gray_banner"], _
  484. ["minecraft:standing_banner","8","minecraft:light_gray_banner"], _
  485. ["minecraft:standing_banner","9","minecraft:cyan_banner"], _
  486. ["minecraft:standing_banner","10","minecraft:purple_banner"], _
  487. ["minecraft:standing_banner","11","minecraft:blue_banner"], _
  488. ["minecraft:standing_banner","12","minecraft:brown_banner"], _
  489. ["minecraft:standing_banner","13","minecraft:green_banner"], _
  490. ["minecraft:standing_banner","14","minecraft:red_banner"], _
  491. ["minecraft:standing_banner","15","minecraft:black_banner"], _
  492. ["minecraft:wall_banner","-1","minecraft:white_wall_banner"], _
  493. ["minecraft:wall_banner","0","minecraft:white_wall_banner"], _
  494. ["minecraft:wall_banner","1","minecraft:orange_wall_banner"], _
  495. ["minecraft:wall_banner","2","minecraft:magenta_wall_banner"], _
  496. ["minecraft:wall_banner","3","minecraft:light_blue_wall_banner"], _
  497. ["minecraft:wall_banner","4","minecraft:yellow_wall_banner"], _
  498. ["minecraft:wall_banner","5","minecraft:lime_wall_banner"], _
  499. ["minecraft:wall_banner","6","minecraft:pink_wall_banner"], _
  500. ["minecraft:wall_banner","7","minecraft:gray_wall_banner"], _
  501. ["minecraft:wall_banner","8","minecraft:light_gray_wall_banner"], _
  502. ["minecraft:wall_banner","9","minecraft:cyan_wall_banner"], _
  503. ["minecraft:wall_banner","10","minecraft:purple_wall_banner"], _
  504. ["minecraft:wall_banner","11","minecraft:blue_wall_banner"], _
  505. ["minecraft:wall_banner","12","minecraft:brown_wall_banner"], _
  506. ["minecraft:wall_banner","13","minecraft:green_wall_banner"], _
  507. ["minecraft:wall_banner","14","minecraft:red_wall_banner"], _
  508. ["minecraft:wall_banner","15","minecraft:black_wall_banner"], _
  509. ["minecraft:concrete","-1","minecraft:white_concrete"], _
  510. ["minecraft:concrete","0","minecraft:white_concrete"], _
  511. ["minecraft:concrete","1","minecraft:orange_concrete"], _
  512. ["minecraft:concrete","2","minecraft:magenta_concrete"], _
  513. ["minecraft:concrete","3","minecraft:light_blue_concrete"], _
  514. ["minecraft:concrete","4","minecraft:yellow_concrete"], _
  515. ["minecraft:concrete","5","minecraft:lime_concrete"], _
  516. ["minecraft:concrete","6","minecraft:pink_concrete"], _
  517. ["minecraft:concrete","7","minecraft:gray_concrete"], _
  518. ["minecraft:concrete","8","minecraft:light_gray_concrete"], _
  519. ["minecraft:concrete","9","minecraft:cyan_concrete"], _
  520. ["minecraft:concrete","10","minecraft:purple_concrete"], _
  521. ["minecraft:concrete","11","minecraft:blue_concrete"], _
  522. ["minecraft:concrete","12","minecraft:brown_concrete"], _
  523. ["minecraft:concrete","13","minecraft:green_concrete"], _
  524. ["minecraft:concrete","14","minecraft:red_concrete"], _
  525. ["minecraft:concrete","15","minecraft:black_concrete"], _
  526. ["minecraft:concrete_powder","-1","minecraft:white_concrete_powder"], _
  527. ["minecraft:concrete_powder","0","minecraft:white_concrete_powder"], _
  528. ["minecraft:concrete_powder","1","minecraft:orange_concrete_powder"], _
  529. ["minecraft:concrete_powder","2","minecraft:magenta_concrete_powder"], _
  530. ["minecraft:concrete_powder","3","minecraft:light_blue_concrete_powder"], _
  531. ["minecraft:concrete_powder","4","minecraft:yellow_concrete_powder"], _
  532. ["minecraft:concrete_powder","5","minecraft:lime_concrete_powder"], _
  533. ["minecraft:concrete_powder","6","minecraft:pink_concrete_powder"], _
  534. ["minecraft:concrete_powder","7","minecraft:gray_concrete_powder"], _
  535. ["minecraft:concrete_powder","8","minecraft:light_gray_concrete_powder"], _
  536. ["minecraft:concrete_powder","9","minecraft:cyan_concrete_powder"], _
  537. ["minecraft:concrete_powder","","10"], _
  538. ["minecraft:concrete_powder","11","minecraft:blue_concrete_powder"], _
  539. ["minecraft:concrete_powder","12","minecraft:brown_concrete_powder"], _
  540. ["minecraft:concrete_powder","13","minecraft:green_concrete_powder"], _
  541. ["minecraft:concrete_powder","14","minecraft:red_concrete_powder"], _
  542. ["minecraft:concrete_powder","15","minecraft:black_concrete_powder"], _
  543. ["minecraft:dye","-1","minecraft:bone_meal"], _
  544. ["minecraft:dye","0","minecraft:bone_meal"], _
  545. ["minecraft:dye","1","minecraft:orange_dye"], _
  546. ["minecraft:dye","2","minecraft:magenta_dye"], _
  547. ["minecraft:dye","3","minecraft:light_blue_dye"], _
  548. ["minecraft:dye","4","minecraft:dandelion_yellow"], _
  549. ["minecraft:dye","5","minecraft:lime_dye"], _
  550. ["minecraft:dye","6","minecraft:pink_dye"], _
  551. ["minecraft:dye","7","minecraft:gray_dye"], _
  552. ["minecraft:dye","8","minecraft:light_gray_dye"], _
  553. ["minecraft:dye","9","minecraft:cyan_dye"], _
  554. ["minecraft:dye","10","minecraft:purple_dye"], _
  555. ["minecraft:dye","11","minecraft:lapis_lazuli"], _
  556. ["minecraft:dye","12","minecraft:cocoa_beans"], _
  557. ["minecraft:dye","13","minecraft:cactus_green"], _
  558. ["minecraft:dye","14","minecraft:rose_red"], _
  559. ["minecraft:dye","15","minecraft:ink_sac"], _
  560. ["minecraft:daylight_detector_inverted","-1","minecraft:daylight_detector[inverted=true]"], _
  561. ["minecraft:daylight_detector_inverted","0","minecraft:daylight_detector[inverted=true]"], _
  562. ["minecraft:daylight_detector","-1","minecraft:daylight_detector[inverted=false]"], _
  563. ["minecraft:daylight_detector","0","minecraft:daylight_detector[inverted=false]"], _
  564. ["minecraft:nether_brick","0","minecraft:nether_bricks"], _
  565. ["minecraft:stone_button","-1","minecraft:stone_button"], _
  566. ["minecraft:stone_button","0","minecraft:stone_button[powered=false]"], _
  567. ["minecraft:stone_button","1","minecraft:stone_button[powered=false]"], _
  568. ["minecraft:stone_button","2","minecraft:stone_button[powered=false]"], _
  569. ["minecraft:stone_button","3","minecraft:stone_button[powered=false]"], _
  570. ["minecraft:stone_button","4","minecraft:stone_button[powered=false]"], _
  571. ["minecraft:stone_button","5","minecraft:stone_button[powered=false]"], _
  572. ["minecraft:stone_button","9","minecraft:stone_button[powered=true]"], _
  573. ["minecraft:stone_button","10","minecraft:stone_button[powered=true]"], _
  574. ["minecraft:stone_button","11","minecraft:stone_button[powered=true]"], _
  575. ["minecraft:stone_button","12","minecraft:stone_button[powered=true]"], _
  576. ["minecraft:stone_button","13","minecraft:stone_button[powered=true]"], _
  577. ["minecraft:stone_button","14","minecraft:stone_button[powered=true]"], _
  578. ["minecraft:air","0","minecraft:air"], _
  579. ["minecraft:air","-1","minecraft:air"], _
  580. ["minecraft:wooden_slab","-1","#minecraft:wooden_slabs"] _
  581. ]
  582. EndFunc
  583.  
  584.  
  585. main()
  586. Func main()
  587.  While 1
  588.    Switch GUIGetMsg()
  589.       case $GUI_EVENT_CLOSE, $idOK
  590.          ExitLoop
  591.       case $search
  592.          $path = GUICtrlRead($box1)
  593.          $datapack = GUICtrlRead($box2)
  594.          if $datapack == "" Then
  595.             $datapack = "auto_update"
  596.          EndIf
  597.          $datapack = stringlower($datapack)
  598.          program($path,$datapack)
  599.    EndSwitch
  600.    WEnd
  601. EndFunc
  602.  
  603. func program($path,$datapack)
  604.    $path = fileupdate($datapack)
  605.    ConsoleWrite($path&@CRLF)
  606.    $filelist = _FileListToArrayRec($path,"*",1,1,0,2)
  607.    if not @error then
  608.       for $file = 1 to $filelist[0]
  609.          GUICtrlSetData($prog,((100/$filelist[0])*$file))
  610.          ConsoleWrite($filelist[$file]&@crlf)
  611.          global $linelist
  612.          _FileReadToArray($filelist[$file],$linelist)
  613.          if not @error and $linelist[0] > 0  then
  614.             for $o = 1 to $linelist[0]
  615.                if stringlen($linelist[$o]) <= 1 Then
  616.                   _FileWriteToLine($filelist[$file], $o, " ", true)
  617.                Else
  618.                   libs()
  619.                   replace($linelist[$o])
  620.                   $string = clean($string)
  621.                   $string = shortreplace($string)
  622.                   $string = exec($string)
  623.                   $string = data($string)
  624.                   $string = particles($string)
  625.                   $string = playsound($string)
  626.                   $string = entities($string)
  627.                   $string = clean($string)
  628.                   $string = idreplace($string)
  629.                   $string = clean($string)
  630.                   $string = score($string)
  631.                   $string = combine($string,"rm=","r=","distance=")
  632.                   $string = combine($string,"lm=","l=","level=")
  633.                   $string = combine($string,"rxm=","rx=","x_rotation=")
  634.                   $string = combine($string,"rym=","ry=","y_rotation=")
  635.                   $string = nbt($string)
  636.                   $string = function($string,$datapack)
  637.                   $string = blocks($string)
  638.                   $string = clean($string)
  639.                   _FileWriteToLine($filelist[$file], $o, "" & $string, true)
  640.                endif
  641.             Next
  642.          EndIf
  643.       next
  644.    EndIf
  645.    sleep(1000)
  646.    exit
  647. EndFunc
  648.  
  649. func function($string,$datapack)
  650.    $arr = StringSplit($string," ")
  651.    if $arr[0] >= 1 Then
  652.       for $i = 1 to $arr[0]
  653.          if $arr[$i] == "function" and $i < $arr[0] Then
  654.             $arr[$i+1] = StringReplace($arr[$i+1],":","/")
  655.             $arr[$i+1] = $datapack &":" & $arr[$i+1]
  656.          EndIf
  657.       next
  658.       $string = ""
  659.       for $i = 1 to $arr[0]
  660.          $string = $string & $arr[$i] & " "
  661.       next
  662.    EndIf
  663.    return $string
  664. EndFunc
  665.  
  666. func fileupdate($datapack)
  667.    $exists = _FileListToArray($path&"\datapacks\"&$datapack,"*",2,true)
  668.    if $exists >= 1 Then
  669.       $path = $path&"\datapacks\"&$datapack&"\"
  670.    Else
  671.       _FileCreate($path & "\datapacks\"&$datapack&"\pack.mcmeta")
  672.       FileWrite($path & "\datapacks\"&$datapack&"\pack.mcmeta",'{"pack": {"pack_format": 3, "description": "'& $datapack & '"}}')
  673.       _FileCreate($path & "\datapacks\"&$datapack&"\data\minecraft\tags\functions\tick.json")
  674.       FileWrite($path & "\datapacks\"&$datapack&"\data\minecraft\tags\functions\tick.json",'{"values": ["'&$datapack&':tick"]}')
  675.       DirCopy($path&"\data\functions",$path & "\datapacks\"&$datapack&"\data\"&$datapack&"\functions")
  676.       ConsoleWrite($path & "\datapacks\"&$datapack&"\pack.mcmeta"&@CRLF)
  677.       $path = $path&"\datapacks\"&$datapack&"\"
  678.    EndIf
  679.    return $path
  680. EndFunc
  681.  
  682. func replace($line)
  683.    global $string = ""
  684.    $line = StringReplace($line," /"," ")
  685.    $words = StringSplit($line," ")
  686.    if $words[0] == 0 Then
  687.       return 0
  688.    endif
  689.  
  690.    for $position = 1 to $words[0]   ;cycle words in sentence
  691.       for $command = 0 to $commands -1  ;cycle commands
  692.          $index = 0
  693.          $length = $tags
  694.          if $length < $words[0] - $position then
  695.             $length = $words[0] - $position
  696.          endif
  697.          while ($index < $tags and (($lib[$command][0][$index] == "") or (($position + $index <= $words[0]) and stringcompare($words[$position+$index], $lib[$command][0][$index]) == 0 ))) ;tags match / search tag blank ("")
  698.             $index += 1
  699.          WEnd
  700.          if $index == $tags Then
  701.             for $cnt = 0 to $tags - 1
  702.                if stringcompare($lib[$command][1][$cnt],"*") and $position+$cnt<=$words[0] then
  703.                   $words[$position+$cnt] = $lib[$command][1][$cnt]
  704.                endif
  705.             Next
  706.          endif
  707.       Next
  708.    next
  709.    for $m = 1 to $words[0]
  710.       if $words[$m] <> "" Then
  711.          if $string <> "" then
  712.             $string &= " "
  713.          endif
  714.          $string &= $words[$m]
  715.       EndIf
  716.    next
  717.    if $string = "" Then
  718.       $string = " "
  719.    EndIf
  720. EndFunc
  721.  
  722. func entities($string)
  723.    $words = StringSplit($string," ")
  724.    $ret = ""
  725.    for $position = 1 to $words[0]   ;cycle words in sentence
  726.       if stringcompare(stringleft($words[$position],10),"minecraft:") == 0 Then
  727.          $words[$position] = StringLower($words[$position])
  728.       Else
  729.          for $k = 0 to $ent -1
  730.             if stringcompare($entlib[$k],$words[$position],2) == 0 Then
  731.                $words[$position] = StringLower($words[$position])
  732.             EndIf
  733.          Next
  734.       EndIf
  735.       $ret = $ret & $words[$position] & " "
  736.    next
  737.    return $ret
  738. EndFunc
  739.  
  740. func playsound($string)
  741.    $words = StringSplit($string," ")
  742.    $ret = ""
  743.    for $position = 1 to $words[0]   ;cycle words in sentence
  744.       if stringcompare($words[$position],"playsound") == 0 Then
  745.          $words[$position+1] = StringLower($words[$position+1])
  746.       EndIf
  747.       $ret = $ret & $words[$position] & " "
  748.    next
  749.    return $ret
  750. EndFunc
  751.  
  752. func particles($string)
  753.    $words = StringSplit($string," ")
  754.    $ret = ""
  755.    for $position = 1 to $words[0]   ;cycle words in sentence
  756.       if StringCompare($words[$position],"particle") = 0 Then
  757.          for $k = 0 to $particle -1
  758.             if stringcompare($particlelib[$k][0],$words[$position+1],2) == 0 Then
  759.                $words[$position+1] = $particlelib[$k][1]
  760.             EndIf
  761.          Next
  762.       EndIf
  763.       $ret = $ret & $words[$position] & " "
  764.    next
  765.    return $ret
  766. EndFunc
  767.  
  768. func exec($string)
  769.    $words = StringSplit($string," ")
  770.    $ret = ""
  771.    for $position = 1 to $words[0]   ;cycle words in sentence
  772.       if stringcompare($words[$position],"execute") == 0 Then
  773.          if $position >= 2 Then
  774.             $words[$position] = "run execute as"
  775.          Else
  776.             $words[$position] = "execute as"
  777.          endif
  778.          $words[$position+1] = $words[$position+1]& " run execute at @s positioned"
  779.       EndIf
  780.       $ret = $ret & $words[$position] & " "
  781.    next
  782.    return $ret
  783. EndFunc
  784.  
  785. func data($string)
  786.    $words = StringSplit($string," ")
  787.    $ret = ""
  788.    for $position = 1 to $words[0]   ;cycle words in sentence
  789.          if StringCompare($words[$position], "data") = 0 Then
  790.             if StringInStr($words[$position+3],"@s") = 0 Then
  791.                if $position <= 2 Then
  792.                   $words[$position] = "run " & $words[$position]
  793.                endif
  794.                $words[$position] = "execute as " & $words[$position+3] &" "& $words[$position]
  795.                $words[$position+3] = "@s"
  796.             endif
  797.          EndIf
  798.       $ret = $ret & $words[$position] & " "
  799.    next
  800.    return $ret
  801. EndFunc
  802.  
  803. func shortreplace($string)
  804.    for $i = 0 to $short -1
  805. ;~        ConsoleWrite($shortlib[$i][0]&@CRLF)
  806. ;~    ConsoleWrite($shortlib[$i][1]&@CRLF)
  807. ;~    ConsoleWrite($i&@CRLF)
  808.       $search = "[" & $shortlib[$i][0]
  809.       $replace = "[" & $shortlib[$i][1]
  810.       $string = StringReplace($string,$search,$replace)
  811.       $search = ","&$shortlib[$i][0]
  812.       $replace = ","&$shortlib[$i][1]
  813.       $string = StringReplace($string,$search,$replace)
  814.    next
  815.    return $string
  816. EndFunc
  817.  
  818. func blocks($string)
  819.    $words = StringSplit($string," ")
  820.    if $words[0] >= 1 Then
  821.       for $i = 1 to $words[0] -1
  822.          for $k = 0 to $types - 1
  823. ;~          ConsoleWrite($blocks[$k][0]&@crlf)
  824.             if ($words[$i] == $blocks[$k][0] or $words[$i] == Stringreplace($blocks[$k][0],"minecraft:","")) and $words[$i+1] == $blocks[$k][1] Then
  825.                $words[$i] = $blocks[$k][2]
  826.                $words[$i+1] = ""
  827.             EndIf
  828.          Next
  829.       Next
  830.       $string = ""
  831.       for $i = 1 to $words[0]
  832.          if $words[$i] <> "" Then
  833.             $string &= $words[$i] & " "
  834.          EndIf
  835.       next
  836.    EndIf
  837.    return $string
  838. EndFunc
  839.  
  840. func clean($string)
  841.    for $i = 0 to $clean -1
  842.       $search = $cleanlib[$i][0]
  843.       $replace = $cleanlib[$i][1]
  844.       $string = StringReplace($string,$search,$replace)
  845. ;~    ConsoleWrite($search&@CRLF)
  846.       $search = $cleanlib[$i][0]
  847.       $replace = $cleanlib[$i][1]
  848.       $string = StringReplace($string,$search,$replace)
  849.    next
  850.       if stringcompare(StringRight($string,1)," ") == 0 Then
  851.          $string=StringTrimRight($string,1)
  852.       endif
  853.    return $string
  854. EndFunc
  855.  
  856. func score($string)
  857.    $words = StringSplit($string," ")
  858.    $return = ""
  859.    $ret = ""
  860.    local $scores[100][3]    ; name, min, max
  861.  
  862.    $scoreindex = 0
  863. ;~    $selector = $subwords[0] & "["
  864.    if $words[0] > 0 then
  865.       for $i=1 to $words[0]
  866.          for $p = 0 to 99
  867.             $scores[$p][0] = ""
  868.             $scores[$p][1] = null
  869.             $scores[$p][2] = null
  870.          next
  871.          $ret = ""
  872.          if StringInStr(StringTrimRight($words[$i],stringlen($words[$i])-3),"@") then
  873.             $subwords = StringSplit($words[$i]," ,[]")
  874.             $ret &= $subwords[1] & "["
  875.  
  876.  
  877. ;~          ######datatags########
  878.             for $m = 1 to $subwords[0]
  879.                if StringInStr($subwords[$m],"score_") then
  880.                   $subwords[$m] = StringTrimLeft($subwords[$m],6)
  881.                   $pos = StringInStr($subwords[$m],"_min=")
  882.                   if ($pos) >= 1 then
  883.                      $scores[$scoreindex][1] = StringTrimLeft($subwords[$m],$pos+4) ; trim until only score is left
  884. ;~                   consolewrite($scores[$scoreindex][1]& @crlf)
  885.                   Else
  886.                      $pos = StringInStr($subwords[$m],"=")
  887.                      $scores[$scoreindex][2] = StringTrimLeft($subwords[$m],$pos)       ; trim until only score is left
  888. ;~                   consolewrite($scores[$scoreindex][2]& @crlf)
  889.                   EndIf
  890. ;~                ConsoleWrite($pos&"###"&$subwords[$m]& " "& stringlen($subwords[$m]) - $pos&@CRLF)
  891.                   $scores[$scoreindex][0] = StringTrimRight($subwords[$m],(stringlen($subwords[$m]) - ($pos-1)))        ; trim until only name left
  892. ;~                ConsoleWrite($scores[$scoreindex][0]&@crlf)
  893.                   $scoreindex +=1
  894.                   $subwords[$m] = ""
  895.                elseif StringInStr($subwords[$m],"type=") then
  896.                   if StringInStr($subwords[$m],"minecraft:") == 0 then
  897.                      $ret &= StringLower($subwords[$m]) & ","
  898.                   endif
  899.                Else
  900.                   if $m >= 2 and $subwords[$m] <> "" then
  901.                      $ret &= $subwords[$m] & ","
  902.                   endif
  903.                endif
  904.  
  905.             next
  906.             $scr = sort($scores)
  907.             if $scr <> null Then
  908.                $ret &= $scr&","
  909.             EndIf
  910.             if (StringTrimLeft($ret,stringlen($ret)-1) == ",") Then
  911.                $ret = StringTrimRight($ret,1)
  912.             EndIf
  913.  
  914. ;~          ######datatags########
  915. ;~          if ($i >= 2 and $words[$i-1] == "tag") or ($i>=4 and $words[$i-3] == "scoreboard") Then
  916. ;~             if $i+3 <= $words[0] and StringInStr($words[$i+3],"{") <> 0 Then
  917. ;~                $ret &= "nbt=" & $words[$i+3]
  918. ;~                $words[$i+3] = ""
  919. ;~             EndIf
  920. ;~          EndIf
  921.  
  922.             $ret &= "] "
  923.          Else
  924.             $ret &= $words[$i] & " "
  925.          EndIf
  926.          $return &= $ret
  927.       next
  928.    EndIf
  929.    return($return)
  930. ;~    consolewrite($ret& @crlf)
  931. EndFunc
  932.  
  933. func nbt($string)
  934.    $ret = ""
  935.    $words = StringSplit($string," ")
  936.    for $o = 1 to UBound($words) - 1
  937.       if StringInStr($words[$o],"replaceitem") then
  938.          if Ubound($words) > $o+7 and StringInStr($words[$o+7],"{") then
  939.             $words[$o+6] = ""
  940.             $words[$o+4] &= $words[$o+7]
  941.             $words[$o+7] = ""
  942.          endif
  943.          if Ubound($words) > $o+6 and StringInStr($words[$o+6],"{") then
  944.             $words[$o+4] &= $words[$o+6]
  945.             $words[$o+6] = ""
  946.          endif
  947.       elseif stringcompare($words[$o],"give") == 0 then
  948.          if Ubound($words) > $o+5 and StringInStr($words[$o+5],"{") then
  949.             for $k = $o+5 to UBound($words)-1
  950.                $words[$o+4] = ""
  951.                $words[$o+2] &= $words[$k] & " "
  952.                $words[$k] = ""
  953.             next
  954.          endif
  955.       elseif stringcompare($words[$o],"tag") == 0 then
  956.          if Ubound($words) > $o+5 and StringInStr($words[$o+4],"{") then
  957.             $str = ""
  958.             for $k = $o+4 to UBound($words)-1
  959.                $str &= $words[$k] & " "
  960.                $words[$k] = ""
  961.             next
  962.             if StringInStr($words[$o+1],"[") == 0 Then
  963.                $words[$o+1] &= "[nbt=" & $str & "]"
  964.             Else
  965.                $words[$o+1] = stringleft($words[$o+1],3) &"nbt="& $str & "," & StringTrimLeft($words[$o+1],3)
  966.             endif
  967.          endif
  968.       Else
  969.       endif
  970.    next
  971.    for $k = 1 to UBound($words) - 1
  972.       $pos = StringInStr($words[$k], "CustomName:",0,1,2)
  973.       if $pos > 0 Then
  974.          $words[$k] = stringleft($words[$k],$pos+10) & '"\"' & StringReplace(StringTrimLeft($words[$k],$pos+11),'"','\""',1)
  975.       EndIf
  976.    next
  977.    for $i = 1 to UBound($words)-1
  978.       if StringCompare($words[$i],"") <> 0 then
  979.          $ret &= $words[$i] & " "
  980.       endif
  981.    next
  982.    return($ret)
  983. EndFunc
  984.  
  985. func combine($string, $str1, $str2,$repl)
  986.    $words = StringSplit($string," ")
  987.    $return = ""
  988.    $ret = ""
  989.    $scoreindex = 0
  990. ;~    $selector = $subwords[0] & "["
  991.    if $words[0] > 0 then
  992.       for $i=1 to $words[0]
  993.          for $p = 0 to 99
  994.             $r = ""
  995.             $rm = ""
  996.          next
  997.          $ret = ""
  998.          if StringInStr(StringTrimRight($words[$i],stringlen($words[$i])-3),"@") then
  999.             $subwords = StringSplit($words[$i]," ,[]")
  1000.             $ret &= $subwords[1] & "["
  1001.  
  1002. ;~          ######datatags########
  1003.             for $m = 1 to $subwords[0]
  1004.                if StringInStr(stringleft($subwords[$m],stringlen($str2)),$str2) then
  1005.                   $r = StringTrimLeft($subwords[$m],stringlen($str2))
  1006.                   $subwords[$m] = ""
  1007.                elseIf StringInStr(stringleft($subwords[$m],stringlen($str1)),$str1) then
  1008.                   $rm = StringTrimLeft($subwords[$m],stringlen($str1))
  1009.                   $subwords[$m] = ""
  1010.                else
  1011.                   if $m >= 2 and $subwords[$m] <> "" then
  1012.                      $ret &= $subwords[$m] & ","
  1013.                   endif
  1014.                endif
  1015.             next
  1016.             if StringCompare($r,"") or StringCompare($rm,"") Then
  1017.                $ret &= $repl & $rm & ".." & $r & ","
  1018.             EndIf
  1019.             if (StringTrimLeft($ret,stringlen($ret)-1) == ",") Then
  1020.                $ret = StringTrimRight($ret,1)
  1021.             EndIf
  1022.             $ret &= "] "
  1023.          Else
  1024.             $ret &= $words[$i] & " "
  1025.          EndIf
  1026.          $return &= $ret
  1027.       next
  1028.    EndIf
  1029.    return($return)
  1030. ;~    consolewrite($ret& @crlf)
  1031. EndFunc
  1032.  
  1033. func idreplace($string)
  1034.    $ret = ""
  1035.    $words = StringSplit($string," ")
  1036.    for $o = 1 to UBound($words) - 1
  1037.       for $i = 0 to ubound($blocks,0) -1
  1038.          If stringcompare("block", $words[$o]) == 0 then
  1039.             if stringcompare($blocks[$i][0],$words[$o+4]) == 0 or stringcompare($blocks[$i][0],stringreplace($words[$o+4],"minecraft:","",0,0)) == 0 Then
  1040.                if stringcompare($blocks[$i][1],$words[$o+5]) == 0 Then
  1041.                   $words[$o+4] = $blocks[$i][2]
  1042.                   $words[$o+5] = ""
  1043.                EndIf
  1044.             endif
  1045.          elseIf stringcompare("replaceitem", $words[$o]) == 0 then
  1046.             if stringcompare($blocks[$i][0],$words[$o+4]) == 0 or stringcompare($blocks[$i][0],stringreplace($words[$o+4],"minecraft:","",0,0)) == 0 Then
  1047.                if stringcompare($blocks[$i][1],$words[$o+6]) == 0 Then
  1048.                   $words[$o+4] = $blocks[$i][2]
  1049.                   $words[$o+6] = ""
  1050.                endif
  1051.             Else
  1052.                $words[$o+6] = ""
  1053.             endif
  1054.          else
  1055.             if stringcompare($blocks[$i][0],$words[$o]) == 0 or stringcompare($blocks[$i][0],stringreplace($words[$o],"minecraft:","",0,0)) == 0 Then
  1056.                if stringcompare($blocks[$i][1],$words[$o+2]) == 0 Then
  1057.                   $words[$o] = $blocks[$i][2]
  1058.                   $words[$o+2] = ""
  1059.                EndIf
  1060.             endif
  1061.          endif
  1062.       Next
  1063.    Next
  1064.    for $k = 1 to UBound($words)-1
  1065.       if StringCompare($words[$k],"") <> 0 then
  1066.          $ret &= $words[$k] & " "
  1067.       EndIf
  1068.    next
  1069.    return($ret)
  1070. endfunc
  1071.  
  1072. func sort($arr)
  1073.    $index = 0
  1074. ;~    consolewrite($arr[1][2]& @crlf)
  1075.    $return = "scores={"
  1076.    while $arr[$index][0] <> "" and $index <100
  1077. ;~    consolewrite($arr[$index][0]& @crlf)
  1078.       for $i= $index to 99
  1079.  
  1080.          if $arr[$index][0] == $arr[$i][0] and $i<> $index Then
  1081.             $arr[$index][1] += $arr[$i][1]
  1082.             $arr[$index][2] += $arr[$i][2]
  1083.             $arr[$i][0] = ""
  1084.             $arr[$i][1] = 0
  1085.             $arr[$i][2] = 0
  1086. ;~          ConsoleWrite($arr[$index][0]&" "&$arr[$index][1]&" "&$arr[$index][2] & @crlf)
  1087.          EndIf
  1088.       Next
  1089.       $index += 1
  1090.    wend
  1091.    for $index= 0 to 99
  1092.       if $arr[$index][0] <> "" Then
  1093.          if $return <> "scores={" Then
  1094.             $return &= ","
  1095.          endif
  1096.          $return &= $arr[$index][0]
  1097.          $return &= "="
  1098.          if $arr[$index][1] == $arr[$index][2] Then
  1099.             $return &= $arr[$index][1]
  1100.          else
  1101.             $return &= $arr[$index][1]
  1102.             $return &= ".."
  1103.             $return &= $arr[$index][2]
  1104.          endif
  1105. ;~       ConsoleWrite($arr[$index][0]&" "&$arr[$index][1]&" "&$arr[$index][2] & @crlf)
  1106.       endif
  1107.    next
  1108.    StringTrimRight($return,1)   ; remove the last ","
  1109.    $return &= "}"
  1110.    if $return == "scores={}" Then
  1111.       $return = null
  1112.    EndIf
  1113. ;~    consolewrite($return& @crlf)
  1114.    return $return
  1115. EndFunc
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top