Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Ensure you have switched Mini Map to the one with both Map Name and Mini Map
- 'Const definitions
- Const HP_BAR_LEFT_X = 224
- Const MP_BAR_LEFT_X = 332
- Const HP_MP_TEST_POINT_Y = 615
- Const HP_MP_TEST_EMPTY_COLOR = "BEBEBE"
- Const MINIMAP_TOP_LEFT_X = 24
- Const MINIMAP_TOP_LEFT_Y = 118
- Const MINIMAP_BOTTOM_RIGHT_X = 119
- Const MINIMAP_BOTTOM_RIGHT_Y = 145
- Const MINIMAP_PLAYER_COLOR = "88FFFF"
- Const MINIMAP_PARTY_COLOR = "0077FF"
- Const MINIMAP_PLAYER_LEFT_BOUND = 20
- Const MINIMAP_PLAYER_RIGHT_BOUND = 110
- Const FEED_PET_EVERY = 600
- Const KEY_ATTACK = "G"
- Const KEY_BUFF = "Shift"
- Const KEY_FEED_PET = "6"
- Const KEY_50_Percent_HP = "7"
- Const KEY_50_Percent_MP = "8"
- Const KEY_75_Percent_HP = "-"
- Const KEY_75_Percent_MP = "="
- Function PressFor(key, d)
- KeyDown key, 1
- Delay d
- KeyUp key, 1
- Delay 30
- End Function
- Function Attack()
- PressFor KEY_ATTACK, 100
- End Function
- Function Move(towards)
- PressFor towards, 900
- End Function
- Function FindPlayer()
- FindColor _
- MINIMAP_TOP_LEFT_X, _
- MINIMAP_TOP_LEFT_Y, _
- MINIMAP_BOTTOM_RIGHT_X, _
- MINIMAP_BOTTOM_RIGHT_Y, _
- MINIMAP_PLAYER_COLOR, _
- playerX, _
- playerY
- End Function
- Function FindParty()
- FindColor _
- MINIMAP_TOP_LEFT_X, _
- MINIMAP_TOP_LEFT_Y, _
- MINIMAP_BOTTOM_RIGHT_X, _
- MINIMAP_BOTTOM_RIGHT_Y, _
- MINIMAP_PARTY_COLOR, _
- partyX, _
- partyY
- End Function
- Function FeedPet()
- If feedTime = Empty Or DateDiff("s", Now, feedTime) > FEED_PET_EVERY Then
- KeyPress KEY_FEED_PET, 1
- feedTime = Now
- End If
- End Function
- Function IsPartyClose()
- xOffset = Abs(partyX - playerX)
- yOffset = Abs(partyY - playerY)
- IsPartyClose = xOffset < 5 And yOffset < 5
- End Function
- Function IsHPBelowPercent(percent)
- IfColor HP_BAR_LEFT_X + percent, HP_MP_TEST_POINT_Y, HP_MP_TEST_EMPTY_COLOR, 2 Then
- IsHPBelowPercent = True
- Else
- IsHPBelowPercent = False
- End If
- End Function
- Function IsMPBelowPercent(percent)
- IfColor MP_BAR_LEFT_X + percent, HP_MP_TEST_POINT_Y, HP_MP_TEST_EMPTY_COLOR, 2 Then
- IsMPBelowPercent = True
- Else
- IsMPBelowPercent = False
- End If
- End Function
- Function EnsureHealth()
- If IsHPBelowPercent(30) Then
- PressFor KEY_75_Percent_HP, 99
- ElseIf IsHPBelowPercent(55) Then
- PressFor KEY_50_Percent_HP, 99
- End If
- If IsMPBelowPercent(30) Then
- PressFor KEY_75_Percent_MP, 99
- ElseIf IsMPBelowPercent(55) Then
- PressFor KEY_50_Percent_MP, 99
- End If
- End Function
- Function BuffParty
- If IsPartyClose Then
- PressFor KEY_BUFF, 200
- End If
- End Function
- Sub CheckDirection
- If playerX < MINIMAP_PLAYER_LEFT_BOUND Then
- 'Move Right
- direction = "Right"
- ElseIf playerX > MINIMAP_PLAYER_RIGHT_BOUND Then
- 'Move Left
- direction = "Left"
- End If
- End Sub
- 'Initial Direction
- Dim direction : direction = "Right"
- Dim playerX
- Dim playerY
- Dim partyX
- Dim partyY
- Dim feedTime : feedTime = Empty
- Do While True
- EnsureHealth
- 'FeedPet
- FindPlayer
- 'FindParty
- 'BuffParty
- CheckDirection
- Attack
- Move direction
- Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement