Advertisement
Guest User

Map IPD Editor

a guest
Nov 18th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. #Persistent
  3. #SingleInstance, force
  4. SetBatchLines, -1
  5. DetectHiddenWindows, On
  6.  
  7. ; MapDataArrays:
  8. ;   ArrayName := ["Map Name", Tier, Level, Layout, Boss, "Icon URL"]
  9. ARR_MapD_0_   := ["NOT DEFINED",0,""]
  10. ARR_MapD_1_   := ["Crypt Map",68,1,"C",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/5/5b/Crypt_Map.png"]
  11. ARR_MapD_2_   := ["Desert Map",68,1,"C",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/9/9b/Desert_Map.png"]
  12. ARR_MapD_3_   := ["Dunes Map",68,1,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/0/00/Dunes_Map.png"]
  13. ARR_MapD_4_   := ["Dungeon Map",68,1,"C",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/b/b1/Dungeon_Map.png"]
  14. ARR_MapD_5_   := ["Grotto Map",68,1,"C",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/a/a8/Grotto_Map.png"]
  15. ARR_MapD_6_   := ["Pit Map",68,1,"C",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/9/9b/Pit_Map.png"]
  16. ARR_MapD_7_   := ["Tropical Island Map",68,1,"A",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/6/67/Tropical_Island_Map.png"]
  17. ARR_MapD_8_   := ["Arcade Map",69,2,"B",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/3/30/Arcade_Map.png"]
  18. ARR_MapD_9_   := ["Cemetery Map",69,2,"B",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/9/9d/Cemetery_Map.png"]
  19. ARR_MapD_10_  := ["Channel Map",69,2,"C",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/f/f6/Channel_Map.png"]
  20. ARR_MapD_11_  := ["Mountain Ledge Map",69,2,"A",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/1/13/Mountain_Ledge_Map.png"]
  21. ARR_MapD_12_  := ["Sewer Map",69,2,"C",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/f/f1/Sewer_Map.png"]
  22. ARR_MapD_13_  := ["Thicket Map",69,2,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/a/a1/Thicket_Map.png"]
  23. ARR_MapD_14_  := ["Wharf Map",69,2,"A",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/1/1d/Wharf_Map.png"]
  24. ARR_MapD_15_  := ["Ghetto Map",70,3,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/d/d4/Ghetto_Map.png"]
  25. ARR_MapD_16_  := ["Mud Geyser Map",70,3,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/6/66/Mud_Geyser_Map.png"]
  26. ARR_MapD_17_  := ["Museum Map",70,3,"C",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/a/ad/Museum_Map.png"]
  27. ARR_MapD_18_  := ["Quarry Map",70,3,"B",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/8/88/Quarry_Map.png"]
  28. ARR_MapD_19_  := ["Reef Map",70,3,"C",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/e/e2/Reef_Map.png"]
  29. ARR_MapD_20_  := ["Spider Lair Map",70,3,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/9/95/Spider_Lair_Map.png"]
  30. ARR_MapD_21_  := ["Vaal Pyramid Map",70,3,"C",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/2/22/Vaal_Pyramid_Map.png"]
  31. ARR_MapD_22_  := ["Arena Map",71,4,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/6/6c/Arena_Map.png"]
  32. ARR_MapD_23_  := ["Overgrown Shrine Map",71,4,"C",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/1/11/Overgrown_Shrine_Map.png"]
  33. ARR_MapD_24_  := ["Promenade Map",71,4,"A",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/4/4c/Promenade_Map.png"]
  34. ARR_MapD_25_  := ["Phantasmagoria Map",71,4,"A",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/0/04/Phantasmagoria_Map.png"]
  35. ARR_MapD_26_  := ["Shore Map",71,4,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/e/e8/Shore_Map.png"]
  36. ARR_MapD_27_  := ["Spider Forest Map",71,4,"C",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/c/cc/Spider_Forest_Map.png"]
  37. ARR_MapD_28_  := ["Tunnel Map",71,4,"C",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/c/c2/Tunnel_Map.png"]
  38. ARR_MapD_29_  := ["Bog Map",72,5,"B",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/4/40/Bog_Map.png"]
  39. ARR_MapD_30_  := ["Coves Map",72,5,"B",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/2/22/Coves_Map.png"]
  40. ARR_MapD_31_  := ["Graveyard Map",72,5,"B",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/3/39/Graveyard_Map.png"]
  41. ARR_MapD_32_  := ["Pier Map",72,5,"A",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/5/51/Pier_Map.png"]
  42. ARR_MapD_33_  := ["Underground Sea Map",72,5,"A",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/9/99/Underground_Sea_Map.png"]
  43. ARR_MapD_34_  := ["Villa Map",72,5,"C",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/0/06/Villa_Map.png"]
  44. ARR_MapD_35_  := ["Arachnid Nest Map",73,6,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/f/f8/Arachnid_Nest_Map.png"]
  45. ARR_MapD_36_  := ["Catacomb Map",73,6,"C",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/0/09/Catacomb_Map.png"]
  46. ARR_MapD_37_  := ["Colonnade Map",73,6,"A",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/2/29/Colonnade_Map.png"]
  47. ARR_MapD_38_  := ["Dry Woods Map",73,6,"B",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/3/31/Dry_Woods_Map.png"]
  48. ARR_MapD_39_  := ["Strand Map",73,6,"A",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/0/01/Strand_Map.png"]
  49. ARR_MapD_40_  := ["Temple Map",73,6,"C",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/e/ed/Temple_Map.png"]
  50. ARR_MapD_41_  := ["Jungle Valley Map",74,7,"A",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/9/9f/Jungle_Valley_Map.png"]
  51. ARR_MapD_42_  := ["Terrace Map",74,7,"C",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/7/70/Terrace_Map.png"]
  52. ARR_MapD_43_  := ["Mine Map",74,7,"C",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/2/24/Mine_Map.png"]
  53. ARR_MapD_44_  := ["Torture Chamber Map",74,7,"C",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/c/c3/Torture_Chamber_Map.png"]
  54. ARR_MapD_45_  := ["Waste Pool Map",74,7,"C",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/8/81/Waste_Pool_Map.png"]
  55. ARR_MapD_46_  := ["Canyon Map",75,8,"A",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/0/0f/Canyon_Map.png"]
  56. ARR_MapD_47_  := ["Cells Map",75,8,"C",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/2/26/Cells_Map.png"]
  57. ARR_MapD_48_  := ["Dark Forest Map",75,8,"B",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/8/80/Dark_Forest_Map.png"]
  58. ARR_MapD_49_  := ["Dry Peninsula Map",75,8,"A",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/9/9c/Dry_Peninsula_Map.png"]
  59. ARR_MapD_50_  := ["Orchard Map",75,8,"C",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/5/5d/Orchard_Map.png"]
  60. ARR_MapD_51_  := ["Arid Lake Map",76,9,"B",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/d/d6/Arid_Lake_Map.png"]
  61. ARR_MapD_52_  := ["Gorge Map",76,9,"A",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/8/86/Gorge_Map.png"]
  62. ARR_MapD_53_  := ["Malformation Map",76,9,"C",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/a/a7/Malformation_Map.png"]
  63. ARR_MapD_54_  := ["Residence Map",76,9,"B",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/5/5f/Residence_Map.png"]
  64. ARR_MapD_55_  := ["Underground River Map",76,9,"C",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/2/2e/Underground_River_Map.png"]
  65. ARR_MapD_56_  := ["Bazaar Map",77,10,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/c/cf/Bazaar_Map.png"]
  66. ARR_MapD_57_  := ["Necropolis Map",77,10,"C",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/c/cf/Bazaar_Map.png"]
  67. ARR_MapD_58_  := ["Plateau Map",77,10,"A",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/a/a2/Plateau_Map.png"]
  68. ARR_MapD_59_  := ["Volcano Map",77,10,"A",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/b/b6/Volcano_Map.png"]
  69. ARR_MapD_60_  := ["Academy Map",78,11,"C",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/2/21/Academy_Map.png"]
  70. ARR_MapD_61_  := ["Crematorium Map",78,11,"C",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/0/03/Crematorium_Map.png"]
  71. ARR_MapD_62_  := ["Precinct Map",78,11,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/9/9d/Precinct_Map.png"]
  72. ARR_MapD_63_  := ["Springs Map",78,11,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/0/03/Springs_Map.png"]
  73. ARR_MapD_64_  := ["Arsenal Map",79,12,"C",1,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/a/a2/Arsenal_Map.png"]
  74. ARR_MapD_65_  := ["Overgrown Ruin Map",79,12,"C",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/4/4a/Overgrown_Ruin_Map.png"]
  75. ARR_MapD_66_  := ["Shipyard Map",79,12,"B",2,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/4/44/Shipyard_Map.png"]
  76. ARR_MapD_67_  := ["Village Ruin Map",79,12,"B",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/6/67/Village_Ruin_Map.png"]
  77. ARR_MapD_68_  := ["Courtyard Map",80,13,"B",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/b/be/Courtyard_Map.png"]
  78. ARR_MapD_69_  := ["Excavation Map",80,13,"C",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/0/05/Excavation_Map.png"]
  79. ARR_MapD_70_  := ["Wasteland Map",80,13,"B",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/e/e1/Wasteland_Map.png"]
  80. ARR_MapD_71_  := ["Waterways Map",80,13,"C",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/e/ed/Waterways_Map.png"]
  81. ARR_MapD_72_  := ["Conservatory Map",81,14,"C",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/7/70/Conservatory_Map.png"]
  82. ARR_MapD_73_  := ["Palace Map",81,14,"C",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/4/4b/Palace_Map.png"]
  83. ARR_MapD_74_  := ["Shrine Map",81,14,"B",4,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/c/c4/Shrine_Map.png"]
  84. ARR_MapD_75_  := ["Vaal Temple Map",81,14,"C",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/b/b8/Vaal_Temple_Map.png"]
  85. ARR_MapD_76_  := ["Abyss Map",82,15,"B",3,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/6/6f/Abyss_Map.png"]
  86. ARR_MapD_77_  := ["Colosseum Map",82,15,"A",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/1/19/Colosseum_Map.png"]
  87. ARR_MapD_78_  := ["Core Map",82,15,"C",5,"http://hydra-media.cursecdn.com/pathofexile.gamepedia.com/2/2c/Core_Map.png"]
  88.  
  89. T1      := 150      ;column1 width
  90. T2      := 30       ;column2 width
  91. T3      := 30       ;column3 width
  92. T4      := 50       ;column4 width
  93. T5      := 40       ;column5 width
  94.  
  95. T1A     := T1+T2
  96. T3A     := T1+T2+T3+T4+T5
  97.  
  98. T3B     := T3A+21   ;listview width
  99. T3B1    := T3A+31   ;listview-groupbox xPos
  100. T3C     := T3A+325  ;guishow width
  101. T3D     := T3A+315  ;Full-Length EditControls width
  102. T3ExP   := T3B1+20  ;Rarity-Groupbox xPos
  103. T3E1xP  := T3B1+25  ;Rarity-DropDownList xPos
  104. T4ExP   := T3ExP+150    ;Mods-Groupbox
  105. T4E1xP  := T3ExP+155    ;Mods-Groupbox
  106.  
  107. T3FxP   := T3B1+20  ;Quality-Groupbox xPos
  108. T3F1xP  := T3B1+70  ;Quality-Editbox xPos
  109. T3F2xP  := T3B1+95  ;Quality-Button xPos
  110. T3F     := 30       ;Quality-Editbox width
  111.  
  112. T3Z1xP  := 450
  113.  
  114. FinalIPDLine := ""
  115.  
  116. ; S-T-A-R-T  O-F  T-H-E  G-U-I  !!!
  117. Gui, Destroy
  118. Gui, -AlwaysOnTop +SysMenu +Caption +LastFound +OwnDialogs +ToolWindow +Border +E0x40000
  119. GuiHwnd := WinExist()
  120.  
  121.     Gui, Font
  122.     Gui, Font, w600 s9 black, Candara
  123.     Gui, Add, GroupBox, x5 y5 w%T3B1% h223, Start by selecting a map
  124.     Gui, Font
  125.     Gui, Font, Normal s8 black, Tahoma
  126.     Gui, Add, ListView, X10 Y25 W%T3B% R10 +LV0x100 -Multi +hscroll altsubmit vMyListView gMyListView, Map Name|LVL|Tier|Layout|Boss
  127.    
  128.     ; Adjusting the width of each listview column
  129.     LV_ModifyCol(1,T1)
  130.     LV_ModifyCol(2,T2)
  131.     LV_ModifyCol(3,T3)
  132.     LV_ModifyCol(4,T4)
  133.     LV_ModifyCol(5,T5)
  134.     LV_ModifyCol(2,"Center")
  135.     LV_ModifyCol(3,"Center")
  136.     LV_ModifyCol(4,"Center")
  137.     LV_ModifyCol(5,"Center")
  138.  
  139.     ; Creating the imagelist
  140.     ImageListID := IL_Create(78)
  141.     LV_SetImageList(ImageListID)
  142.    
  143.     ; 'Parsing Map Data' Message
  144.     Gui,9:Destroy
  145.     Gui,9:+AlwaysOnTop +Caption +LastFound +OwnDialogs +ToolWindow +Border -Resize
  146.     gui,9:color,white
  147.        
  148.         Gui,9:Font,Bold s18 Red,Calibri Light
  149.         Gui,9:Add, Text, +BackgroundTrans x10 y10 w550 h70 c4E3C28 +Center, Parsing Map Data! This might take some seconds!
  150.        
  151.     Gui,9:Show, x125 y125 w575 h75, initializing...
  152.    
  153.     Loop, 78
  154.     {
  155.         DownloadFile(ARR_MapD_%A_Index%_[6], "C:\TMP_Map.bmp", Overwrite := True, UseProgressBar := False)
  156.         IL_Add(ImageListID, "C:\TMP_Map.bmp")
  157.     }
  158.    
  159.     Gui,9:Destroy
  160.    
  161.     ; Filling the listview-groupbox
  162.     tmpindex2:=0
  163.     Loop, 79
  164.     {
  165.         LV_Add("Icon" . tmpindex2, ARR_MapD_%tmpindex2%_[1], ARR_MapD_%tmpindex2%_[2], ARR_MapD_%tmpindex2%_[3], ARR_MapD_%tmpindex2%_[4], ARR_MapD_%tmpindex2%_[5])
  166.         tmpindex2++
  167.     }
  168.    
  169.     Gui, Font
  170.     Gui, Font, w600 s9 black, Candara
  171.     Gui, Add, Text, x5 y243 w110 h17, Final IPD Line:
  172.     ; Creating a readonly editbox control which should result the final line to add into the map.ipd
  173.     Gui, Font
  174.     Gui, Font, Normal s8 black, Tahoma
  175.     Gui, Add, Edit, x5 y260 w%T3D% h60 ReadOnly vC +Left,
  176.    
  177.     Gui, Font
  178.     Gui, Font, w600 s9 black, Candara
  179.     Gui, Add, GroupBox, x%T3ExP% y5 w120 h50, Select rarity
  180.     Gui, Font
  181.     Gui, Font, Normal s8 black, Tahoma
  182.     Gui, Add, DropDownList, x%T3E1xP% y25 w110 vRaritySelection gRaritySelection, I dont care|Normal|Magic|Rare|Unique
  183.    
  184.     Gui, Font
  185.     Gui, Font, w600 s9 black, Candara
  186.     Gui, Add, GroupBox, x%T4ExP% y5 w120 h50, Mods to ReRoll
  187.     Gui, Font
  188.     Gui, Font, Normal s8 black, Tahoma
  189.     Gui, Add, DropDownList, x%T4E1xP% y25 w110 vReRollSelection gReRollSelection, bla|blabla|blub|blah|pft
  190.    
  191.     Gui, Font
  192.     Gui, Font, w600 s9 black, Candara
  193.     Gui, Add, GroupBox, x%T3FxP% y65 w120 h50, Enter `% quality
  194.     Gui, Font
  195.     Gui, Font, Normal s8 black, Tahoma
  196.     GUI_CreateEdit(T3F1xP, 85, T3F, , , "0-20", , "SetQuality", "")
  197.    
  198.     Gui, Font
  199.     Gui, Font, w600 s9 black, Candara
  200.     Gui, Add, GroupBox, x%T3ExP% y125 w120 h50, Task
  201.     Gui, Font
  202.     Gui, Font, Normal s8 black, Tahoma
  203.     Gui, Add, DropDownList, x%T3E1xP% y145 w110 vRunOrIgnore gRunOrIgnore, Run Map|Ignore Map|UpgradeQuality|UpgradeToMagic|UpgradeToRare|RerollMods
  204.    
  205.     Gui, Font
  206.     Gui, Font, w600 s9 black, Candara
  207.     Gui, Add, Button, x%T3Z1xP% y230 w175 -theme +0x8000 vFinalizeEntry gFinalizeEntry Hidden, Finalize/Create IPD Line
  208.    
  209.     Gui, Font
  210.     Gui, Font, Normal s8 black, Tahoma
  211.    
  212. Gui, Show, w%T3C%, Map - IPD Editor [immo/2015]
  213. WinSet, Redraw
  214.  
  215. GuiControl, disable, ReRollSelection,
  216. GuiControl, ChooseString, RunOrIgnore, Run Map
  217. FinalLineIgnoreOrRunAdd := "# [RunMap] == """ "true" """ "
  218. GuiControl, ChooseString, RaritySelection, I dont care
  219. FinalLineRarityAdd := ""
  220.  
  221. ; handling the ListView
  222. MyListView:
  223.     GuiControlGet, MyListView
  224.     ; Double clicking a map in the listview will open the particular map in poe's wiki
  225.     if A_GuiEvent = DoubleClick
  226.     {
  227.         MouseGetPos,x,y
  228.         if x<%T3A%
  229.         {
  230.             LV_GetText(C1,A_EventInfo,1)
  231.             If Not C1 == "NOT DEFINED"
  232.             {
  233.                 run, % "http://pathofexile.gamepedia.com/" . C1
  234.                 return
  235.             }
  236.         }
  237.  
  238.         if x<%T2A%
  239.         return
  240.     }
  241.  
  242.     if A_GuiEvent = Normal
  243.     {
  244.         LV_GetText(C1,A_EventInfo,1)
  245.         LV_GetText(C2,A_EventInfo,2)
  246.         LV_GetText(C3,A_EventInfo,3)
  247.         If(C1) {
  248.             FinalLineMapAdd := % "[Type] == """ C1 """ && [MapTier] == """ C3 """ "
  249.             GuiControl, Show, FinalizeEntry,
  250.         } else {
  251.             GuiControl, Hide, FinalizeEntry,
  252.         }
  253.     }
  254. return
  255.  
  256. ReRollSelection:
  257.     Gui, Submit, NoHide
  258. return
  259.  
  260. RaritySelection:
  261.     Gui, Submit, NoHide
  262.     If ((RaritySelection == "I dont care") || (RaritySelection = "")) {
  263.         FinalLineRarityAdd := ""
  264.     } else {
  265.         FinalLineRarityAdd := "&& [Rarity] == """ RaritySelection """ "
  266.     }
  267. return
  268.  
  269. RunOrIgnore:
  270.     Gui, Submit, NoHide
  271.     If (RunOrIgnore == "Run Map") {
  272.         FinalLineIgnoreOrRunAdd := "# [RunMap] == """ "true" """ "
  273.         GuiControl, enable, RaritySelection,
  274.         If ((RaritySelection == "I dont care") || (RaritySelection = "")) {
  275.             GuiControl, ChooseString, RaritySelection, I dont care
  276.             FinalLineRarityAdd := ""
  277.         } else {
  278.             FinalLineRarityAdd := "&& [Rarity] == """ RaritySelection """ "
  279.         }
  280.         GuiControl, disable, ReRollSelection,
  281.     } else If (RunOrIgnore == "Ignore Map") {
  282.         FinalLineIgnoreOrRunAdd := "# [IgnoreMap] == """ "true" """ "
  283.         GuiControl, enable, RaritySelection,
  284.         If ((RaritySelection == "I dont care") || (RaritySelection = "")) {
  285.             GuiControl, ChooseString, RaritySelection, I dont care
  286.             FinalLineRarityAdd := ""
  287.         } else {
  288.             FinalLineRarityAdd := "&& [Rarity] == """ RaritySelection """ "
  289.         }
  290.         GuiControl, disable, ReRollSelection,
  291.     } else If (RunOrIgnore == "UpgradeQuality") {
  292.         FinalLineIgnoreOrRunAdd := "# [UpgradeQuality] == """ "true" """ "
  293.         GuiControl, enable, RaritySelection,
  294.         If ((RaritySelection == "I dont care") || (RaritySelection = "")) {
  295.             GuiControl, ChooseString, RaritySelection, I dont care
  296.             FinalLineRarityAdd := ""
  297.         } else {
  298.             FinalLineRarityAdd := "&& [Rarity] == """ RaritySelection """ "
  299.         }
  300.         GuiControl, disable, ReRollSelection,
  301.     } else If (RunOrIgnore == "UpgradeToMagic") {
  302.         FinalLineIgnoreOrRunAdd := "# [UpgradeToMagic] == """ "true" """ "
  303.         GuiControl, disable, RaritySelection,
  304.         FinalLineRarityAdd := "&& [Rarity] == ""Normal"" "
  305.         GuiControl, disable, ReRollSelection,
  306.     } else If (RunOrIgnore == "UpgradeToRare") {
  307.         FinalLineIgnoreOrRunAdd := "# [UpgradeToRare] == """ "true" """ "
  308.         GuiControl, disable, RaritySelection,
  309.         FinalLineRarityAdd := "&& [Rarity] == ""Magic"" "
  310.         GuiControl, disable, ReRollSelection,
  311.     } else If (RunOrIgnore == "RerollMods") {
  312.         GuiControl, enable, ReRollSelection,
  313.         FinalLineIgnoreOrRunAdd := "# [RerollMods] == """ "true" """ "
  314.         GuiControl, enable, RaritySelection,
  315.         If ((RaritySelection == "I dont care") || (RaritySelection = "")) {
  316.             GuiControl, ChooseString, RaritySelection, I dont care
  317.             FinalLineRarityAdd := ""
  318.         } else {
  319.             FinalLineRarityAdd := "&& [Rarity] == """ RaritySelection """ "
  320.         }
  321.     }
  322. return
  323.  
  324. FinalizeEntry:
  325.     Gui, Submit, NoHide
  326.     If (RunOrIgnore == "UpgradeQuality") {
  327.         If (SetQuality) {
  328.             FinalLineQualityAdd := "&& [Quality] <= """ SetQuality """ "
  329.         } else {
  330.             FinalLineQualityAdd := "&& [Quality] <= """ "16" """ "
  331.         }
  332.     } else If (SetQuality) {
  333.         FinalLineQualityAdd := "&& [Quality] == """ SetQuality """ "
  334.     } else {
  335.         FinalLineQualityAdd := ""
  336.     }
  337.     GuiControl, ,C, % FinalLineMapAdd . "" . FinalLineRarityAdd . "" . FinalLineQualityAdd . "" . FinalLineIgnoreOrRunAdd
  338.     GuiControl, ChooseString, RunOrIgnore, Run Map
  339.     FinalLineIgnoreOrRunAdd := "# [RunMap] == """ "true" """ "
  340.     GuiControl, enable, RaritySelection,
  341.     GuiControl, ChooseString, RaritySelection, I dont care
  342.     FinalLineRarityAdd := ""
  343. Return
  344.  
  345. GuiClose:
  346. ExitApp
  347.  
  348.  
  349. GUI_CreateEdit(X = 0, Y = 0, W = 50, H = 17, options = "+Number +Center", description ="", gLabel = "", vLabel = "", initialvalue = "")
  350. {
  351.     global
  352.     Gui, Font
  353.     TextWidth   := StrLen(Description) * 6.5
  354.     TextXPos    := (X - (StrLen(Description) * 6.5)) - 5
  355.    
  356.     if (Y = 0)
  357.     {
  358.         Y       := 16
  359.         TextYPos:= 2
  360.        
  361.         Gui, Add, Edit, x%X% yp+%Y% w%W% h%H% %options% g%gLabel% v%vLabel%, %initialvalue%
  362.         Gui, Add, Text, +BackgRoundTrans x%TextXPos% yp+%TextYPos% w%TextWidth% h%H% c4E3C28 +Right, %description%
  363.     }
  364.     Else
  365.     {
  366.         TextYPos:= Y + 2
  367.        
  368.         Gui, Add, Edit, x%X% y%Y% w%W% h%H% %options% g%gLabel% v%vLabel%, %initialvalue%
  369.         Gui, Add, Text, +BackgRoundTrans x%TextXPos% y%TextYPos% w%TextWidth% h%H% c4E3C28 +Right, %description%
  370.     }
  371.     Gui, Font
  372.     return
  373. }
  374.  
  375. DownloadFile(UrlToFile, _SaveFileAs, Overwrite := True, UseProgressBar := True)
  376. {
  377.     If (!Overwrite && FileExist(_SaveFileAs))
  378.     {
  379.         FileSelectFile, _SaveFileAs,S, %_SaveFileAs%
  380.         if !_SaveFileAs ; user didnt select anything
  381.             return
  382.     }
  383.  
  384.     If (UseProgressBar)
  385.     {
  386.         SaveFileAs := _SaveFileAs
  387.         ;Initialize the WinHttpRequest Object
  388.         WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  389.         ;Download the headers
  390.         WebRequest.Open("HEAD", UrlToFile)
  391.         WebRequest.Send()
  392.         ;Store the header which holds the file size in a variable:
  393.         FinalSize := WebRequest.GetResponseHeader("Content-Length")
  394.         Progress, H80, , Downloading..., %UrlToFile% Download
  395.         SetTimer, DownloadFileFunction_UpdateProgressBar, 100
  396.     }
  397.         UrlDownloadToFile, %UrlToFile%, %_SaveFileAs%
  398.      
  399.     If (UseProgressBar)
  400.     {
  401.         Progress, Off
  402.         SetTimer, DownloadFileFunction_UpdateProgressBar, Off
  403.     }
  404.     return
  405.  
  406.     DownloadFileFunction_UpdateProgressBar:
  407.         ;Get the current filesize and tick
  408.         CurrentSize := FileOpen(_SaveFileAs, "r").Length ;FileGetSize wouldn't return reliable results
  409.         CurrentSizeTick := A_TickCount
  410.         ;Calculate the downloadspeed
  411.         Speed := Round((CurrentSize/1024-LastSize/1024)/((CurrentSizeTick-LastSizeTick)/1000)) . " Kb/s"
  412.         ;Save the current filesize and tick for the next time
  413.         LastSizeTick := CurrentSizeTick
  414.         LastSize := FileOpen(_SaveFileAs, "r").Length
  415.         PercentDone := Round(CurrentSize/FinalSize*100)
  416.         Progress, %PercentDone%, %PercentDone%`% Done, Downloading...    (%Speed%), Downloading %_SaveFileAs% (%PercentDone%`%)
  417.     return
  418. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement