Locked Home » Forums » Legacy & Archived » Archived Content » Vanguard » VGExtreme Programs

VG Bots - B-Bot 1.3 : VGExtreme Programs

Posted: May 10th, 2007
black_lotus
Anyone have a version for a Dread Knight or Bard ?
Posted: May 30th, 2007
binafus
Trying the bloodmage-version to run 3 days now. But the bot calls the spells too fast. While he is already casting a spell he tries to cast other spells 4-5x. Modifying the spell cooldown bigger does nothing for me. Next problem, if he killed 1 mob and has only 10% power left, he casts invis, than immediately targetting next mob, if in pullrange, and begin to fight without resting. Without enough power to cast/heal so he dies. It seems, that the check for enough power doesnt work for me.

Can someone help me?
Posted: May 31st, 2007
User avatar
Total Posts:21 Joined:2007
I've never been a fan of how you have to make a circle for the MoveToNextWayPoint function to behave properly. I use the following solution as a replacement, it will walk the waypoint array in reverse if the start and ending points of the array are greater than DistanceCheck apart.

Code: Register to unlock hidden link

Dim WP, ArrayDirection, DistanceCheck
WP = -1
ArrayDirection = "Forward"
DistanceCheck = 500

Function MoveToNextWaypoint()

If (WP < WAYPOINTS) Then
    If (ArrayDirection = "Forward") Then
        WP = WP + 1
        MoveTo WAYPOINT_ARRAY(WP,0), WAYPOINT_ARRAY(WP,1)
    ElseIf (ArrayDirection = "Reverse") Then
        If (WP <0> 0) Then
            MoveTo WAYPOINT_ARRAY(WP,0), WAYPOINT_ARRAY(WP,1)
            WP = WP - 1
        End If
    End If
Elseif (WP >= WAYPOINTS) Then
    If Abs(WAYPOINT_ARRAY(0,0) - WAYPOINT_ARRAY(WAYPOINTS,0)) < Int(DistanceCheck) AND Abs(WAYPOINT_ARRAY(0,1) - WAYPOINT_ARRAY(WAYPOINTS,1)) < Int(DistanceCheck) Then
        DoCircle = True
    Else
        DoCircle = False
    End If

    If (DoCircle = True) Then
        ArrayDirection = "Forward"
        WP = 0
        MoveTo WAYPOINT_ARRAY(0,0), WAYPOINT_ARRAY(0,1)
    Elseif (DoCircle = False) Then
        ArrayDirection = "Reverse"
        WP = WAYPOINTS
        MoveTo WAYPOINT_ARRAY(WP,0), WAYPOINT_ARRAY(WP,1)
        WP = WP - 1
    End If
End If

Sleep WALK

End Function 


Last edited by farkle on May 31st, 2007, 12:52 am, edited 2 times in total.
Posted: May 31st, 2007
User avatar
Total Posts:21 Joined:2007
And here is my hacked version of b-rogue that I use for my level 39 rogue. I had to edit the order the if statements for checking health, stamina, power, etc were in in B-Bot 1.3 to get the my character to not suicide. My hot bar is set up as:

Code: Register to unlock hidden link

1 = Wicked Strike V
2 = Lacerate V
3 = Fatal Stroke II
4 = Last Ditch Strike II
5 = Vital Strikes I
6 = Ranged Attack
7 = Keen Eye IV
8 = /cast "Hemorrhage V"
    /cast "Impale III"
    /cast "Revenge IV"
9 = /cast "Elusive Mark II"
- = Backstab V

C1 = Loot
C2 = Harvest
C9 = /combatformset "Stalking I"
and now for the spam:

Code: Register to unlock hidden link

'*************************************************************'
' f-rogue.vbs by farkle based on b-rogue 1.2.vbs by binafus
'
' I haven't even LOOKED AT b-rogue 1.3.vbs
' This is still in testing, delays need to be further tweaked
' I also still need to add a way to handle adds, etc
'
' note: I've changed quite a bit of my B-Bot 1.3.vbs, so I am
'       not sure if this script will work for everyone out of
'       the box.  My apologies in advance.
'*************************************************************'

Const MELEE_ATTACK_1 = "1"          ' Wicked Strike
Const MELEE_ATTACK_2 = "2"          ' Lacerate
Const MELEE_ATTACK_3 = "3"          ' Fatal Stroke
Const LAST_DITCH_STRIKE = "4"       ' Last Ditch Strike
Const VITAL_STRIKES = "5"           ' Vital Strikes
Const RANGED_ATTACK_1 = "6"         ' Ranged Attack
Const PRE_ATTACK_BUFF = "7"         ' Keen eye 
Const FINISHER_DOT = "8"            ' Finisher DoT
Const HEALS_PLAYER = "9"            ' Lint bandages (currently not used)
Const PICK_POCKET = "0"             ' Pick Pocket
Const BACK_STAB = "-"               ' Backstab
Const ELUSIVE_MARK = "9"             ' Elusive Mark

Const LOOT_MACRO = "^1"             ' Loot
Const HARVEST_MACRO = "^2"          ' Harvest
Const HOTKEY_INVIS = "^9"           ' Stealth 

Const LEVEL_TRAINED = "39"      ' Last level trained
Const AVOID_PLAYERS = 0         ' Set to 1 to avoid players
Const STOP_DEAD = 1             ' Set to 1 to exit Vanguard if you die
Const QUIT_ON_TELL = 0          ' Set to 1 if you wish the bot to exit on tells
Const MAX_MOB_LEVEL = 37        ' Maximum level of mob you wish to attack
Const MIN_MOB_LEVEL = 0         ' Mininum level of a mob to attack
ControlBar = 0                  ' 1 = Turn on Control Box    0 = Turn off Control Box 
Const MAX_RANGE = 34            ' Max Throwing Weapons 20, Bows 25 (35 with flight arrows) 
Const MIN_RANGE = 8             ' Min Range Throwing Weapons 2, Bows 8
Const HOTKEY_NEXT_MOB = "z"     ' Cycle mobs
Const HOTKEY_NEAREST_MOB = "q"  ' Nearest Mob
Const MAX_RUNS = 5000           ' How many loops to do
Const MAX_MOB_POINTS = 2        ' Hightest Number of dots a mob can have to be a valid target

'************************************************************************************************************************************'
' HARVEST_NODES = 1 will turn on harvesting, Then fill out the array with nodes you wish to harvest.
' You do not need the full name of a node If you wanted to harvest Cotton and Mature Cotton you would only need the word Cotton
' List of items 
' REAPING  T1-Jute T2-Cotton T3-Firegrass T4-Silkbloom T5-Veilthread T6-Steelweave 
' LUMBER T1-Weakened T2-Barbed Thorn T3-Dry Arid Desicated T4-Knotted Warped Gnarled T5-Dusky T6-Aged
' METAL - T1-Copper T2-Tin Nickel T3-Iron T4-Pyrite Embersteel Sunflame T5-Mithral Silver T6-Draconite
' STONE - T1-Basalt  T2-Slate Gneiss T3-Sandstone Soapstone Alabaster T4-Limestone Travertine Marble T5-Granite Skarn T6-Obsidian Onyx 
' GEM - T1-Quartz T2-Garnet Carnelian T3-Amethyst Moonstone Soulstone T4-Jade Malachite Peridot T5-Sapphire Lapis T6-ToothAgate Topaz 
' So If you wanted Teir 2 in Reaping and Teir 1 and 2 in Lumber you would put the following in the array
' The array can be as many lines as you need just make number of items in your array match X  Harvest_Array(X)
'*************************************************************************************************************************************

HARVEST_NODES = 0
Dim Harvest_Array(4)               
Harvest_Array(0) = "Cotton"      
Harvest_Array(1) = "Weakened"
Harvest_Array(2) = "Barbed"
Harvest_Array(3) = "Thorn"


'*****************************************************************************************************************************************'
' If you wish to Skin/Harvest the mobs you kill Change HARVEST_MOB = 1 and fill in the mobs you will be harvesting in the GoodSpawns
'*****************************************************************************************************************************************'

Const HARVEST_MOB = 0           ' Try to Skin mobs just killed ?  1 = true  0 = False 
Const HARVEST_DELAY = 6         ' If you are still Harvesting when it tries to Loot raise this number, If it is waiting too long to loot lower it

'***********************************************************************'
'* EDIT the following Mob list If you will be Harvesting them          *'
'***********************************************************************'

Dim GoodSpawns(9)               
GoodSpawns(0) = "Strange Clump of Grass"      
GoodSpawns(1) = "Cackler Fury"
GoodSpawns(2) = "Sandburster of Veleri"
GoodSpawns(3) = "Hunter Spider"
GoodSpawns(4) = "Boar"
GoodSpawns(5) = "Plains Wolf"
GoodSpawns(6) = "Small Ringback Adder"
GoodSpawns(7) = "Snake"
GoodSpawns(8) = "Plains Wolf"

'***********************************************************************'
'* EDIT the following Player list to Players not to exit on tells from *'
'* Change the Dim GoodPlayer(x) Where X = the length of the array      *'
'* This only matters If you have AVOID_PLAYERS set to 1                *'
'***********************************************************************'

Dim GoodPlayer(5)               
GoodPlayer(0) = "Joe"      
GoodPlayer(1) = "Test"
GoodPlayer(2) = "Bill"
GoodPlayer(3) = "Tom"
GoodPlayer(4) = "Edd"

'**********************************************************************************************************************'
'* WAYPOINTS =  number of waypoints                                                                                   *'   
'* Dim WAYPOINT_ARRAY(X,2) fill in X with the number that you put in the WAYPOINTS variable                           *'
'* Use binafus Waypoint Creater 1.1 to get your array of locs                                                         *'
'**********************************************************************************************************************'

Const WAYPOINTS = 1
Dim WAYPOINT_ARRAY(1,3)
' This is where your waypoint_array would be
' You're not getting my waypoints, bob

  NEED_POWER = 0      ' We don't need power
  NEED_STAM = 1       ' We need stamina
  HAVE_INVIS = 0      ' We don't have invisibility
  HAVE_STEALTH = 1    ' We have stealth
  HAVE_HEALS = 0      ' We don't have heals (lint bandages are costly)
  NO_HEALS = 1        ' See above
  RANGED_PULL = 1     ' Ranged pull is faster (not to mention safer in most places!) than running to a target

    Const SPELL_SLEEP = 2900      ' Spell cool down time in miliseconds
    Const MELEE_SLEEP = 2500      ' Melee attack cool down time in miliseconds
    Const WALK = 3200             ' Time to sleep until we arrive at next way point

' Parse log file for line of sight issues, buggy but it usually works
' idea stolen from kumpel100
Function CheckLOS
 Do While not (Infile.atEndOfStream)
        Line = Infile.ReadLine
            If InStr (Line, "no line of sight") Then
Log.DebugLog "Line of sight issue at distance: " & Target.Distance
for Forward = 0 to 3 
           VGSendText "s"
           Sleep 10
         next
         End If
            
    loop
end function

' If our target is too far away (ie; running) hit it with a ranged attack
Function CheckRange
    If (getTargetDistance >= 8) Then
        Log.DebugLog "Target is out of melee distance, attempting to kill with arrows"
        Sleep 10
        VGSendText RANGED_ATTACK_1
        Sleep MELEE_SLEEP
    End If
End Function

' Replacement faceMob call, to get rid of debuglog spam
Sub silentfaceMob(Mob) 
    If (Mob.GUID <> 0) then
        for i = 1 to 67
            If (VG.navigation.TurnTo(Mob.ByRef) = true) then
                exit for
            End If
            sleep 50
        next
        VG.navigation.StopMovement NAVIGATE_LEFT
        VG.navigation.StopMovement NAVIGATE_RIGHT
    End If
end Sub

' Replacement MoveTo call for GetBehind() (needed more accuracy than 400 units)
Sub MoveToMoreAccurate(x,y)
    for i = 1 to 67
        if (VG.navigation.MoveTo (X, Y,100,true) = true) then ' changed to 100 from 400 
            exit for 
        end if 
        sleep 75 
    next 
    VG.navigation.StopMovement(&H26) 
end Sub

' Obtains mobs heading, as to why this wasn't included, I have no idea
Function GetMobHeading(mob) 
    on error resume next 
        GetMobHeading = Mob.Heading 
    on error goto 0 
End Function

' Rudamentary GetBehind(), needs a lot of work
Function GetBehind()
    Log.DebugLog "Attempting to move behind our target"
      Call MoveToMoreAccurate(GetTargetX - Sin(GetMobHeading(GetTarget)),GetTargetY - Cos(GetMobHeading(GetTarget)) * 100)
End Function

'*************************************************************************'
'*''''''''''''''''''''Killing Closest Target'''''''''''''''''''''''''''''*'
'*************************************************************************'

Function KillCurrentTarget()    
    DIM TargetStartHealth, TargetEndHealth, TargetDistance
    DIM CombatStarted 
    DIM Name

    CombatStarted = 1 

    TargetStartHealth = getTargetHealth()
    Name = getTargetName()

    Do until (getTargetID = 0 or getTargetHealth = 0)
        silentfaceMob getTarget

        ' Did our target die?
        If (strcomp(Name,getTargetName)= 1 or strcomp(Name,getTargetName)= -1 ) then
            Exit Do 
        End If 

        ' Ranged pull
        If CombatStarted = 1 and getTargetDistance <MAX_RANGE> MIN_RANGE and RANGED_PULL = 1 Then
            silentfaceMob getTarget
            VGSendText RANGED_ATTACK_1
            sleep 2200
            CombatStarted = 2
        End If

        ' Move to and enter melee combat
        If CombatStarted = 1 and RANGED_PULL = 0 Then
            silentfaceMob getTarget
            GetBehind(getTarget)
            CombatStarted = 2
        VGSendText BACK_STAB
              Sleep 10
        End If
        
          CheckCombatStatus

        ' Did our target die? (checking again)
        If (strcomp(Name,getTargetName)= 1 or strcomp(Name,getTargetName)= -1 ) then
            Exit Do
        End If 

        If CombatStarted = 2 then
            silentfaceMob getTarget 
            Log.DebugLog "Keen Eye, hotbar slot " & PRE_ATTACK_BUFF
            VGSendText PRE_ATTACK_BUFF
            Sleep 10
            CombatStarted = 0 
        End If

          CheckCombatStatus

        silentfaceMob getTarget 
        If (getPlayerEndurance() > 20) Then ' We're making sure we have enough endurance to do other things here
            Log.DebugLog "Wicked Strike, hotbar slot " & MELEE_ATTACK_1
            VGSendText MELEE_ATTACK_1
            Sleep MELEE_SLEEP
        End If

        ' Did our target die? (checking yet again)
        If (strcomp(Name,getTargetName)= 1 or strcomp(Name,getTargetName)= -1 ) then
            Exit Do
        End If 

          CheckCombatStatus
        
            silentfaceMob getTarget 
            Log.DebugLog "Lacerate, hot bar slot " & MELEE_ATTACK_2
            VGSendText MELEE_ATTACK_2
            Sleep MELEE_SLEEP

          CheckCombatStatus

        ' Did our target die? (checking yet again)
        If (strcomp(Name,getTargetName)= 1 or strcomp(Name,getTargetName)= -1 ) then
            Exit Do
        End If 

    If (TargetDistance <MAX_RANGE> MIN_RANGE) Then
        VGSendText RANGED_ATTACK_1
        Sleep MELEE_SLEEP / 2
    End If 


    ' Is our target taking damage?
    TargetEndHealth = getTargetHealth()
    TargetDistance = getTargetDistance()
     If ((TargetStartHealth => TargetEndHealth) and (TargetDistance > MAX_RANGE)) then
          Log.Debuglog "The target is out of range, start on next mob"
          Exit Do 
     End If

' This needs to be re-done
        If ((TargetStartHealth => TargetEndHealth) and (TargetDistance <MAX_RANGE> 5)) then  ' Mark mob as temp bad Break Loop 
'            Log.Debuglog "MOVE TO TARGET  "
'            MoveToMob(getTarget)
            Exit Do                 ' could not see target exit to look for next target
        End If 
    Loop
End Function

Sub CheckCombatStatus

    ' Check for line of sight error spam
    CheckLOS

    ' Check for target running away at low health
    If (getTargetHealth =< 15) Then
      CheckRange
    End If
    
    If (getPlayerHealth() < 40) Then
      Log.DebugLog "Elusive Mark, hotbar slot " & ELUSIVE_MARK
	  VGSendText ELUSIVE_MARK
	  Sleep 10
    End If

    ' Activate vital strikes ability when the odds seem not in our favor
    If (getPlayerHealth() =< 60 and getPlayerHealth() < getTargetHealth()) Then
      Log.DebugLog "Vital Strikes, hotbar slot " & VITAL_STRIKES
      silentfaceMob getTarget
      VGSendText VITAL_STRIKES
      Sleep 10
    End If
    
    ' Attempt to finish mob when it is below 15% health
    If (getTargetHealth() =< 15) then
      Log.DebugLog "Fatal Stroke, hotbar slot " & MELEE_ATTACK_3
      silentfaceMob getTarget
      VGSendText MELEE_ATTACK_3
      Sleep 10
    End If
    
    ' We may be in trouble at this point, attempting Last Ditch Strike 
    If (getPlayerHealth() =< 15) then
      Log.DebugLog "Last Ditch Strike, hotbar slot " & LAST_DITCH_STRIKE
      silentfaceMob getTarget
      VGSendText LAST_DITCH_STRIKE
      Sleep 10
    End If
    
    ' Always returns true, so I just put the attack finisher chain here
    If getPlayerHasCounter() Then
      silentfaceMob getTarget 
      VGSendText FINISHER_DOT
      Sleep 10
    End If

' None of this works, just here for future use/reference
'If getPlayerHasFinisher() Then
'End If 
'If getPlayerHasCombatForms() Then
'End If 
'If getPlayerHasRescue() Then 
'End If 

End Sub
Ready to join the community? Click here and see all of the benefits!
blue large dotWho is online
Users browsing this forum: No registered users and 2 guests
Locked