Advertisement
djvj

baby

Apr 7th, 2011
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 8.92 KB | None | 0 0
  1. Global $HealthCheck_Battle_10_trigger[15][2] = [[$xHealthCheck_Battle_P1_10_trigger_1, $yHealthCheck_Battle_P1_10_trigger_1], [$xHealthCheck_Battle_P1_10_trigger_2, $yHealthCheck_Battle_P1_10_trigger_2], [$xHealthCheck_Battle_P1_10_trigger_3, $yHealthCheck_Battle_P1_10_trigger_3], [$xHealthCheck_Battle_P1_10_trigger_4, $yHealthCheck_Battle_P1_10_trigger_4], [$xHealthCheck_Battle_P1_10_trigger_5, $yHealthCheck_Battle_P1_10_trigger_5], [$xHealthCheck_Battle_P2_10_trigger_1, $yHealthCheck_Battle_P2_10_trigger_1], [$xHealthCheck_Battle_P2_10_trigger_2, $yHealthCheck_Battle_P2_10_trigger_2], [$xHealthCheck_Battle_P2_10_trigger_3, $yHealthCheck_Battle_P2_10_trigger_3], [$xHealthCheck_Battle_P2_10_trigger_4, $yHealthCheck_Battle_P2_10_trigger_4], [$xHealthCheck_Battle_P2_10_trigger_5,$yHealthCheck_Battle_P2_10_trigger_5], [$xHealthCheck_Battle_P3_10_trigger_1, $yHealthCheck_Battle_P3_10_trigger_1], [$xHealthCheck_Battle_P3_10_trigger_2, $yHealthCheck_Battle_P3_10_trigger_2], [$xHealthCheck_Battle_P3_10_trigger_3, $yHealthCheck_Battle_P3_10_trigger_3], [$xHealthCheck_Battle_P3_10_trigger_4, $yHealthCheck_Battle_P3_10_trigger_4], [$xHealthCheck_Battle_P3_10_trigger_5, $yHealthCheck_Battle_P3_10_trigger_5]] ; 10 Health array while in battle
  2. OR
  3. Global $HealthCheck_Battle_P1_10_trigger[5][2] = [[$xHealthCheck_Battle_P1_10_trigger_1,$yHealthCheck_Battle_P1_10_trigger_1], [$xHealthCheck_Battle_P1_10_trigger_2,$yHealthCheck_Battle_P1_10_trigger_2], [$xHealthCheck_Battle_P1_10_trigger_3,$yHealthCheck_Battle_P1_10_trigger_3], [$xHealthCheck_Battle_P1_10_trigger_4,$yHealthCheck_Battle_P1_10_trigger_4], [$xHealthCheck_Battle_P1_10_trigger_5,$yHealthCheck_Battle_P1_10_trigger_5]] ; P1 Health array while in battle
  4. Global $HealthCheck_Battle_P2_10_trigger[5][2] = [[$xHealthCheck_Battle_P2_10_trigger_1,$yHealthCheck_Battle_P2_10_trigger_1], [$xHealthCheck_Battle_P2_10_trigger_2,$yHealthCheck_Battle_P2_10_trigger_2], [$xHealthCheck_Battle_P2_10_trigger_3,$yHealthCheck_Battle_P2_10_trigger_3], [$xHealthCheck_Battle_P2_10_trigger_4,$yHealthCheck_Battle_P2_10_trigger_4], [$xHealthCheck_Battle_P2_10_trigger_5,$yHealthCheck_Battle_P2_10_trigger_5]] ; P2 Health array while in battle
  5. Global $HealthCheck_Battle_P3_10_trigger[5][2] = [[$xHealthCheck_Battle_P3_10_trigger_1,$yHealthCheck_Battle_P3_10_trigger_1], [$xHealthCheck_Battle_P3_10_trigger_2,$yHealthCheck_Battle_P3_10_trigger_2], [$xHealthCheck_Battle_P3_10_trigger_3,$yHealthCheck_Battle_P3_10_trigger_3], [$xHealthCheck_Battle_P3_10_trigger_4,$yHealthCheck_Battle_P3_10_trigger_4], [$xHealthCheck_Battle_P3_10_trigger_5,$yHealthCheck_Battle_P3_10_trigger_5]] ; P3 Health array while in battle
  6.  
  7. $PartySpot = 2
  8.  
  9. Select ; we have to set where the party members are located on the screen for healing to work correctly
  10.     Case $PartySpot = 1
  11.         $PartySpot_P2 = 2
  12.         $PartySpot_P3 = 3
  13.     Case $PartySpot = 2
  14.         $PartySpot_P2 = 1
  15.         $PartySpot_P3 = 3
  16.     Case $PartySpot = 3
  17.         $PartySpot_P2 = 1
  18.         $PartySpot_P3 = 2
  19. EndSelect
  20.  
  21.    
  22.    
  23. Func Battle()
  24.     CheckBattleHealth($PartySpot) ; checking if self is low on health
  25.     If $IsGroupHealer = "yes" Then
  26.         CheckBattleHealth($PartySpot_P2) ; checking if 2nd player is low on health
  27.         CheckBattleHealth($PartySpot_P3) ; checking if 3rd player is low on health
  28.     EndIf
  29. EndFunc
  30.  
  31.  
  32. Func CheckBattleHealth($PartySpot)
  33.     Select
  34.         Case $PartySpot = 1
  35.             If Hex(PixelGetColor($xHealthCheck_Battle_P1_10_trigger_1,$yHealthCheck_Battle_P1_10_trigger_1),6) = $HealthCheck_Battle_P1_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_Battle_P1_10_trigger_2,$yHealthCheck_Battle_P1_10_trigger_2),6) = $HealthCheck_Battle_P1_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_Battle_P1_10_trigger_3,$yHealthCheck_Battle_P1_10_trigger_3),6) = $HealthCheck_Battle_P1_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_Battle_P1_10_trigger_4,$yHealthCheck_Battle_P1_10_trigger_4),6) = $HealthCheck_Battle_P1_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_Battle_P1_10_trigger_5,$yHealthCheck_Battle_P1_10_trigger_5),6) = $HealthCheck_Battle_P1_10_trigger_color_5 Then
  36.                 ; HEAL STUFF
  37.             EndIf
  38.         Case $PartySpot = 2
  39.             If Hex(PixelGetColor($xHealthCheck_Battle_P2_10_trigger_1,$yHealthCheck_Battle_P2_10_trigger_1),6) = $HealthCheck_Battle_P2_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_Battle_P2_10_trigger_2,$yHealthCheck_Battle_P2_10_trigger_2),6) = $HealthCheck_Battle_P2_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_Battle_P2_10_trigger_3,$yHealthCheck_Battle_P2_10_trigger_3),6) = $HealthCheck_Battle_P2_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_Battle_P2_10_trigger_4,$yHealthCheck_Battle_P2_10_trigger_4),6) = $HealthCheck_Battle_P2_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_Battle_P2_10_trigger_5,$yHealthCheck_Battle_P2_10_trigger_5),6) = $HealthCheck_Battle_P2_10_trigger_color_5 Then
  40.                 ; HEAL STUFF
  41.             EndIf
  42.         Case $PartySpot = 3
  43.             If Hex(PixelGetColor($xHealthCheck_Battle_P3_10_trigger_1,$yHealthCheck_Battle_P3_10_trigger_1),6) = $HealthCheck_Battle_P3_10_trigger_color_1 and Hex(PixelGetColor($xHealthCheck_Battle_P3_10_trigger_2,$yHealthCheck_Battle_P3_10_trigger_2),6) = $HealthCheck_Battle_P3_10_trigger_color_2 and Hex(PixelGetColor($xHealthCheck_Battle_P3_10_trigger_3,$yHealthCheck_Battle_P3_10_trigger_3),6) = $HealthCheck_Battle_P3_10_trigger_color_3 and Hex(PixelGetColor($xHealthCheck_Battle_P3_10_trigger_4,$yHealthCheck_Battle_P3_10_trigger_4),6) = $HealthCheck_Battle_P3_10_trigger_color_4 and Hex(PixelGetColor($xHealthCheck_Battle_P3_10_trigger_5,$yHealthCheck_Battle_P3_10_trigger_5),6) = $HealthCheck_Battle_P3_10_trigger_color_5 Then
  44.                 ; HEAL STUFF
  45.             EndIf
  46.     EndSelect
  47. EndFunc
  48.  
  49.  
  50. USING THE FIRST ARRAY ON LINE 1:
  51. THIS WOULDNT WORK, BECAUSE $PartySpot will add too much and array will be out of its bounds:
  52. If Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot-1][0],$HealthCheck_Battle_10_trigger[$PartySpot-1][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+0][0],$HealthCheck_Battle_10_trigger[$PartySpot+0][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+1][0],$HealthCheck_Battle_10_trigger[$PartySpot+1][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+2][0],$HealthCheck_Battle_10_trigger[$PartySpot+2][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+3][0],$HealthCheck_Battle_10_trigger[$PartySpot+3][1])) = $HealthCheck_trigger_color Then
  53. If Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+4][0],$HealthCheck_Battle_10_trigger[$PartySpot+4][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+5][0],$HealthCheck_Battle_10_trigger[$PartySpot+5][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+6][0],$HealthCheck_Battle_10_trigger[$PartySpot+6][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+7][0],$HealthCheck_Battle_10_trigger[$PartySpot+7][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+8][0],$HealthCheck_Battle_10_trigger[$PartySpot+8][1])) = $HealthCheck_trigger_color Then
  54. If Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+9][0],$HealthCheck_Battle_10_trigger[$PartySpot+9][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+10][0],$HealthCheck_Battle_10_trigger[$PartySpot+10][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+11][0],$HealthCheck_Battle_10_trigger[$PartySpot+11][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+12][0],$HealthCheck_Battle_10_trigger[$PartySpot+12][1])) = $HealthCheck_trigger_color and Hex(PixelGetColor($HealthCheck_Battle_10_trigger[$PartySpot+13][0],$HealthCheck_Battle_10_trigger[$PartySpot+13][1])) = $HealthCheck_trigger_color Then
  55.  
  56. LOGIC:
  57. if $PartySpot = 1 then should use $HealthCheck_Battle_10_trigger [0] thru [4] and P2 uses [5] thru [9] and P3 uses [10] thru [14]
  58. if $PartySpot = 2 then should use $HealthCheck_Battle_10_trigger [5] thru [9] and P2 uses [0] thru [4] and P3 uses [10] thru [14]
  59. if $PartySpot = 3 then should use $HealthCheck_Battle_10_trigger [10] thru [14] and P2 uses [0] thru [4] and P3 uses [5] thru [9]
  60.  
  61.  
  62. USING THE ARRAYS ON LINES 3-5:
  63. LOGIC:
  64. if $PartySpot = 1 then should use $HealthCheck_Battle_P1_10_trigger [0] thru [4] and P2 uses $HealthCheck_Battle_P2_10_trigger [0] thru [4] and P3 uses $HealthCheck_Battle_P3_10_trigger [0] thru [4]
  65. if $PartySpot = 2 then should use $HealthCheck_Battle_P2_10_trigger [0] thru [4] and P2 uses $HealthCheck_Battle_P1_10_trigger [0] thru [4] and P3 uses $HealthCheck_Battle_P3_10_trigger [0] thru [4]
  66. if $PartySpot = 3 then should use $HealthCheck_Battle_P3_10_trigger [0] thru [4] and P2 uses $HealthCheck_Battle_P1_10_trigger [0] thru [4] and P3 uses $HealthCheck_Battle_P2_10_trigger [0] thru [4]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement