eyal282

Hazama Gemless Paleo

Jul 7th, 2022
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  5.  
  6. CardSortType_Rarity := 1
  7. CardSortType_Level := 2
  8. CardSortType_ATK := 3
  9. CardSortType_DEF := 4
  10.  
  11. CardSortOrder_Ascending := 1
  12. CardSortOrder_Descending := 2
  13.  
  14. MsgBox, 4, Hazama's Gemless deck, Press the Yes button if your game is in windowed mode. If you need to cancel the process, press ESC.
  15.  
  16. LastWinW := 0
  17. LastWinH := 0
  18.  
  19. IfMsgBox Yes
  20. {
  21.     WinWaitActive, masterduel
  22.  
  23.     WinGetPos,X,Y,LastWinW,LastWinH,A
  24.  
  25.     ResizeWin(512, 512)
  26.    
  27.     RemoveMainDeckMonsters()
  28.  
  29.     ; RemoveMainDeckMonsters ensures the mouse is not pointing at the button of display unowned cards.
  30.     DisplayUnownedCards()
  31.  
  32.     RemoveExtraDeckMonsters()
  33.  
  34.     ClearAllFilters()
  35.    
  36.     SetCardSortMethod(CardSortType_Rarity, CardSortOrder_Ascending)
  37.     AddCardByText("Sea Stealth Attack", 3)
  38.     AddCardByText("Torrential Tribute", 2)
  39.     AddCardByText("Gaia Knight, The Force of Earth", 3)
  40.     AddCardByText("+ Blue-Eyes White Dragon", 2)
  41.     AddCardByText("Berserker of the Tenyi", 1)
  42.  
  43.     SetCardSortMethod(CardSortType_Rarity, CardSortOrder_Descending)
  44.     ; Here we start main deck monsters.
  45.  
  46.     AddCardByText("Megalosmasher X", 3)
  47.     AddCardByText("Planet Pathfinder", 3)
  48.     AddCardByText("Pacifis, the Phantasm City", 3)
  49.     AddCardByText("Dimensional Fissure", 3)
  50.     AddCardByText("Mystical Space Typhoon", 2)
  51.     AddCardByText("Forbidden Chalice", 2)
  52.     AddCardByText("Floodgate Trap Hole", 2)
  53.     AddCardByText("Paleozoic Canadia", 2)
  54.     AddCardByText("Paleozoic Dinomischus", 2)
  55.     AddCardByText("Paleozoic Pikaia", 2)
  56.     AddCardByText("Spiral Battle Min", 3)
  57.     AddCardByText("Spiral Power Min", 2)
  58.     AddCardByText("Dogmatika Punishment", 3)
  59.     AddCardByText("Fists of the Unrivaled Tenyi", 3)
  60.  
  61.     ; Now we switch to extra deck monsters.
  62.  
  63.     AddCardByText("Herald of Pure Light", 1)
  64.     AddCardByText("Cat Shark", 1)
  65.     AddCardByText("Number 45: Crumble Logos the Prophet of Demolition", 1)
  66.     AddCardByText("The Phantom Knights of Cursed Javelin", 1)
  67.     AddCardByText("Gem-Knight Pearl", 1)
  68.     AddCardByText("Number 82: Heartlandraco", 1)
  69.     AddCardByText("Gagaga Samurai", 1)
  70.     AddCardByText("Number 70: Malevolent Sin", 1)
  71.     AddCardByText("Defender of the Labyrinth", 1)
  72.  
  73.     ResizeWin(LastWinW, LastWinH)
  74.  
  75. }
  76. Else
  77. {
  78.     Return
  79. }
  80.  
  81. ResizeWin(Width = 0,Height = 0)
  82. {
  83.     WinGetPos,X,Y,W,H,A
  84.    
  85.     if(%Width% = 0)
  86.     {
  87.         Width := W
  88.     }
  89.  
  90.     if(%Height% = 0)
  91.     {
  92.         Height := H
  93.     }
  94.  
  95.     WinMove,A,,%X%,%Y%,%Width%,%Height%
  96. }
  97.  
  98. DisplayUnownedCards()
  99. {
  100.     PixelGetColor, OutputVar, 464, 181
  101.  
  102.     OutputVar += 0
  103.  
  104.     if(OutputVar < 2000)
  105.     {
  106.         Click, 464 181
  107.  
  108.         Sleep, 3000
  109.     }
  110. }
  111. RemoveMainDeckMonsters()
  112. {
  113.     ; 70 instead of 65 to account for situations where the player already has an open menu.
  114.     Loop, 70
  115.     {
  116.         Click, 148 197 Right
  117.         Sleep, 100
  118.     }
  119. }
  120.  
  121. RemoveExtraDeckMonsters()
  122. {
  123.     Loop, 20
  124.     {
  125.         Click, 150 341 Right
  126.         Sleep, 100
  127.     }
  128. }
  129.  
  130. ClearAllFilters()
  131. {
  132.     Click, 467 198
  133.     Sleep, 2000
  134. }
  135.  
  136. SetCardSortMethod(cardtype, cardorder)
  137. {
  138.     CardSortType_Rarity := 1
  139.     CardSortType_Level := 2
  140.     CardSortType_ATK := 3
  141.     CardSortType_DEF := 4
  142.  
  143.     CardSortOrder_Ascending := 1
  144.     CardSortOrder_Descending := 2
  145.    
  146.     Sleep, 1000
  147.  
  148.     Click, 419 195
  149.  
  150.     Sleep, 3000
  151.  
  152.  
  153.     targetScreenPosX := 255
  154.  
  155.     if(cardorder = CardSortOrder_Descending)
  156.     {
  157.         targetScreenPosX += 63
  158.     }
  159.  
  160.     targetScreenPosY := 0
  161.  
  162.     switch %cardtype%
  163.     {
  164.         case %CardSortType_Rarity%: targetScreenPosY = 150
  165.         case %CardSortType_Level%: targetScreenPosY = 177
  166.         case %CardSortType_ATK%: targetScreenPosY = 207
  167.         case %CardSortType_DEF%: targetScreenPosY = 232
  168.     }
  169.  
  170.     Click, %targetScreenPosX%, %targetScreenPosY%
  171.  
  172.     Sleep, 3000
  173. }
  174. AddCardByText(text, copies)
  175. {
  176.     text := StrReplace(text, "/", "{NumpadDiv}")
  177.     text := StrReplace(text, "+", "{NumpadAdd}")
  178.     text := StrReplace(text, "-", "{NumpadSub}")
  179.    
  180.     Click, 383 180
  181.     Sleep, 200
  182.     Send, %text%
  183.     Sleep, 200
  184.     Send, {Enter}
  185.     Sleep, 1000
  186.  
  187.     Loop, %copies%
  188.     {
  189.         Click, 360 225 Right
  190.         Sleep, 100
  191.     }
  192.  
  193.     Click, 443 181
  194.     Sleep, 1000
  195. }
  196.  
  197. /::
  198.  
  199.     WinWaitActive, masterduel
  200.  
  201.     WinGetPos,X,Y,LastWinW,LastWinH,A
  202.  
  203.     ResizeWin(512, 512)
  204.  
  205.     MouseGetPos, xpos, ypos
  206.  
  207.     clipboard = Click, %xpos% %ypos%
  208.  
  209. return
  210.  
  211. Esc::
  212.     if(%LastWinW% != 0 && %LastWinH% != 0)
  213.     {
  214.         ResizeWin(LastWinW, LastWinH)
  215.     }
  216.  
  217. ExitApp ; Exit script with Escape key
  218. return
Add Comment
Please, Sign In to add comment