Advertisement
djvj

toys

Apr 4th, 2011
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 63.93 KB | None | 0 0
  1. Func Battle()
  2.         Do
  3.             CheckBattleHealthP1()
  4.             If $IsGroupHealer = "yes" Then
  5.                 CheckBattleHealthP2()
  6.                 CheckBattleHealthP3()
  7.             EndIf
  8.  
  9.  
  10.  
  11. Func CheckBattleHealthP1()
  12.     Select
  13.         Case $HealthPlace = 10
  14.             Select
  15.                 Case $PartySpot = 1
  16.                     If Hex(PixelGetColor($xHealthCheck_P1_10_trigger_1,$yHealthCheck_P1_10_trigger_1),6) = $HealthCheck_P1_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_2,$yHealthCheck_P1_10_trigger_2),6) = $HealthCheck_P1_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_3,$yHealthCheck_P1_10_trigger_3),6) = $HealthCheck_P1_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_4,$yHealthCheck_P1_10_trigger_4),6) = $HealthCheck_P1_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_5,$yHealthCheck_P1_10_trigger_5),6) = $HealthCheck_P1_10_trigger_color_5 Then
  17.                         Sleep (1000) ;double If because script keeps thinking low health after battle is over
  18.                         If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  19.                             ToolTip('Health is low, healing self (BATTLE)',0,25)
  20.                             StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  21.                             If $CanHeal = "yes" Then
  22.                                 Do
  23.                                     InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  24.                                     MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  25.                                     MouseDown("left")
  26.                                     MouseUp("left")
  27.                                     Sleep (500)
  28.                                     ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  29.                                     If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  30.                                         Return
  31.                                     Endif
  32.                                 Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  33.                 ;               Sleep (8000) ;need this because function will try to execute too soon
  34.                                 If Hex(PixelGetColor($xHealthCheck_P1_10_trigger_1,$yHealthCheck_P1_10_trigger_1),6) <> $HealthCheck_P1_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_2,$yHealthCheck_P1_10_trigger_2),6) <> $HealthCheck_P1_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_3,$yHealthCheck_P1_10_trigger_3),6) <> $HealthCheck_P1_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_4,$yHealthCheck_P1_10_trigger_4),6) <> $HealthCheck_P1_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_5,$yHealthCheck_P1_10_trigger_5),6) <> $HealthCheck_P1_10_trigger_color_5 Then
  35.                                     Return ;checking to see if we were healed above threshold before we continue with healing
  36.                                 EndIf
  37.                                 Sleep (500) ;extra sleep in case spell book lags coming up
  38.                                 MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  39.                                 MouseDown("left")
  40.                                 MouseUp("left")
  41.                                 Sleep (500)
  42.                                 If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  43.                                     Return
  44.                                 EndIf
  45.                                 MouseMove($xHealthCheck_Battle_P1,$yHealthCheck_Battle_P1) ;clicking self to cast heal upon
  46.                                 MouseDown("left")
  47.                                 MouseUp("left")
  48.                                 Sleep (4000) ;giving time for spell to cast
  49.                             Endif
  50.                         Endif
  51.                     Endif
  52.                 Case $PartySpot = 2
  53.                     If Hex(PixelGetColor($xHealthCheck_P2_10_trigger_1,$yHealthCheck_P2_10_trigger_1),6) = $HealthCheck_P2_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_2,$yHealthCheck_P2_10_trigger_2),6) = $HealthCheck_P2_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_3,$yHealthCheck_P2_10_trigger_3),6) = $HealthCheck_P2_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_4,$yHealthCheck_P2_10_trigger_4),6) = $HealthCheck_P2_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_5,$yHealthCheck_P2_10_trigger_5),6) = $HealthCheck_P2_10_trigger_color_5 Then
  54.                         Sleep (1000) ;double If because script keeps thinking low health after battle is over
  55.                         If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  56.                             ToolTip('Health is low, healing self (BATTLE)',0,25)
  57.                             StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  58.                             If $CanHeal = "yes" Then
  59.                                 Do
  60.                                     InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  61.                                     MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  62.                                     MouseDown("left")
  63.                                     MouseUp("left")
  64.                                     Sleep (500)
  65.                                     ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  66.                                     If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  67.                                         Return
  68.                                     Endif
  69.                                 Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  70.                 ;               Sleep (8000) ;need this because function will try to execute too soon
  71.                                 If Hex(PixelGetColor($xHealthCheck_P2_10_trigger_1,$yHealthCheck_P2_10_trigger_1),6) <> $HealthCheck_P2_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_2,$yHealthCheck_P2_10_trigger_2),6) <> $HealthCheck_P2_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_3,$yHealthCheck_P2_10_trigger_3),6) <> $HealthCheck_P2_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_4,$yHealthCheck_P2_10_trigger_4),6) <> $HealthCheck_P2_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_5,$yHealthCheck_P2_10_trigger_5),6) <> $HealthCheck_P2_10_trigger_color_5 Then
  72.                                     Return ;checking to see if we were healed above threshold before we continue with healing
  73.                                 EndIf
  74.                                 Sleep (500) ;extra sleep in case spell book lags coming up
  75.                                 MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  76.                                 MouseDown("left")
  77.                                 MouseUp("left")
  78.                                 Sleep (500)
  79.                                 If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  80.                                     Return
  81.                                 EndIf
  82.                                 MouseMove($xHealthCheck_Battle_P2,$yHealthCheck_Battle_P2) ;clicking self to cast heal upon
  83.                                 MouseDown("left")
  84.                                 MouseUp("left")
  85.                                 Sleep (4000) ;giving time for spell to cast
  86.                             Endif
  87.                         Endif
  88.                     Endif
  89.                 Case $PartySpot = 3
  90.                     If Hex(PixelGetColor($xHealthCheck_P3_10_trigger_1,$yHealthCheck_P3_10_trigger_1),6) = $HealthCheck_P3_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_2,$yHealthCheck_P3_10_trigger_2),6) = $HealthCheck_P3_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_3,$yHealthCheck_P3_10_trigger_3),6) = $HealthCheck_P3_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_4,$yHealthCheck_P3_10_trigger_4),6) = $HealthCheck_P3_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_5,$yHealthCheck_P3_10_trigger_5),6) = $HealthCheck_P3_10_trigger_color_5 Then
  91.                         Sleep (1000) ;double If because script keeps thinking low health after battle is over
  92.                         If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  93.                             ToolTip('Health is low, healing self (BATTLE)',0,25)
  94.                             StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  95.                             If $CanHeal = "yes" Then
  96.                                 Do
  97.                                     InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  98.                                     MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  99.                                     MouseDown("left")
  100.                                     MouseUp("left")
  101.                                     Sleep (500)
  102.                                     ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  103.                                     If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  104.                                         Return
  105.                                     Endif
  106.                                 Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  107.                 ;               Sleep (8000) ;need this because function will try to execute too soon
  108.                                 If Hex(PixelGetColor($xHealthCheck_P3_10_trigger_1,$yHealthCheck_P3_10_trigger_1),6) <> $HealthCheck_P3_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_2,$yHealthCheck_P3_10_trigger_2),6) <> $HealthCheck_P3_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_3,$yHealthCheck_P3_10_trigger_3),6) <> $HealthCheck_P3_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_4,$yHealthCheck_P3_10_trigger_4),6) <> $HealthCheck_P3_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_5,$yHealthCheck_P3_10_trigger_5),6) <> $HealthCheck_P3_10_trigger_color_5 Then
  109.                                     Return ;checking to see if we were healed above threshold before we continue with healing
  110.                                 EndIf
  111.                                 Sleep (500) ;extra sleep in case spell book lags coming up
  112.                                 MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  113.                                 MouseDown("left")
  114.                                 MouseUp("left")
  115.                                 Sleep (500)
  116.                                 If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  117.                                     Return
  118.                                 EndIf
  119.                                 MouseMove($xHealthCheck_Battle_P3,$yHealthCheck_Battle_P3) ;clicking self to cast heal upon
  120.                                 MouseDown("left")
  121.                                 MouseUp("left")
  122.                                 Sleep (4000) ;giving time for spell to cast
  123.                             Endif
  124.                         Endif
  125.                     Endif
  126.             EndSelect
  127.                    
  128.         Case $HealthPlace = 100
  129.             Select
  130.                 Case $PartySpot = 1
  131.                     If Hex(PixelGetColor($xHealthCheck_P1_100_trigger_1,$yHealthCheck_P1_100_trigger_1),6) = $HealthCheck_P1_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_2,$yHealthCheck_P1_100_trigger_2),6) = $HealthCheck_P1_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_3,$yHealthCheck_P1_100_trigger_3),6) = $HealthCheck_P1_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_4,$yHealthCheck_P1_100_trigger_4),6) = $HealthCheck_P1_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_5,$yHealthCheck_P1_100_trigger_5),6) = $HealthCheck_P1_100_trigger_color_5 Then
  132.                         Sleep (1000) ;double If because script keeps thinking low health after battle is over
  133.                         If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  134.                             ToolTip('Health is low, healing self (BATTLE)',0,25)
  135.                             StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  136.                             If $CanHeal = "yes" Then
  137.                                 Do
  138.                                     InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  139.                                     MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  140.                                     MouseDown("left")
  141.                                     MouseUp("left")
  142.                                     Sleep (500)
  143.                                     ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  144.                                     If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  145.                                         Return
  146.                                     Endif
  147.                                 Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  148.                 ;               Sleep (8000) ;need this because function will try to execute too soon
  149.                                 If Hex(PixelGetColor($xHealthCheck_P1_100_trigger_1,$yHealthCheck_P1_100_trigger_1),6) <> $HealthCheck_P1_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_2,$yHealthCheck_P1_100_trigger_2),6) <> $HealthCheck_P1_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_3,$yHealthCheck_P1_100_trigger_3),6) <> $HealthCheck_P1_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_4,$yHealthCheck_P1_100_trigger_4),6) <> $HealthCheck_P1_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_5,$yHealthCheck_P1_100_trigger_5),6) <> $HealthCheck_P1_100_trigger_color_5 Then
  150.                                     Return ;checking to see if we were healed above threshold before we continue with healing
  151.                                 EndIf
  152.                                 Sleep (500) ;extra sleep in case spell book lags coming up
  153.                                 MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  154.                                 MouseDown("left")
  155.                                 MouseUp("left")
  156.                                 Sleep (500)
  157.                                 If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  158.                                     Return
  159.                                 EndIf
  160.                                 MouseMove($xHealthCheck_Battle_P1,$yHealthCheck_Battle_P1) ;clicking self to cast heal upon
  161.                                 MouseDown("left")
  162.                                 MouseUp("left")
  163.                                 Sleep (4000) ;giving time for spell to cast
  164.                             Endif
  165.                         Endif
  166.                     Endif
  167.                 Case $PartySpot = 2
  168.                     If Hex(PixelGetColor($xHealthCheck_P2_100_trigger_1,$yHealthCheck_P2_100_trigger_1),6) = $HealthCheck_P2_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_2,$yHealthCheck_P2_100_trigger_2),6) = $HealthCheck_P2_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_3,$yHealthCheck_P2_100_trigger_3),6) = $HealthCheck_P2_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_4,$yHealthCheck_P2_100_trigger_4),6) = $HealthCheck_P2_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_5,$yHealthCheck_P2_100_trigger_5),6) = $HealthCheck_P2_100_trigger_color_5 Then
  169.                         Sleep (1000) ;double If because script keeps thinking low health after battle is over
  170.                         If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  171.                             ToolTip('Health is low, healing self (BATTLE)',0,25)
  172.                             StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  173.                             If $CanHeal = "yes" Then
  174.                                 Do
  175.                                     InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  176.                                     MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  177.                                     MouseDown("left")
  178.                                     MouseUp("left")
  179.                                     Sleep (500)
  180.                                     ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  181.                                     If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  182.                                         Return
  183.                                     Endif
  184.                                 Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  185.                 ;               Sleep (8000) ;need this because function will try to execute too soon
  186.                                 If Hex(PixelGetColor($xHealthCheck_P2_100_trigger_1,$yHealthCheck_P2_100_trigger_1),6) <> $HealthCheck_P2_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_2,$yHealthCheck_P2_100_trigger_2),6) <> $HealthCheck_P2_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_3,$yHealthCheck_P2_100_trigger_3),6) <> $HealthCheck_P2_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_4,$yHealthCheck_P2_100_trigger_4),6) <> $HealthCheck_P2_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_5,$yHealthCheck_P2_100_trigger_5),6) <> $HealthCheck_P2_100_trigger_color_5 Then
  187.                                     Return ;checking to see if we were healed above threshold before we continue with healing
  188.                                 EndIf
  189.                                 Sleep (500) ;extra sleep in case spell book lags coming up
  190.                                 MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  191.                                 MouseDown("left")
  192.                                 MouseUp("left")
  193.                                 Sleep (500)
  194.                                 If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  195.                                     Return
  196.                                 EndIf
  197.                                 MouseMove($xHealthCheck_Battle_P2,$yHealthCheck_Battle_P2) ;clicking self to cast heal upon
  198.                                 MouseDown("left")
  199.                                 MouseUp("left")
  200.                                 Sleep (4000) ;giving time for spell to cast
  201.                             Endif
  202.                         Endif
  203.                     Endif
  204.                 Case $PartySpot = 3
  205.                     If Hex(PixelGetColor($xHealthCheck_P3_100_trigger_1,$yHealthCheck_P3_100_trigger_1),6) = $HealthCheck_P3_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_2,$yHealthCheck_P3_100_trigger_2),6) = $HealthCheck_P3_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_3,$yHealthCheck_P3_100_trigger_3),6) = $HealthCheck_P3_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_4,$yHealthCheck_P3_100_trigger_4),6) = $HealthCheck_P3_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_5,$yHealthCheck_P3_100_trigger_5),6) = $HealthCheck_P3_100_trigger_color_5 Then
  206.                         Sleep (1000) ;double If because script keeps thinking low health after battle is over
  207.                         If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  208.                             ToolTip('Health is low, healing self (BATTLE)',0,25)
  209.                             StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  210.                             If $CanHeal = "yes" Then
  211.                                 Do
  212.                                     InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  213.                                     MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  214.                                     MouseDown("left")
  215.                                     MouseUp("left")
  216.                                     Sleep (500)
  217.                                     ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  218.                                     If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  219.                                         Return
  220.                                     Endif
  221.                                 Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  222.                 ;               Sleep (8000) ;need this because function will try to execute too soon
  223.                                 If Hex(PixelGetColor($xHealthCheck_P3_100_trigger_1,$yHealthCheck_P3_100_trigger_1),6) <> $HealthCheck_P3_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_2,$yHealthCheck_P3_100_trigger_2),6) <> $HealthCheck_P3_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_3,$yHealthCheck_P3_100_trigger_3),6) <> $HealthCheck_P3_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_4,$yHealthCheck_P3_100_trigger_4),6) <> $HealthCheck_P3_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_5,$yHealthCheck_P3_100_trigger_5),6) <> $HealthCheck_P3_100_trigger_color_5 Then
  224.                                     Return ;checking to see if we were healed above threshold before we continue with healing
  225.                                 EndIf
  226.                                 Sleep (500) ;extra sleep in case spell book lags coming up
  227.                                 MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  228.                                 MouseDown("left")
  229.                                 MouseUp("left")
  230.                                 Sleep (500)
  231.                                 If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  232.                                     Return
  233.                                 EndIf
  234.                                 MouseMove($xHealthCheck_Battle_P3,$yHealthCheck_Battle_P3) ;clicking self to cast heal upon
  235.                                 MouseDown("left")
  236.                                 MouseUp("left")
  237.                                 Sleep (4000) ;giving time for spell to cast
  238.                             Endif
  239.                         Endif
  240.                     Endif
  241.             EndSelect
  242.     EndSelect
  243. EndFunc
  244.  
  245.  
  246. Func CheckBattleHealthP2()
  247.     If $IsGroupHealer = "yes" Then
  248.         Select
  249.             Case $HealthPlace = 10
  250.                 Select
  251.                     Case $PartySpot_P2 = 1
  252.                         If Hex(PixelGetColor($xHealthCheck_P1_10_trigger_1,$yHealthCheck_P1_10_trigger_1),6) = $HealthCheck_P1_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_2,$yHealthCheck_P1_10_trigger_2),6) = $HealthCheck_P1_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_3,$yHealthCheck_P1_10_trigger_3),6) = $HealthCheck_P1_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_4,$yHealthCheck_P1_10_trigger_4),6) = $HealthCheck_P1_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_5,$yHealthCheck_P1_10_trigger_5),6) = $HealthCheck_P1_10_trigger_color_5 Then
  253.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  254.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  255.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  256.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  257.                                 If $CanHeal = "yes" Then
  258.                                     Do
  259.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  260.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  261.                                         MouseDown("left")
  262.                                         MouseUp("left")
  263.                                         Sleep (500)
  264.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  265.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  266.                                             Return
  267.                                         Endif
  268.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  269.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  270.                                     If Hex(PixelGetColor($xHealthCheck_P1_10_trigger_1,$yHealthCheck_P1_10_trigger_1),6) <> $HealthCheck_P1_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_2,$yHealthCheck_P1_10_trigger_2),6) <> $HealthCheck_P1_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_3,$yHealthCheck_P1_10_trigger_3),6) <> $HealthCheck_P1_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_4,$yHealthCheck_P1_10_trigger_4),6) <> $HealthCheck_P1_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_5,$yHealthCheck_P1_10_trigger_5),6) <> $HealthCheck_P1_10_trigger_color_5 Then
  271.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  272.                                     EndIf
  273.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  274.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  275.                                     MouseDown("left")
  276.                                     MouseUp("left")
  277.                                     Sleep (500)
  278.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  279.                                         Return
  280.                                     EndIf
  281.                                     MouseMove($xHealthCheck_Battle_P1,$yHealthCheck_Battle_P1) ;clicking self to cast heal upon
  282.                                     MouseDown("left")
  283.                                     MouseUp("left")
  284.                                     Sleep (4000) ;giving time for spell to cast
  285.                                 Endif
  286.                             Endif
  287.                         Endif
  288.                     Case $PartySpot_P2 = 2
  289.                         If Hex(PixelGetColor($xHealthCheck_P2_10_trigger_1,$yHealthCheck_P2_10_trigger_1),6) = $HealthCheck_P2_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_2,$yHealthCheck_P2_10_trigger_2),6) = $HealthCheck_P2_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_3,$yHealthCheck_P2_10_trigger_3),6) = $HealthCheck_P2_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_4,$yHealthCheck_P2_10_trigger_4),6) = $HealthCheck_P2_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_5,$yHealthCheck_P2_10_trigger_5),6) = $HealthCheck_P2_10_trigger_color_5 Then
  290.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  291.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  292.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  293.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  294.                                 If $CanHeal = "yes" Then
  295.                                     Do
  296.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  297.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  298.                                         MouseDown("left")
  299.                                         MouseUp("left")
  300.                                         Sleep (500)
  301.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  302.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  303.                                             Return
  304.                                         Endif
  305.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  306.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  307.                                     If Hex(PixelGetColor($xHealthCheck_P2_10_trigger_1,$yHealthCheck_P2_10_trigger_1),6) <> $HealthCheck_P2_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_2,$yHealthCheck_P2_10_trigger_2),6) <> $HealthCheck_P2_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_3,$yHealthCheck_P2_10_trigger_3),6) <> $HealthCheck_P2_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_4,$yHealthCheck_P2_10_trigger_4),6) <> $HealthCheck_P2_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_5,$yHealthCheck_P2_10_trigger_5),6) <> $HealthCheck_P2_10_trigger_color_5 Then
  308.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  309.                                     EndIf
  310.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  311.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  312.                                     MouseDown("left")
  313.                                     MouseUp("left")
  314.                                     Sleep (500)
  315.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  316.                                         Return
  317.                                     EndIf
  318.                                     MouseMove($xHealthCheck_Battle_P2,$yHealthCheck_Battle_P2) ;clicking self to cast heal upon
  319.                                     MouseDown("left")
  320.                                     MouseUp("left")
  321.                                     Sleep (4000) ;giving time for spell to cast
  322.                                 Endif
  323.                             Endif
  324.                         Endif
  325.                     Case $PartySpot_P2 = 3
  326.                         If Hex(PixelGetColor($xHealthCheck_P3_10_trigger_1,$yHealthCheck_P3_10_trigger_1),6) = $HealthCheck_P3_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_2,$yHealthCheck_P3_10_trigger_2),6) = $HealthCheck_P3_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_3,$yHealthCheck_P3_10_trigger_3),6) = $HealthCheck_P3_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_4,$yHealthCheck_P3_10_trigger_4),6) = $HealthCheck_P3_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_5,$yHealthCheck_P3_10_trigger_5),6) = $HealthCheck_P3_10_trigger_color_5 Then
  327.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  328.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  329.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  330.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  331.                                 If $CanHeal = "yes" Then
  332.                                     Do
  333.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  334.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  335.                                         MouseDown("left")
  336.                                         MouseUp("left")
  337.                                         Sleep (500)
  338.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  339.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  340.                                             Return
  341.                                         Endif
  342.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  343.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  344.                                     If Hex(PixelGetColor($xHealthCheck_P3_10_trigger_1,$yHealthCheck_P3_10_trigger_1),6) <> $HealthCheck_P3_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_2,$yHealthCheck_P3_10_trigger_2),6) <> $HealthCheck_P3_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_3,$yHealthCheck_P3_10_trigger_3),6) <> $HealthCheck_P3_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_4,$yHealthCheck_P3_10_trigger_4),6) <> $HealthCheck_P3_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_5,$yHealthCheck_P3_10_trigger_5),6) <> $HealthCheck_P3_10_trigger_color_5 Then
  345.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  346.                                     EndIf
  347.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  348.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  349.                                     MouseDown("left")
  350.                                     MouseUp("left")
  351.                                     Sleep (500)
  352.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  353.                                         Return
  354.                                     EndIf
  355.                                     MouseMove($xHealthCheck_Battle_P3,$yHealthCheck_Battle_P3) ;clicking self to cast heal upon
  356.                                     MouseDown("left")
  357.                                     MouseUp("left")
  358.                                     Sleep (4000) ;giving time for spell to cast
  359.                                 Endif
  360.                             Endif
  361.                         Endif
  362.                 EndSelect
  363.                        
  364.             Case $HealthPlace = 100
  365.                 Select
  366.                     Case $PartySpot_P2 = 1
  367.                         If Hex(PixelGetColor($xHealthCheck_P1_100_trigger_1,$yHealthCheck_P1_100_trigger_1),6) = $HealthCheck_P1_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_2,$yHealthCheck_P1_100_trigger_2),6) = $HealthCheck_P1_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_3,$yHealthCheck_P1_100_trigger_3),6) = $HealthCheck_P1_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_4,$yHealthCheck_P1_100_trigger_4),6) = $HealthCheck_P1_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_5,$yHealthCheck_P1_100_trigger_5),6) = $HealthCheck_P1_100_trigger_color_5 Then
  368.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  369.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  370.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  371.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  372.                                 If $CanHeal = "yes" Then
  373.                                     Do
  374.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  375.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  376.                                         MouseDown("left")
  377.                                         MouseUp("left")
  378.                                         Sleep (500)
  379.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  380.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  381.                                             Return
  382.                                         Endif
  383.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  384.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  385.                                     If Hex(PixelGetColor($xHealthCheck_P1_100_trigger_1,$yHealthCheck_P1_100_trigger_1),6) <> $HealthCheck_P1_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_2,$yHealthCheck_P1_100_trigger_2),6) <> $HealthCheck_P1_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_3,$yHealthCheck_P1_100_trigger_3),6) <> $HealthCheck_P1_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_4,$yHealthCheck_P1_100_trigger_4),6) <> $HealthCheck_P1_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_5,$yHealthCheck_P1_100_trigger_5),6) <> $HealthCheck_P1_100_trigger_color_5 Then
  386.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  387.                                     EndIf
  388.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  389.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  390.                                     MouseDown("left")
  391.                                     MouseUp("left")
  392.                                     Sleep (500)
  393.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  394.                                         Return
  395.                                     EndIf
  396.                                     MouseMove($xHealthCheck_Battle_P1,$yHealthCheck_Battle_P1) ;clicking self to cast heal upon
  397.                                     MouseDown("left")
  398.                                     MouseUp("left")
  399.                                     Sleep (4000) ;giving time for spell to cast
  400.                                 Endif
  401.                             Endif
  402.                         Endif
  403.                     Case $PartySpot_P2 = 2
  404.                         If Hex(PixelGetColor($xHealthCheck_P2_100_trigger_1,$yHealthCheck_P2_100_trigger_1),6) = $HealthCheck_P2_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_2,$yHealthCheck_P2_100_trigger_2),6) = $HealthCheck_P2_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_3,$yHealthCheck_P2_100_trigger_3),6) = $HealthCheck_P2_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_4,$yHealthCheck_P2_100_trigger_4),6) = $HealthCheck_P2_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_5,$yHealthCheck_P2_100_trigger_5),6) = $HealthCheck_P2_100_trigger_color_5 Then
  405.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  406.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  407.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  408.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  409.                                 If $CanHeal = "yes" Then
  410.                                     Do
  411.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  412.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  413.                                         MouseDown("left")
  414.                                         MouseUp("left")
  415.                                         Sleep (500)
  416.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  417.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  418.                                             Return
  419.                                         Endif
  420.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  421.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  422.                                     If Hex(PixelGetColor($xHealthCheck_P2_100_trigger_1,$yHealthCheck_P2_100_trigger_1),6) <> $HealthCheck_P2_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_2,$yHealthCheck_P2_100_trigger_2),6) <> $HealthCheck_P2_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_3,$yHealthCheck_P2_100_trigger_3),6) <> $HealthCheck_P2_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_4,$yHealthCheck_P2_100_trigger_4),6) <> $HealthCheck_P2_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_5,$yHealthCheck_P2_100_trigger_5),6) <> $HealthCheck_P2_100_trigger_color_5 Then
  423.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  424.                                     EndIf
  425.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  426.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  427.                                     MouseDown("left")
  428.                                     MouseUp("left")
  429.                                     Sleep (500)
  430.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  431.                                         Return
  432.                                     EndIf
  433.                                     MouseMove($xHealthCheck_Battle_P2,$yHealthCheck_Battle_P2) ;clicking self to cast heal upon
  434.                                     MouseDown("left")
  435.                                     MouseUp("left")
  436.                                     Sleep (4000) ;giving time for spell to cast
  437.                                 Endif
  438.                             Endif
  439.                         Endif
  440.                     Case $PartySpot_P2 = 3
  441.                         If Hex(PixelGetColor($xHealthCheck_P3_100_trigger_1,$yHealthCheck_P3_100_trigger_1),6) = $HealthCheck_P3_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_2,$yHealthCheck_P3_100_trigger_2),6) = $HealthCheck_P3_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_3,$yHealthCheck_P3_100_trigger_3),6) = $HealthCheck_P3_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_4,$yHealthCheck_P3_100_trigger_4),6) = $HealthCheck_P3_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_5,$yHealthCheck_P3_100_trigger_5),6) = $HealthCheck_P3_100_trigger_color_5 Then
  442.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  443.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  444.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  445.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  446.                                 If $CanHeal = "yes" Then
  447.                                     Do
  448.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  449.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  450.                                         MouseDown("left")
  451.                                         MouseUp("left")
  452.                                         Sleep (500)
  453.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  454.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  455.                                             Return
  456.                                         Endif
  457.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  458.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  459.                                     If Hex(PixelGetColor($xHealthCheck_P3_100_trigger_1,$yHealthCheck_P3_100_trigger_1),6) <> $HealthCheck_P3_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_2,$yHealthCheck_P3_100_trigger_2),6) <> $HealthCheck_P3_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_3,$yHealthCheck_P3_100_trigger_3),6) <> $HealthCheck_P3_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_4,$yHealthCheck_P3_100_trigger_4),6) <> $HealthCheck_P3_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_5,$yHealthCheck_P3_100_trigger_5),6) <> $HealthCheck_P3_100_trigger_color_5 Then
  460.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  461.                                     EndIf
  462.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  463.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  464.                                     MouseDown("left")
  465.                                     MouseUp("left")
  466.                                     Sleep (500)
  467.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  468.                                         Return
  469.                                     EndIf
  470.                                     MouseMove($xHealthCheck_Battle_P3,$yHealthCheck_Battle_P3) ;clicking self to cast heal upon
  471.                                     MouseDown("left")
  472.                                     MouseUp("left")
  473.                                     Sleep (4000) ;giving time for spell to cast
  474.                                 Endif
  475.                             Endif
  476.                         Endif
  477.                 EndSelect
  478.         EndSelect
  479.     Endif
  480. EndFunc
  481.  
  482.  
  483. Func CheckBattleHealthP3()
  484.     If $IsGroupHealer = "yes" Then
  485.         Select
  486.             Case $HealthPlace = 10
  487.                 Select
  488.                     Case $PartySpot_P3 = 1
  489.                         If Hex(PixelGetColor($xHealthCheck_P1_10_trigger_1,$yHealthCheck_P1_10_trigger_1),6) = $HealthCheck_P1_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_2,$yHealthCheck_P1_10_trigger_2),6) = $HealthCheck_P1_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_3,$yHealthCheck_P1_10_trigger_3),6) = $HealthCheck_P1_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_4,$yHealthCheck_P1_10_trigger_4),6) = $HealthCheck_P1_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_5,$yHealthCheck_P1_10_trigger_5),6) = $HealthCheck_P1_10_trigger_color_5 Then
  490.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  491.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  492.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  493.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  494.                                 If $CanHeal = "yes" Then
  495.                                     Do
  496.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  497.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  498.                                         MouseDown("left")
  499.                                         MouseUp("left")
  500.                                         Sleep (500)
  501.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  502.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  503.                                             Return
  504.                                         Endif
  505.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  506.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  507.                                     If Hex(PixelGetColor($xHealthCheck_P1_10_trigger_1,$yHealthCheck_P1_10_trigger_1),6) <> $HealthCheck_P1_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_2,$yHealthCheck_P1_10_trigger_2),6) <> $HealthCheck_P1_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_3,$yHealthCheck_P1_10_trigger_3),6) <> $HealthCheck_P1_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_4,$yHealthCheck_P1_10_trigger_4),6) <> $HealthCheck_P1_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_10_trigger_5,$yHealthCheck_P1_10_trigger_5),6) <> $HealthCheck_P1_10_trigger_color_5 Then
  508.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  509.                                     EndIf
  510.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  511.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  512.                                     MouseDown("left")
  513.                                     MouseUp("left")
  514.                                     Sleep (500)
  515.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  516.                                         Return
  517.                                     EndIf
  518.                                     MouseMove($xHealthCheck_Battle_P1,$yHealthCheck_Battle_P1) ;clicking self to cast heal upon
  519.                                     MouseDown("left")
  520.                                     MouseUp("left")
  521.                                     Sleep (4000) ;giving time for spell to cast
  522.                                 Endif
  523.                             Endif
  524.                         Endif
  525.                     Case $PartySpot_P3 = 2
  526.                         If Hex(PixelGetColor($xHealthCheck_P2_10_trigger_1,$yHealthCheck_P2_10_trigger_1),6) = $HealthCheck_P2_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_2,$yHealthCheck_P2_10_trigger_2),6) = $HealthCheck_P2_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_3,$yHealthCheck_P2_10_trigger_3),6) = $HealthCheck_P2_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_4,$yHealthCheck_P2_10_trigger_4),6) = $HealthCheck_P2_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_5,$yHealthCheck_P2_10_trigger_5),6) = $HealthCheck_P2_10_trigger_color_5 Then
  527.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  528.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  529.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  530.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  531.                                 If $CanHeal = "yes" Then
  532.                                     Do
  533.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  534.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  535.                                         MouseDown("left")
  536.                                         MouseUp("left")
  537.                                         Sleep (500)
  538.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  539.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  540.                                             Return
  541.                                         Endif
  542.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  543.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  544.                                     If Hex(PixelGetColor($xHealthCheck_P2_10_trigger_1,$yHealthCheck_P2_10_trigger_1),6) <> $HealthCheck_P2_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_2,$yHealthCheck_P2_10_trigger_2),6) <> $HealthCheck_P2_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_3,$yHealthCheck_P2_10_trigger_3),6) <> $HealthCheck_P2_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_4,$yHealthCheck_P2_10_trigger_4),6) <> $HealthCheck_P2_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_10_trigger_5,$yHealthCheck_P2_10_trigger_5),6) <> $HealthCheck_P2_10_trigger_color_5 Then
  545.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  546.                                     EndIf
  547.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  548.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  549.                                     MouseDown("left")
  550.                                     MouseUp("left")
  551.                                     Sleep (500)
  552.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  553.                                         Return
  554.                                     EndIf
  555.                                     MouseMove($xHealthCheck_Battle_P2,$yHealthCheck_Battle_P2) ;clicking self to cast heal upon
  556.                                     MouseDown("left")
  557.                                     MouseUp("left")
  558.                                     Sleep (4000) ;giving time for spell to cast
  559.                                 Endif
  560.                             Endif
  561.                         Endif
  562.                     Case $PartySpot_P3 = 3
  563.                         If Hex(PixelGetColor($xHealthCheck_P3_10_trigger_1,$yHealthCheck_P3_10_trigger_1),6) = $HealthCheck_P3_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_2,$yHealthCheck_P3_10_trigger_2),6) = $HealthCheck_P3_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_3,$yHealthCheck_P3_10_trigger_3),6) = $HealthCheck_P3_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_4,$yHealthCheck_P3_10_trigger_4),6) = $HealthCheck_P3_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_5,$yHealthCheck_P3_10_trigger_5),6) = $HealthCheck_P3_10_trigger_color_5 Then
  564.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  565.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  566.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  567.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  568.                                 If $CanHeal = "yes" Then
  569.                                     Do
  570.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  571.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  572.                                         MouseDown("left")
  573.                                         MouseUp("left")
  574.                                         Sleep (500)
  575.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  576.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  577.                                             Return
  578.                                         Endif
  579.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  580.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  581.                                     If Hex(PixelGetColor($xHealthCheck_P3_10_trigger_1,$yHealthCheck_P3_10_trigger_1),6) <> $HealthCheck_P3_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_2,$yHealthCheck_P3_10_trigger_2),6) <> $HealthCheck_P3_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_3,$yHealthCheck_P3_10_trigger_3),6) <> $HealthCheck_P3_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_4,$yHealthCheck_P3_10_trigger_4),6) <> $HealthCheck_P3_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_10_trigger_5,$yHealthCheck_P3_10_trigger_5),6) <> $HealthCheck_P3_10_trigger_color_5 Then
  582.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  583.                                     EndIf
  584.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  585.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  586.                                     MouseDown("left")
  587.                                     MouseUp("left")
  588.                                     Sleep (500)
  589.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  590.                                         Return
  591.                                     EndIf
  592.                                     MouseMove($xHealthCheck_Battle_P3,$yHealthCheck_Battle_P3) ;clicking self to cast heal upon
  593.                                     MouseDown("left")
  594.                                     MouseUp("left")
  595.                                     Sleep (4000) ;giving time for spell to cast
  596.                                 Endif
  597.                             Endif
  598.                         Endif
  599.                 EndSelect
  600.                        
  601.             Case $HealthPlace = 100
  602.                 Select
  603.                     Case $PartySpot_P3 = 1
  604.                         If Hex(PixelGetColor($xHealthCheck_P1_100_trigger_1,$yHealthCheck_P1_100_trigger_1),6) = $HealthCheck_P1_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_2,$yHealthCheck_P1_100_trigger_2),6) = $HealthCheck_P1_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_3,$yHealthCheck_P1_100_trigger_3),6) = $HealthCheck_P1_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_4,$yHealthCheck_P1_100_trigger_4),6) = $HealthCheck_P1_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_5,$yHealthCheck_P1_100_trigger_5),6) = $HealthCheck_P1_100_trigger_color_5 Then
  605.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  606.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  607.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  608.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  609.                                 If $CanHeal = "yes" Then
  610.                                     Do
  611.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  612.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  613.                                         MouseDown("left")
  614.                                         MouseUp("left")
  615.                                         Sleep (500)
  616.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  617.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  618.                                             Return
  619.                                         Endif
  620.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  621.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  622.                                     If Hex(PixelGetColor($xHealthCheck_P1_100_trigger_1,$yHealthCheck_P1_100_trigger_1),6) <> $HealthCheck_P1_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_2,$yHealthCheck_P1_100_trigger_2),6) <> $HealthCheck_P1_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_3,$yHealthCheck_P1_100_trigger_3),6) <> $HealthCheck_P1_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_4,$yHealthCheck_P1_100_trigger_4),6) <> $HealthCheck_P1_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P1_100_trigger_5,$yHealthCheck_P1_100_trigger_5),6) <> $HealthCheck_P1_100_trigger_color_5 Then
  623.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  624.                                     EndIf
  625.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  626.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  627.                                     MouseDown("left")
  628.                                     MouseUp("left")
  629.                                     Sleep (500)
  630.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  631.                                         Return
  632.                                     EndIf
  633.                                     MouseMove($xHealthCheck_Battle_P1,$yHealthCheck_Battle_P1) ;clicking self to cast heal upon
  634.                                     MouseDown("left")
  635.                                     MouseUp("left")
  636.                                     Sleep (4000) ;giving time for spell to cast
  637.                                 Endif
  638.                             Endif
  639.                         Endif
  640.                     Case $PartySpot_P3 = 2
  641.                         If Hex(PixelGetColor($xHealthCheck_P2_100_trigger_1,$yHealthCheck_P2_100_trigger_1),6) = $HealthCheck_P2_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_2,$yHealthCheck_P2_100_trigger_2),6) = $HealthCheck_P2_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_3,$yHealthCheck_P2_100_trigger_3),6) = $HealthCheck_P2_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_4,$yHealthCheck_P2_100_trigger_4),6) = $HealthCheck_P2_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_5,$yHealthCheck_P2_100_trigger_5),6) = $HealthCheck_P2_100_trigger_color_5 Then
  642.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  643.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  644.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  645.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  646.                                 If $CanHeal = "yes" Then
  647.                                     Do
  648.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  649.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  650.                                         MouseDown("left")
  651.                                         MouseUp("left")
  652.                                         Sleep (500)
  653.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  654.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  655.                                             Return
  656.                                         Endif
  657.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  658.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  659.                                     If Hex(PixelGetColor($xHealthCheck_P2_100_trigger_1,$yHealthCheck_P2_100_trigger_1),6) <> $HealthCheck_P2_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_2,$yHealthCheck_P2_100_trigger_2),6) <> $HealthCheck_P2_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_3,$yHealthCheck_P2_100_trigger_3),6) <> $HealthCheck_P2_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_4,$yHealthCheck_P2_100_trigger_4),6) <> $HealthCheck_P2_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P2_100_trigger_5,$yHealthCheck_P2_100_trigger_5),6) <> $HealthCheck_P2_100_trigger_color_5 Then
  660.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  661.                                     EndIf
  662.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  663.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  664.                                     MouseDown("left")
  665.                                     MouseUp("left")
  666.                                     Sleep (500)
  667.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  668.                                         Return
  669.                                     EndIf
  670.                                     MouseMove($xHealthCheck_Battle_P2,$yHealthCheck_Battle_P2) ;clicking self to cast heal upon
  671.                                     MouseDown("left")
  672.                                     MouseUp("left")
  673.                                     Sleep (4000) ;giving time for spell to cast
  674.                                 Endif
  675.                             Endif
  676.                         Endif
  677.                     Case $PartySpot_P3 = 3
  678.                         If Hex(PixelGetColor($xHealthCheck_P3_100_trigger_1,$yHealthCheck_P3_100_trigger_1),6) = $HealthCheck_P3_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_2,$yHealthCheck_P3_100_trigger_2),6) = $HealthCheck_P3_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_3,$yHealthCheck_P3_100_trigger_3),6) = $HealthCheck_P3_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_4,$yHealthCheck_P3_100_trigger_4),6) = $HealthCheck_P3_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_5,$yHealthCheck_P3_100_trigger_5),6) = $HealthCheck_P3_100_trigger_color_5 Then
  679.                             Sleep (1000) ;double If because script keeps thinking low health after battle is over
  680.                             If Hex(PixelGetColor($xHealthCheck_window_1,$yHealthCheck_window_1),6) = $HealthCheck_window_color_1 and Hex(PixelGetColor($xHealthCheck_window_2,$yHealthCheck_window_2),6) = $HealthCheck_window_color_2 and Hex(PixelGetColor($xHealthCheck_window_3,$yHealthCheck_window_3),6) = $HealthCheck_window_color_3 Then
  681.                                 ToolTip('Health is low, healing self (BATTLE)',0,25)
  682.                                 StopWhenLowHealth() ; health is low, if we need to stop the script because we can't heal, now is the time
  683.                                 If $CanHeal = "yes" Then
  684.                                     Do
  685.                                         InventoryFull() ; Sometimes we get stuck after battle waiting on a full inventory
  686.                                         MouseMove($xAbility,$yAbility) ;click Ability to bring up spell book
  687.                                         MouseDown("left")
  688.                                         MouseUp("left")
  689.                                         Sleep (500)
  690.                                         ;bug check to see if battle ended, this prevents getting stuck in this loop if we are hunting
  691.                                         If Hex(PixelGetColor($xBattle_end_check,$yBattle_end_check),6) = $Battle_end_check_color Then ;checking for grey in icon at bottom of screen to see if battle is over
  692.                                             Return
  693.                                         Endif
  694.                                     Until Hex(PixelGetColor($xAbility,$yAbility),6) = $Ability_selected_color ;Ability is now selected and pink
  695.                     ;               Sleep (8000) ;need this because function will try to execute too soon
  696.                                     If Hex(PixelGetColor($xHealthCheck_P3_100_trigger_1,$yHealthCheck_P3_100_trigger_1),6) <> $HealthCheck_P3_100_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_2,$yHealthCheck_P3_100_trigger_2),6) <> $HealthCheck_P3_100_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_3,$yHealthCheck_P3_100_trigger_3),6) <> $HealthCheck_P3_100_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_4,$yHealthCheck_P3_100_trigger_4),6) <> $HealthCheck_P3_100_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_P3_100_trigger_5,$yHealthCheck_P3_100_trigger_5),6) <> $HealthCheck_P3_100_trigger_color_5 Then
  697.                                         Return ;checking to see if we were healed above threshold before we continue with healing
  698.                                     EndIf
  699.                                     Sleep (500) ;extra sleep in case spell book lags coming up
  700.                                     MouseMove($BattleSpellSlot[$HealSlotBattle-1][0],$BattleSpellSlot[$HealSlotBattle-1][1]) ; calling array to cast spell
  701.                                     MouseDown("left")
  702.                                     MouseUp("left")
  703.                                     Sleep (500)
  704.                                     If Hex(PixelGetColor($xBattle_start_1,$yBattle_start_1),6) <> $Battle_start_color_1 and Hex(PixelGetColor($xBattle_start_2,$yBattle_start_2),6) <> $Battle_start_color_2 Then ;this breaks out in case battle ended
  705.                                         Return
  706.                                     EndIf
  707.                                     MouseMove($xHealthCheck_Battle_P3,$yHealthCheck_Battle_P3) ;clicking self to cast heal upon
  708.                                     MouseDown("left")
  709.                                     MouseUp("left")
  710.                                     Sleep (4000) ;giving time for spell to cast
  711.                                 Endif
  712.                             Endif
  713.                         Endif
  714.                 EndSelect
  715.         EndSelect
  716.     Endif
  717. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement