Advertisement
djvj

fun

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