eyal282

flygon-tri-zoo.ahk

May 28th, 2022 (edited)
248
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, Flygon's beginner 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_Descending)
  37.     ; Here we start main deck monsters.
  38.  
  39.     AddCardByText("Tri-brigade Nervall", 3)
  40.     AddCardByText("Maxx C", 3)
  41.     AddCardByText("Tri-brigade Kerass", 2)
  42.     AddCardByText("Tri-brigade Kit", 3)
  43.     AddCardByText("Ash Blossom & Joyous Spring", 3)
  44.     AddCardByText("Rescue Cat", 3)
  45.     AddCardByText("Destiny HERO - Celestial", 1)
  46.     AddCardByText("Zoodiac Thoroughblade", 1)
  47.     AddCardByText("Tri-brigade Fraktall", 3)
  48.     AddCardByText("Destiny HERO - Dasher", 1)
  49.     AddCardByText("The Primal Being", 1)
  50.     AddCardByText("s Feather Duster", 1)
  51.  
  52.     ; The period is important for this card.
  53.     AddCardByText("You can only activate 1 fusion destiny per turn.", 2)
  54.     AddCardByText("You can only activate 1 Lightning Storm per turn.", 1)
  55.  
  56.     AddCardByText("Fire Formation - Tenki", 3)
  57.     AddCardByText("Called By The Grave", 2)
  58.     AddCardByText("Crossout Designator", 2)
  59.     AddCardByText("Forbidden Droplet", 2)
  60.     AddCardByText("Infinite Impermanence", 3)
  61.     AddCardByText("Tri-brigade Revolt", 1)
  62.  
  63.     ; Now we switch to extra deck monsters.
  64.  
  65.     AddCardByText("Destiny HERO - Destroyer Phoenix Enforcer", 1)
  66.     AddCardByText("Zoodiac Boarbow", 1)
  67.     AddCardByText("Zoodiac Drident", 1)
  68.     AddCardByText("Zoodiac Chakanine", 1)
  69.     AddCardByText("Divine Arsenal AA-ZEUS - Sky Thunder", 1)
  70.     AddCardByText("Salamangreat Almiraj", 1)
  71.     AddCardByText("Ancient Warriors Oath - Double Dragon Lords", 1)
  72.     AddCardByText("Tri-brigade Ferrijit the Barren Blossom", 1)
  73.     AddCardByText("Tri-brigade Bearbrumm the Rampant Rampager", 1)
  74.     AddCardByText("the Desperate Doom Eagle", 1)
  75.     AddCardByText("Bow of the Goddess", 1)
  76.     AddCardByText("Accesscode Talker", 1)
  77.     AddCardByText("Tri-brigade Shuraig the Ominous Omen", 2)
  78.     AddCardByText("Predaplant Verte Anaconda", 1)
  79.  
  80.     ResizeWin(LastWinW, LastWinH)
  81.  
  82. }
  83. Else
  84. {
  85.     Return
  86. }
  87.  
  88. ResizeWin(Width = 0,Height = 0)
  89. {
  90.     WinGetPos,X,Y,W,H,A
  91.    
  92.     if(%Width% = 0)
  93.     {
  94.         Width := W
  95.     }
  96.  
  97.     if(%Height% = 0)
  98.     {
  99.         Height := H
  100.     }
  101.  
  102.     WinMove,A,,%X%,%Y%,%Width%,%Height%
  103. }
  104.  
  105. DisplayUnownedCards()
  106. {
  107.     PixelGetColor, OutputVar, 464, 181
  108.  
  109.     OutputVar += 0
  110.  
  111.     if(OutputVar < 2000)
  112.     {
  113.         Click, 464 181
  114.  
  115.         Sleep, 3000
  116.     }
  117. }
  118. RemoveMainDeckMonsters()
  119. {
  120.     ; 70 instead of 65 to account for situations where the player already has an open menu.
  121.     Loop, 70
  122.     {
  123.         Click, 148 197 Right
  124.         Sleep, 100
  125.     }
  126. }
  127.  
  128. RemoveExtraDeckMonsters()
  129. {
  130.     Loop, 20
  131.     {
  132.         Click, 150 341 Right
  133.         Sleep, 100
  134.     }
  135. }
  136.  
  137. ClearAllFilters()
  138. {
  139.     Click, 467 198
  140.     Sleep, 2000
  141. }
  142.  
  143. SetCardSortMethod(cardtype, cardorder)
  144. {
  145.     CardSortType_Rarity := 1
  146.     CardSortType_Level := 2
  147.     CardSortType_ATK := 3
  148.     CardSortType_DEF := 4
  149.  
  150.     CardSortOrder_Ascending := 1
  151.     CardSortOrder_Descending := 2
  152.    
  153.     Sleep, 1000
  154.  
  155.     Click, 419 195
  156.  
  157.     Sleep, 3000
  158.  
  159.  
  160.     targetScreenPosX := 255
  161.  
  162.     if(cardorder = CardSortOrder_Descending)
  163.     {
  164.         targetScreenPosX += 63
  165.     }
  166.  
  167.     targetScreenPosY := 0
  168.  
  169.     switch %cardtype%
  170.     {
  171.         case %CardSortType_Rarity%: targetScreenPosY = 150
  172.         case %CardSortType_Level%: targetScreenPosY = 177
  173.         case %CardSortType_ATK%: targetScreenPosY = 207
  174.         case %CardSortType_DEF%: targetScreenPosY = 232
  175.     }
  176.  
  177.     Click, %targetScreenPosX%, %targetScreenPosY%
  178.  
  179.     Sleep, 3000
  180. }
  181. AddCardByText(text, copies)
  182. {
  183.     text := StrReplace(text, "/", "{NumpadDiv}")
  184.     text := StrReplace(text, "+", "{NumpadAdd}")
  185.     text := StrReplace(text, "-", "{NumpadSub}")
  186.    
  187.     Click, 383 180
  188.     Sleep, 200
  189.     Send, %text%
  190.     Sleep, 200
  191.     Send, {Enter}
  192.     Sleep, 1000
  193.  
  194.     Loop, %copies%
  195.     {
  196.         Click, 360 225 Right
  197.         Sleep, 100
  198.     }
  199.  
  200.     Click, 443 181
  201.     Sleep, 1000
  202. }
  203.  
  204. /::
  205.  
  206.     WinWaitActive, masterduel
  207.  
  208.     WinGetPos,X,Y,LastWinW,LastWinH,A
  209.  
  210.     ResizeWin(512, 512)
  211.  
  212.     MouseGetPos, xpos, ypos
  213.  
  214.     clipboard = Click, %xpos% %ypos%
  215.  
  216. return
  217.  
  218. Esc::
  219.     if(%LastWinW% != 0 && %LastWinH% != 0)
  220.     {
  221.         ResizeWin(LastWinW, LastWinH)
  222.     }
  223.  
  224. ExitApp ; Exit script with Escape key
  225. return
Add Comment
Please, Sign In to add comment