Advertisement
Guest User

Untitled

a guest
Mar 1st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 8.30 KB | None | 0 0
  1. ;====================================================================================================
  2. ;====================================================================================================
  3. ;==========================Shiny Hunter Bot for Pokemon FireRed======================================
  4. ;===============================Written and tested by Kyle===========================================
  5. ;=====================Fixed the problem with saving at the wrong screen==============================
  6. ;====================================Version 3.0.3===================================================
  7. ;====================================================================================================
  8. ;====================================================================================================
  9. Global $UnPaused
  10. Global $Paused
  11. HotKeySet("{Home}", "TogglePause")
  12. HotKeySet("{End}", "Terminate")
  13. HotKeySet("{Pause}", "Paused")
  14. AutoItWinSetTitle("SHunter")                    ;Set title of bot
  15. Opt("MouseCoordMode", 0)                        ;1=absolute, 0=relative, 2=client
  16. Opt("PixelCoordMode", 0)                        ;1=absolute, 0=relative, 2=client
  17. Opt("WinTitleMatchMode",2)                      ;1=absolute, 0=relative, 2=client
  18. Opt("SendKeyDownDelay", 50)                     ;Set down delay to 50 miliseconds
  19. $d = "{a DOWN} {s DOWN} {x DOWN} {z DOWN}"
  20. $u = "{a DOWN} {s UP} {x UP} {z UP}"
  21. $n = 0                                          ;Reset counter
  22. $count = 0                                      ;Male shiny counter
  23. $pos = WinGetPos("VisualBoyAdvance")
  24.  
  25. If $pos[0] <> 0 and $pos[1] <> 0 Then
  26.    WinMove("VisualBoyAdvance","",0,0)
  27.    Sleep(100)
  28. EndIf
  29.  
  30. While 1
  31.    Sleep(100)
  32.    ToolTip("Bot is Paused",0,0)
  33. WEnd
  34.  
  35. Func Paused()
  36.    $Paused = NOT $Paused
  37.    While $Paused
  38.     Sleep(100)
  39.     ToolTip("Bot is Paused",0,0)
  40.    WEnd
  41. EndFunc
  42.  
  43. Func TogglePause()
  44.    $UnPaused = NOT $UnPaused
  45.    ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Bot started....",0,0)
  46.    Sleep(100)
  47.       While $UnPaused
  48. Select
  49. Case PixelGetColor(720,60) = 0xA0D058 ;Green Ruby/Sapphire Screen
  50.    ToolTip("Something messed up and I got the Ruby/Sapphire Screen",0,0)
  51.    Send($d)
  52.    Sleep(10)
  53.    Send($u)
  54.    Sleep(1000)
  55.    Send("{x}")
  56.    Sleep(1000)
  57.    
  58. Case PixelGetColor(670,175) = 0x182848 ;or 0xF89000 ;Blue/Orange screen at restart
  59.    ToolTip("Blue/Orange Screen at restart",0,0)
  60.    Send("{x}")
  61.    Sleep(1000)
  62.    
  63. Case PixelGetColor(650,325) = 0x885890 ;or 0x804078 ;Pokemon Fight Scene
  64.    ToolTip("Pokemon Fight Sceen",0,0)
  65.    Send("{x}")
  66.    Sleep(1000)
  67.    
  68. Case PixelGetColor(690,160) = 0x408860 ;Trees color
  69.    ToolTip("Trees",0,0)
  70.    Send("{x}")
  71.    Sleep(1000)
  72. EndSelect
  73. $s = 0
  74. $p = 0
  75. $r = 0
  76.       Do
  77. $start = PixelGetColor(650,230)                 ;Checking to see if it's the start screen
  78.          If $start = 0x400000 Then
  79.             ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Press Start Screen",0,0)
  80.             Send("{x}")
  81.             Sleep(750)
  82.          Else
  83.             $s = 1
  84.          EndIf
  85.          $s = 1
  86.       Until $s = 1
  87.       Do
  88. $profile = PixelGetColor(400,500)               ;Coordinates of the Profile select screen
  89.          If $profile = 0x505890 Then
  90.             ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Select Profile Screen",0,0)
  91.             Send("{x}")
  92.             Sleep(250)
  93.          Else
  94.             $p = 1
  95.          EndIf
  96.          $p = 1
  97.       Until $p = 1
  98.          If $s+$p >= 2 Then
  99.             Send("{z}")                         ;Exiting Journal
  100.             Sleep(500)
  101. $b = PIxelGetColor(373,244)                     ;Color of the pokeball on the table
  102.             If $b = 0x903828 Then
  103.                ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Pokeball found! selecting Charmander.",0,0)
  104.             Send("{x}")                         ;Select Pokemon
  105.             Sleep(500)
  106.             Send("{x}")                         ;Get past message
  107.             Sleep(500)
  108.             Send("{x}")                         ;Confirm
  109.             Sleep(750)
  110.             Send("{z}")                         ;Get past message
  111.             Sleep(1000)
  112.             Send("{z}")                         ;No
  113.             Sleep(1500)
  114.             Send("{z}")                         ;Gary's message
  115.             Sleep(850)
  116.             ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Checking Charmander....",0,0)
  117.             Send("{s}")                         ;Open Menu
  118.             Sleep(400)
  119.             Send("{x}")                         ;Select "Pokemon"
  120.             Sleep(400)
  121.             Send("{x}")                         ;Select Charmander
  122.             Sleep(400)
  123.             Send("{x}")                         ;Summary
  124.             Sleep(400)
  125.          Elseif $b = 0x88C088 Then              ;Color of the table with no ball
  126.             Send("{z 10}")
  127.             ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Checking Charmander....",0,0)
  128.             Sleep(100)
  129.             Send("{s}")                         ;Open Menu
  130.             Sleep(500)
  131.             Send("{x}")                         ;Select "Pokemon"
  132.             Sleep(500)
  133.             Send("{x}")                         ;Select Charmander
  134.             Sleep(500)
  135.             Send("{x}")                         ;Summary
  136.             Sleep(500)
  137.          EndIf
  138.       EndIf
  139. $shiny = PixelGetColor(200,240)                 ;Regular charmander color
  140. $female = PixelGetColor(330, 130)               ;Female color
  141.          If $shiny = 0xD8A008 Then              ;Shiny Charmander
  142.             $count = $count + 1
  143.             ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Shiny Charmander Found, checking sex",0,0)
  144.                If $female = 0xF8B870 Then       ;Female Gender Color
  145.                   ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Shiny Female Charmander Found!",0,0)
  146.                   Sleep(500)
  147.                   Send("{z}")                   ;Exiting Summary
  148.                   Sleep(750)
  149.                   Send("{z}")                   ;Exiting Pokemon Menu
  150.                   Sleep(750)
  151.                   Send("{z}")                   ;Exiting Pokemon
  152.                   Sleep(750)
  153.                   Send("{DOWN}")                ;Moving to Save feature
  154.                   Sleep(250)
  155.                   Send("{DOWN}")                ;Moving to Save feature
  156.                   Sleep(250)
  157.                   Send("{DOWN}")                ;Moving to Save feature
  158.                   Sleep(250)
  159.                   Send("{x}")                   ;Selecting save
  160.                   Sleep(750)
  161.                   Send("{x}")                   ;Yes
  162.                   Sleep(750)
  163.                   Send("{x}")                   ;Yes
  164.                   Sleep(6500)                   ;Waiting while saving
  165.                   ;WinActivate("Notepad")
  166.                   ;WinWaitActive("Notepad")
  167.                   Send("{LShift DOWN}")
  168.                   Send("{F1}")
  169.                   Send("{LShift UP}")
  170.                   Sleep(1000)
  171.                   MsgBox(0,"Shiny Hunter Bot","Congrats Kyle you got yourself a Shiny Female Charmander after: " & $n & " resets and " & $count & " Male Shiny Charmanders.")
  172.                   ;Send("Congrats Kyle you got yourself a shiny Female Charmander!")
  173.                   ExitLoop
  174.                Else
  175.                   ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Shiny Male Charmander :(",0,0)
  176.                      If $count = 1 Then
  177.                         Send("{LShift DOWN}")
  178.                         Sleep(10)
  179.                         Send("{F2}")
  180.                         Sleep(10)
  181.                         Send("{LShift UP}")
  182.                         Sleep(250)
  183.                      ElseIf $count = 2 Then
  184.                         Send("{LShift DOWN}")
  185.                         Sleep(10)
  186.                         Send("{F3}")
  187.                         Sleep(10)
  188.                         Send("{LShift UP}")
  189.                         Sleep(250)
  190.                      ElseIf $count = 3 Then
  191.                         Send("{LShift DOWN}")
  192.                         Sleep(10)
  193.                         Send("{F4}")
  194.                         Sleep(10)
  195.                         Send("{LShift UP}")
  196.                         Sleep(250)
  197.                      ElseIf $count = 4 Then
  198.                         Send("{LShift DOWN}")
  199.                         Sleep(10)
  200.                         Send("{F5}")
  201.                         Sleep(10)
  202.                         Send("{LShift UP}")
  203.                         Sleep(250)
  204.                      Elseif $count = 5 Then
  205.                         Send("{LShift DOWN}")
  206.                         Sleep(10)
  207.                         Send("{F6}")
  208.                         Sleep(10)
  209.                         Send("{LShift UP}")
  210.                         Sleep(250)
  211.                      Elseif $count = 6 Then
  212.                         Send("{LShift DOWN}")
  213.                         Sleep(10)
  214.                         Send("{F7}")
  215.                         Sleep(10)
  216.                         Send("{LShift UP}")
  217.                         Sleep(250)
  218.                      Elseif $count = 7 Then
  219.                         Send("{LShift DOWN}")
  220.                         Sleep(10)
  221.                         Send("{F8}")
  222.                         Sleep(10)
  223.                         Send("{LShift UP}")
  224.                         Sleep(250)
  225.                      Elseif $count = 8 Then
  226.                         Send("{LShift DOWN}")
  227.                         Sleep(10)
  228.                         Send("{F9}")
  229.                         Sleep(10)
  230.                         Send("{LShift UP}")
  231.                         Sleep(250)
  232.                      Elseif $count = 9 Then
  233.                         Send("{LShift DOWN}")
  234.                         Sleep(10)
  235.                         Send("{F10}")
  236.                         Sleep(10)
  237.                         Send("{LShift UP}")
  238.                         Sleep(250)
  239.                      EndIf
  240.                   Sleep(500)
  241.                   $n = $n + 1
  242.                   ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Restarting",0,0)
  243.                   Send($d)
  244.                   Sleep(10)
  245.                   Send($u)
  246.                   Sleep(100)
  247.                   $s = 0
  248.                   $p = 0
  249.                   Sleep(100)
  250.                   ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Skipping Intro",0,0)
  251.                   Sleep(250)
  252.                   Send("{x}")
  253.                   Sleep(750)
  254.                EndIf
  255.             ElseIf $shiny = 0xD84848 Then           ;Not Shiny
  256.                   ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Not a shiny Charmander :(",0,0)
  257.                   Sleep(500)
  258.                   $n = $n + 1
  259.                   ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Restarting",0,0)
  260.                   Send($d)
  261.                   Sleep(10)
  262.                   Send($u)
  263.                   Sleep(100)
  264.                   $s = 0
  265.                   $p = 0
  266.                   Sleep(100)
  267.                   ToolTip("Resets: " & $n & " | Shiny Males: " & $count & " Skipping Intro",0,0)
  268.                   Sleep(250)
  269.                   Send("{x}")
  270.                   Sleep(750)
  271.                EndIf
  272.    WEnd
  273. EndFunc
  274.  
  275. Func Terminate()
  276.    Exit 0
  277. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement