Page 1 of 3

VG Bot - Paladin Bot v2.4

Posted: March 24th, 2007, 6:14 pm
by antareus
UPDATE:
V2.4 of the VG Paladin bot by kryologik and I is here. Check below for details.

Also, a lot of the thread is being re-written to match the new version.


Here's a list of the new features that are currently in the VG Paladin Bot:


- A new way for the bot to send attacks (Now the bot sends /cast commands, instead of using your 1-0 keys on your keyboard. This is a great change imo as you can now keep your hotbar the way YOU want it for when your not botting etc.. )
- DoCombat is here! The bot is easier to customize thanks to the new code, and its been made a lot cleaner thanks to the new "DoCombat"
- Buffs are now supported and are now activated by the bot!
- Endurance and Health check have been rewritten/added, so that the bot will now check both of them at the end of each attack. This means that there's a higher chance that the bot will stay alive during combat!

In Development:

- The chocie to avoid certain mobs, as in you put the mobs names on a list and if that mob appears the bot will move safely away from that mob.

-A possible self-resurrecter. Yet this is still in concept :P.

BUGs

-None reported

How to set up

-Being ReMade to fit V2.x-

FAQ.

-Being ReMade-

Conclusion

I'm going to rewrite a lot of the info on this page, but for now I want to thank kryologik for his brilliant remake of the code and continued aide with this project :D.

Let me know how the bot runs for you and if you are experiencing any problems while running the bot.


Regards,
Antareus

Posted: March 25th, 2007, 4:40 am
by antareus
The following features have been added to the bot:

Ant VG Paladin Bot V1.10
-The bot will now stop attacking the mobs once they are dead. The issue with the bot continuing to attack has therefore now been fixed.
-A new array waypoint system has been added.

Ant VG Paladin Bot V1.15
- A new, more advance auto attack script has been written in order to fix the issue with the bot continuing to attack, it's still a bit shaky atm so if you find any bugs with the auto attack script, let me know. (keep in mind that the bot now relys on the hotkey attacks to initiate the auto attack sequence, and that the bot will now end auto attack at the end of the combat sequence).

Ant VG Paladin Bot V1.16
-THe auto attack script has been edited yet again (lol). This time i've fixed the spamming issue the autoattack on/off script was causing. Instead I've decided to let the auto attack stay on after it has been activated by a melee attack skill, and the bot will now stop attacking once it notices that your character isn't auto attacking. Again I consider all parts of the code to still be in testing so if you notice any bugs, or if you have any suggestions, let me know :).

Posted: March 26th, 2007, 11:25 am
by kslay85
whenever i get attacked by two things, he seems to get stuck in a loop healing himself after he kills the first, he never targets the second mob

Posted: March 26th, 2007, 12:00 pm
by antareus
kslay85 wrote:whenever i get attacked by two things, he seems to get stuck in a loop healing himself after he kills the first, he never targets the second mob
Yeah that's another thing which is on my "todo" list. However atm I'm having a hard time writting a solid script for taking care of adds. Atm I suggest you mainly use the bot in non-aggro zones. Atleast till I get something more stable up and running, to take care of these adds.

Posted: March 26th, 2007, 12:20 pm
by kumqwat420
Try this, may fix it but im a noob so dont hate me if it doesnt Oo

Change this

Code: Register to unlock hidden link

    'Rest up unless we get attacked
    PlayerHealth = getPlayerHealth 
    do while ((getPlayerPower < getPlayerMaxPower) and (PlayerHealth <= getPlayerHealth))
        Sleep 1000
    loop
to code found in attached file, forums buggy when i try and place code directly

Posted: March 26th, 2007, 12:58 pm
by antareus
kumqwat420 wrote:Try this, may fix it but im a noob so dont hate me if it doesnt Oo

Change this

Code: Register to unlock hidden link

    'Rest up unless we get attacked
    PlayerHealth = getPlayerHealth 'Reset because we just casted a drain spell
    do while ((getPlayerPower < getPlayerMaxPower) and (PlayerHealth <= getPlayerHealth))
        Sleep 1000
    loop
to this

Code: Register to unlock hidden link

    PlayerHealth = getPlayerHealth     
    hits1 = GetPlayerHealth              
    hits2 = hits1
    do while ((getPlayerPower < getPlayerMaxPower) and (PlayerHealth <getPlayerHealth>= hits2))
        Sleep 1000
    loop
Interesting idea, however i just realised that this part of the code is more caster orientated. What it basically means is that, while your mana is coming back, if your health goes below the "reset health" aka this part of the code :
PlayerHealth = getPlayerHealth 'Reset because we just casted a drain spell

Then the bot will stop resting as you will have lost life and the bot assumes that you are being attacked by a mob.

Now what you did kumqwat420, was you basically told the bot that hits 2 = getplayerhealth at that time, and because its right after PlayerHealth = getPlayerHealth , we can assume that the bot is reading hits 2 as the same as Playerhealth. So hits 2= PlayerHealth.

This ultimately will confuse the bot as now it's been told that
PlayerHealth is less then getPlayerHealth, but that it is also Greater or Equal to PlayerHealth. So either way, the bot should theoretically stop resting as soon as the player regains abit of health.

Lol ok so I dragged it abit out, but to sum it up, atm the resting code is fine as it is, since the bot should already be aware that if the playerhealth goes down, it should stop resting and resume bot formation. Adding your code will only stop the bot and resume bot formation, as soon as the player gains abit of health.

Finally as to the two mobs attacking. I have a neat little script that I've been working on for a bit that might be able to solve the problem. I need a bit more time to tweak it and make sure it works, so that I don't end up releasing multiple patches on the same day lol. However expect it to be done by/on friday.

Regards,
Antareus

Posted: March 26th, 2007, 1:10 pm
by kumqwat420
ok i just saved it as a file and attached to original

Posted: March 27th, 2007, 9:41 am
by antareus
Yeah the code you wrote could work, it will atleast make the resting part more accurate. But what im more worried about is what the bot does After a mob has attacked. I hope you don't mind if I use your idea for a counter attack idea i have :P.

btw I'd remove the Log.DebugLog "resting" or atleast move it before the loop, so that the VGE client doesnt spam the word "resting".

Also, why did you add the *.80 ?

Posted: March 27th, 2007, 12:32 pm
by antareus
Ok so a little heads up as to what I'm up to atm.

As I see it, the bot has three major flaws.

1. If a mob flees during combat the bot fails to follow the mob.
2. The bot does not rest after combat. ( This is especially an issue for the warrior bots).
3. And last but not least, the bot has trouble handling adds.

So atm I'm trying to solve these 3 issues before I start to add the extra features such as the buffing and harvesting.

The first and second issues I've pretty much got covered, I know exactly why it's doing it and what I need to do to fix it. The third one is a bit tricky as I may have to re-write a larger portion of my attack function in order to give the bot more defined variables to work with.

Mind you I've been noticing the Bloodmages progress as I must say that there are a lot of brilliant ideas flowing in it's thread. With that said, I'm planning on copying the bloodmages pause script and its "what to do if someone sends the bot a tell" script. I hope you don't mind Binafus :P.

Anyway I'll probaly be releasing V1.70 tomorrow which should include a fix to the first two issues mentioned in this post.

Regards,
Antareus

Updated Paladin Code

Posted: March 28th, 2007, 8:36 pm
by kryologik

Code: Register to unlock hidden link

'///////////////////////////////////////////////////////
'///     -=*) \/anguard : Saga of |-|eroes (*=-      ///
'///          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~           ///
'///          V G E x t r e m e  V 1. 0 0            ///
'///          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~           ///
'///Author:  WyvernX                                 ///
'///Original Release:  2/14/07                       ///
'///License:  TaultUnleashed Premium Members ONLY    ///
'///Summary:  Enables memory access to Vanguard      ///
'///          class objects and logs.                ///
'///Notes:  Feel free to modify this, just please    ///
'///        Document all your changes and share it.  ///
'/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'///Discussion:  http://www.taultunleashed.com/phpbb2/about44099_VGService_Scripting_Service_for_Vanguard_.html    ///
'/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'///Modifications by: Antareus
'///     Date:  3/25/07
'///     Summary:  Turned the bot into a Paladin Bot.
'///////////////////////////////////////////////////////

'// This will load in all of the VG API routines.
RunScript "includes\VGService.vbs"
RunScript "includes\Navigation.vbs"

'///////////////////////////////////////////////////////
'///                                                 ///
'///               Ant Paladin Bot V1.15             ///
'///                                                 ///
'///////////////////////////////////////////////////////


'/////////////////////////////////////
'//  Paladin Spells / Ability list  //
'/////////////////////////////////////
'//  Debuff / Pull Spells //
'///////////////////////////
Dim DEBUFF_USED
const JUDGMENT_OF_THE_ENVIOUS = "/cast ""Judgment of the Envious II"" "
const JUDGMENT_OF_THE_PROUD = "/cast ""Judgment of the Proud III"" "
const JUDGMENT_OF_THE_BLOODTHIRSTY = "/cast ""Judgment of the Bloodthirsty II"" "
const JUDGMENT_OF_THE_WRATHFUL = "/cast ""Judgment of the Wrathful I"" "
const JUDGMENT_OF_THE_IMPURE = "/cast ""Judgment of the Impure III"" "
const SMITE = "/cast ""Smite IV"" "

'//////////////////////
'// Combat Abilities //
'//////////////////////
const AUTO_ATTACK = "/cast ""Auto Attack"" "
const CHAMPIONS_MIGHT = "/cast ""Champion's Might IV"" "
const HOLY_STRIKE = "/cast ""Holy Strike V"" "
const SENTINELS_BLESSING = "/cast ""Sentine's Blessing III"" "
const HAMMER_OF_JUDGMENT = "/cast ""Hammer of Judgment IV"" "
const VANQUISH = "/cast ""Vanquish II"" "
const MARSHALLING_CRY = "/cast ""Marshalling Cry III"" "
const AEGIS_STRIKE = "/cast ""Aegis Strike V"" "

'///////////////////
'// Heals / Buffs //
'///////////////////

const CRY_OF_ILLUMINATION = "/cast ""Cry of Illumination I"" "
const BOON_OF_VALUS = "/cast ""Boon of Valus IV"" "
const BOON_OF_VOL_ANARI = "/cast ""Boon of Vol Anari III"" "
const PARAGON_OF_JUSTICE = "/cast ""Paragon of Justice II"" "
const BARRIER_OF_FAITH = "/cast ""Barrier of Faith"" "
const HEALING_TOUCH = "/cast ""Healing Touch V"" "
const CRY_OF_SOLACE = "/cast ""Cry of Solace III"" "
const LAYING_ON_OF_HANDS = "/cast ""Laying on of Hands III"" "
'// [!] Note:  Remember, Only one blessing may be active at a time!
const BLESSING_OF_GLORIANNS_PROTECTION = "/cast ""Blessing of Gloriann's Protection III"" "
const BLESSING_OF_VAELION = "/cast ""Blessing of Vaelion I"" "
const BLESSING_OF_VOTHDAR = "/cast ""Blessing of Vothdar IV"" "
'// [!] Note:  Only one consecration may be active at a time!
const SHIELD_OF_REBUKE = "/cast ""Shield of Rebuke"" "
const SHIELD_OF_RESOLVE = "/cast ""Shield of Resolve"" "
const COURAGE = "/cast ""Courage III"" "

'//////////////////
'// Sleep Timers //
'//////////////////
const SitAndMed = 1000
const WaitForMobs = 1000
const LootPause = 1000
const DebuffPullSleep = 1500
const CombatSleep = 2000
const HealSleep = 3000
const WALK = 5500

'/////////////////////////////
'// Miscellaneous Variables //
'/////////////////////////////
const enduranceThreshold = 20 '// 0-100 # you want to set as the point to Cast Cry of Illumination at.
const healthThreshold = 80    '// Percent Health 0-100 you want to start healing your character.
const VGSendEnterKey = "{ENTER}"
const HOTKEY_NEXT_MOB = "{TAB}"
const HOTKEY_NEAREST_MOB = "{F8}"

'////////////////////
'// Waypoints list //
'////////////////////
const WAYPOINTS = 16
Dim WAYPOINT_ARRAY(16,1)
WAYPOINT_ARRAY(0,0) = -14773
WAYPOINT_ARRAY(0,1) = 99354
WAYPOINT_ARRAY(1,0) = -16218
WAYPOINT_ARRAY(1,1) = 99281
WAYPOINT_ARRAY(2,0) = -18066
WAYPOINT_ARRAY(2,1) = 98420
WAYPOINT_ARRAY(3,0) = -19736
WAYPOINT_ARRAY(3,1) = 97420
WAYPOINT_ARRAY(4,0) = -21294
WAYPOINT_ARRAY(4,1) = 96337
WAYPOINT_ARRAY(5,0) = -22057
WAYPOINT_ARRAY(5,1) = 95700
WAYPOINT_ARRAY(6,0) = -23005
WAYPOINT_ARRAY(6,1) = 95373
WAYPOINT_ARRAY(7,0) = -23492
WAYPOINT_ARRAY(7,1) = 95987
WAYPOINT_ARRAY(8,0) = -24143
WAYPOINT_ARRAY(8,1) = 97554
WAYPOINT_ARRAY(9,0) = -25209
WAYPOINT_ARRAY(9,1) = 99705
WAYPOINT_ARRAY(10,0) = -25821
WAYPOINT_ARRAY(10,1) = 101397
WAYPOINT_ARRAY(11,0) = -25132
WAYPOINT_ARRAY(11,1) = -101645
WAYPOINT_ARRAY(12,0) = -23564
WAYPOINT_ARRAY(12,1) = -100634
WAYPOINT_ARRAY(13,0) = -21280
WAYPOINT_ARRAY(13,1) = -101350
WAYPOINT_ARRAY(14,0) = -18638
WAYPOINT_ARRAY(14,1) = 102350
WAYPOINT_ARRAY(15,0) = -16626
WAYPOINT_ARRAY(15,1) = 102350
WAYPOINT_ARRAY(16,0) = -16513
WAYPOINT_ARRAY(16,1) = 100985


'How many mobs (loops)
Dim RunCounter
const MAX_RUNS = 500000

'What we want to hunt
Dim GoodSpawns(0)
GoodSpawns(0) = ""

'Random Variables
Dim PlayerHealth

DIM PC 
PC = 0

DIM WP 
WP = 0

'///////////////////////////////////////////////////////
'///                                                 ///
'///               Helper Routines                   ///
'///                                                 ///
'///////////////////////////////////////////////////////

Function BuffMe()
VGSendText BLESSING_OF_GLORIANNS_PROTECTION
VGSendText VGSendEnterKey
Sleep CombatSleep
VGSendText BOON_OF_VALUS
VGSendText VGSendEnterKey
Sleep CombatSleep
VGSendText COURAGE
VGSendText VGSendEnterKey
End Function

'Function to determine if what we have targeted we can attack
function MobIsValid(Mob)
    Dim i

    MobIsValid = False
    for i = 0 to ubound(GoodSpawns)
        if GoodSpawns(i) = Mob.Name then
            MobIsValid = True
            exit for
        end if
    next
end function

Function FindTarget( minLevel, maxLevel, distance)
    set Mobs = getNearestMobs(TYPE_NPC) 'Unknown/All
    Dim bFoundSomething
    bFoundSomething = false
    for each Mob in Mobs
        if (MobIsValid(Mob) and (getMobDistance(Mob) < distance) ) then
            set FindTarget = Mob
            Log.DebugLog "Found a target: " & Mob.Name
            bFoundSomething = true
            exit for
        end if
    next
    if (bFoundSomething = false) then
        Log.DebugLog "No Targets nearby..."
        set FindTarget = getPlayer 'Have to return something since we are expecting an object
    end if
End Function

function TargetNearestMob(Mob)
    faceMob(Mob)
    Log.DebugLog "Hitting F8 for nearest NPC..."
    VGSendText HOTKEY_NEAREST_MOB
    if (VG.Target.GUID = Mob.GUID) then
            Log.DebugLog "Got Him!"
        TargetNearestMob = true
    else
        Log.DebugLog "Hmm.. That mob doesnt seem to be the nearest one."
        TargetNearestMob = false
    end if
    Sleep WaitForMobs 'Let the mob HP populate
end function

function TargetNextMob(Mob)
    faceMob(Mob)
    Log.DebugLog "Hitting Tab for next NPC..."
    VGSendText HOTKEY_NEXT_MOB
    if (getTargetID = getMobID(Mob)) then
            Log.DebugLog "Got Him!"
        TargetNextMob = true
    else
        Log.DebugLog "Hmm.. That mob doesnt seem to be the next one."
        TargetNextMob = false
    end if
    Sleep WaitForMobs 'Let the mob HP populate
end function

Function KillCurrentTarget()
    notbeingattacked = 0
    Log.DebugLog "Facing Mob..." & Target.HP
    faceMob getTarget
    Log.DebugLog "Moving to Target"
    MoveToMob getTarget

    '// [!] Configure your own pull spell here!    
    Log.DebugLog ("--- Beginning Combat Sequence! ---")
    Log.DebugLog ("[*] Attempting to pull [" & Target.Name & "].")
    VGSendText JUDGMENT_OF_THE_PROUD
    VGSendText VGSendEnterKey

    faceMob getTarget
    Log.DebugLog ("[*] Sentinel's Blessing -> [" & Target.name & "].")
    VGSendText SENTINELS_BLESSING
    VGSendText VGSendEnterKey
    Sleep CombatSleep

    
    faceMob getTarget
    Log.DebugLog ("[*] Champion's Might -> [" & Target.Name & "].")
    VGSendText CHAMPIONS_MIGHT
    VGSendText VGSendEnterKey
    Sleep CombatSleep


    Do Until (getTargetId = 0 Or getTargetHealth = 0 Or stopattack = 1 Or notbeingattacked = 1)

        If (getPlayerHealth = 0) Then
            Log.DebugLog "You have died!~"  
            RunCounter = MAX_RUNS 'this wil stop the script
            Exit Do
        End If


    facemob getTarget
    Log.DebugLog ("[*] Trying to use Marshalling Cry.")
    VGSendText MARSHALLING_CRY
    VGSendText VGSendEnterKey
   
    faceMob getTarget
    Log.DebugLog ("[*] Holy Strike -> [" & Target.Name & "].")
    VGSendText HOLY_STRIKE
    VGSendText VGSendEnterKey
    Sleep CombatSleep

    faceMob getTarget
    Log.DebugLog ("[*] Hammer of Judgment -> [" & Target.Name & "].")
    VGSendText HAMMER_OF_JUDGMENT
    VGSendText VGSendEnterKey
    Sleep CombatSleep

    If (getPlayerPower < enduranceThreshold) Then
        Log.DebugLog("[*] Endurance has fallen below the threshold -- Attempting to use Cry of Illumination.")
        VGSendText CRY_OF_ILLUMINATION
        VGSendText VGSendEnterKey
    End If

    If ( ((getPlayerMaxHealth / getPlayerHealth) * 100) < healthThreshold) Then
        If ( ((getPlayerMaxHealth / getPlayerHealth) * 100) <= 20) Then
            Log.DebugLog("[*] Health critically low -- Using Barrier of Faith!")
            VGSendText BARRIER_OF_FAITH
            VGSendText VGSendEnterKey
            Log.DebugLog("[*] Barrier of Faith is up, quick healing with Cry of Solace.")
            VGSendText CRY_OF_SOLACE
            VGSendText VGSendEnterKey
        End If
        Log.DebugLog "[*] Health has fallen below the threshold -- Attempting to cast Healing Touch!"
        VGSendText HEALING_TOUCH 'Use healing spell
        VGSendText VGSendKeyEnter
        Sleep HealSleep
    End If
  
    If (getPlayerIsAttacking = False And getTargetIsAttacking = False) Then
    Log.DebugLog ("[*] --- Combat Sequence Completed ---")
    notbeingattacked = 1   
    End If
   
    sleep 2000
    Loop
end function

Function KillNearestTarget
  Dim aTarget
  set aTarget = FindTarget(3,5,40*VG_YARDS)
  Dim bGotTarget
  if (aTarget = getPlayer) then
    'Invalid or no targets neraby
    KillNearestTarget = false
  else
    bGotTarget = TargetNearestMob(aTarget)
    'Hit tab once to see if the next closest is it.
    if (bGotTarget = false) then
            bGotTarget = TargetNextMob(aTarget)    
    end if

    if (bGotTarget = false) then
        Log.DebugLog "Could not target mob"
        KilLNearestTarget = false      
    else
        set aTarget = getTarget 'Have to assign vars byref
        if (getTargetHealth = 100) then
            call KillCurrentTarget
             KillNearestTarget = true
        else
             Log.DebugLog "This mob was claimed. (HP<100%)"
             KillNearestTarget = false
        end if
    end if
  end if
end function

function LootTarget
    Sleep LootPause
    if (getTargetID <> 0) then
        Log.DebugLog "Lets try to loot..."
        if (getPlayerDistanceTo(getTarget) < 1000) then 'Dont go too far away (10yards)
            MoveToMob(getTarget)
        end if
        VGSendCommand "/LootAll"
        Sleep LootPause 'Wait for the loot to come in
    end if
end function



function MoveToNextWaypoint
    WP = WP + 1 
    if WP > WAYPOINTS then
        WP = 1
    end if  
    Log.DebugLog " Moving to waypoint -->" & WP & "    " & WAYPOINT_ARRAY(WP-1,0)&  ", " & WAYPOINT_ARRAY(WP-1,1)
    MoveTo WAYPOINT_ARRAY(WP-1,0), WAYPOINT_ARRAY(WP-1,1)
    Sleep WALK 
end function 


'///////////////////////////////////////////////////////
'///                                                 ///
'///               Main Loop
'///                                                 ///
'///////////////////////////////////////////////////////

 
Dim MobCounter
MobCounter = 0

PC = 0
   
'You may have to adjust this if your text doesnt show up
SetKeyDelay 25 'How fast to enter text to VG

BuffMe()

for RunCounter = 1 to MAX_RUNS 'Lets run it for XX loops
        
    if ((KillNearestTarget = true) and (PC = 0))then
        LootTarget
        Sleep LootPause
        MobCounter = MobCounter + 1
    elseif (WAYPOINTS > 1) then
        stopattack = 0
        Sleep WaitForMobs ' Added sleep to help wait for respawns untill adding waypoints
        MoveToNextWaypoint  
   end if
    
    'Check to see if autoattack is still on/turn it off
    if (getPlayerIsAttacking = true) then
        VGSendText AUTO_ATTACK 'Turn off attacking
        VGSendText VGSendEnterKey
        KillCurrentTarget()
    end if

    'Rest up unless we get attacked
    PlayerHealth = getPlayerHealth 'Reset because we just casted a drain spell
    do while ((getPlayerPower < getPlayerMaxPower) and (PlayerHealth <= getPlayerHealth))
        Sleep SitAndMed
    loop

    Log.DebugLog "Finished loop: " & RunCounter & " of " & MAX_RUNS
    'TODO add a ETA counter here to calculate eta for all runs based on current elapsed time
next
I take no original credit for this script. I'm simply trying to improve upon this bot and help in any way I can. With that said, I hope you like what I've tried to come up with here, Antareus. I've changed the code up a bit to be more user friendly. I'm running into some problems though with that issue someone reported .. something about the bot healing over and over. This was happening to me when I would get jumped by a mob (yes, it was in the goodspawns list).. I removed:

Code: Register to unlock hidden link

do while (getPlayerHealth < getPlayerMaxHealth)
        VGSendText HEALING_TOUCH 'Uses Healing Skill
        VGSendText VGSendEnterKey
         Log.DebugLog "[*] Main Loop : Self Healing with Healing Touch" 
    Sleep HealSleep
    loop
From the Main loop and that problem was fixed. Combat was initiated succesfully. If you look at the KillCurrentTarget() Function, the code I put for healing isn't working =/ Neither my Endurance Threshold or HP Threshold code is working. Any idea of what's wrong with it?

There's some other things I was thinking that would be a good idea to add, and other ideas in general I have to implement in the code also, but I'm way tired right now and need a break. I hope you don't mind that I posted this update to your code.[/code]

Ahh, yes

Posted: March 28th, 2007, 8:39 pm
by kryologik
The DEBUFF_USED variable in the debuffs list. I was thinking.. we make an array of the pull spells (debuffs/nukes (smite)) and rank the array indexes accordingly to our preference of pull spells to use. If we detect "You can't do that yet" (spell timer still not up), we attempt to cast the second spell in the array.

Posted: March 30th, 2007, 1:25 pm
by antareus
Hey mate sorry for the slow reply. I've been quite busy lately trying to combine school time with programming hehe.
Anyway I've taken a look at your code and I must admit, It's quite brilliant :P, infact if you wouldn't mind I'd like to continue improving my bots using your code. And if your up for it ( and not too tired :P "Dont worrie I get that feeling a lot too hehe") then maybe we could code it some more together?

Anyway about the bugs you encountered, I've run the script on my account and ofcourse had to change a few things since my paladin is only lvl 12.

First off, the code you removed was a code I added to make the bot heal itself to full health after combat. This was just a "while scripting" idea I had, since I figured that it would be fastter then waiting for your hp to return. But yeah, like you said there were several bugs with it including the "heal over and over" bug. After testing the bot on my char, I don't see any immediate reason as to why I should keep it in, so for now I'll just leave it out.

Now to the code you wrote. You said you had some problems with the HP and Endurance threshold. Well for the endurance I found that you had simply the code:
"If (getPlayerPower <enduranceThreshold> getPlayerPower)and(getPlayerPower <getPlayerMaxHealth> getPlayerPower)" probaly isn't needed in the bot, but I always find it more comforting the more specific an action is. But feel free to remove that if you want to save some code :P. Also since im only lvl 12, I dont have the endurance buff so I havent tried it out to see if it works. However I did try out the HP part ( which I changed the same way as I did with the endurance part) and it seemed to work fine.
Here's what I did for the HP part of the script:
I changed
"const healthThreshold = 80 "
to
"const healthThreshold = .8 "
Just because of the new equation that I was using, where the Max hp would be multiplied by .8, thus giving 80% of max health.

And I changed
"If ( ((getPlayerMaxHealth / getPlayerHealth) * 100) <healthThreshold> getPlayerHealth) and (getPlayerMaxHealth * healthThreshold)> getPlayerHealth)) Then "

Again the "((getPlayerMaxHealth > getPlayerHealth) " probaly isn't needed, but I placed it there just in case :P.

Also I noticed a small typo regarding the health script which was

"Log.DebugLog "[*] Health has fallen below the threshold -- Attempting to cast Healing Touch!"
VGSendText HEALING_TOUCH 'Use healing spell
VGSendText VGSendKeyEnter "

Where the "VGSendText VGSendKeyEnter" is suppose to be "VGSendText VGSendEnterKey".

Finally, I rewrote your critically low health script from:
"If ( ((getPlayerMaxHealth / getPlayerHealth) * 100) <20>= getPlayerHealth) then"

Again I don't have the skill used in this script, so I haven't been able to test it. But I'm pretty sure that it will work. O and dont forget to add :
const CriticalHealth = .2
to get the script to work.

Finally, I did a little tweaking with the combatsleep time, and changed it from 2000 to 2500, im not sure how much of an effect this will have but i found that some skills where being activated before your character was ready to attack again.

Anyway I've included the script which I edited in this post, I call it paladin bot v2.0 ( version 2 since I think it has changed a lot :P ). I wont upload it to the main post till I get your permission though. And don't worry, you will be credited :)

-Antareus

Paladin Update

Posted: March 30th, 2007, 5:00 pm
by kryologik
Hey man,

Been awaiting your response =) I understand about the time issues. I'm studying Pharmacy right now and my Chemistry / Anatomy classes are taking up a lot of time :-X

I'd love to work on this bot with you, I think we can really make something kick-!@#$%^* here. Merge my code with yours and send me a PM so we have a way of keeping in contact =)

Can't wait to start on this with ya man. Take care!

Posted: March 30th, 2007, 5:33 pm
by wyvernx
You should post all updates in the first thread cuz as this discussion gets longer and longer people will miss them.

Posted: March 31st, 2007, 2:14 am
by antareus
wyvernx wrote:You should post all updates in the first thread cuz as this discussion gets longer and longer people will miss them.
Any chance we could get one of those threads where only the developer of the bot can post messages in it? Or is that for mods only? :P.
I'd really love an update thread and a discussion thread.