Wow, I've been up all night because CEO let me die, and here is what I've come up with.
I started with the popular CEO Medic as a basis, and got about 10 minutes in before I rage quit and started from scratch. I have tried to keep ALL unnecessary code out of my script to make it as fast as possible.
I intend to use this script whilst solo'ing Lady M with my sampire. But I'm sure it could be used in many more environments.
Still 1-2 things to yet be added, but have a play and let me know what ya think so far.
To Do List:
1. Add pause for paralysis
;==================================
; Script Name: Reaper's Dexxer Healer
; Author: The Reaper
; Version: 1.0
; Client Tested with: 7.0.10.3
; EUO version tested with: 1.5.186
; Purpose: Heal your lazy ass on freeshards.
; Should work on OSI servers also.
; Special thanks to CEO for his CEOMedic
; and a couple of other short snippets of code.
; Also thanks to Nilmer's Speedy Menu Builder
;==================================
; The red level is the % health at which you want chivalry to heal,
; otherwise it will default to bandages.
; The yellow level is the % stamina at which chivalry will divine fury
set %red 35
set %yellow 70
initevents
event Macro 8 2 ;open status bar
wait 20
set #contPosX 850
set #contPosY 400
chooseskill chiv
if #skill < 600
{
display ok You having a laugh, a PvE dexxer with no chiv, rofl.
halt
}
chooseskill heal
if #skill < 1000
{
display ok Come on, this isn't a healing trainer, get at least GM healing.
halt
}
set %yellowhp ( ( ( #maxhits * 10 ) * %yellow / 100 ) ) / 10 )
set %redhp ( ( ( #maxhits * 10 ) * %red / 100 ) ) / 10 )
set %yellowstam ( ( ( #maxstam * 10 ) * %yellow / 100 ) ) / 10 )
set %redstam ( ( ( #maxstam * 10 ) * %red / 100 ) ) / 10 )
set %yellowmana ( ( ( #maxmana * 10 ) * %yellow / 100 ) ) / 10 )
set %redmana ( ( ( #maxmana * 10 ) * %red / 100 ) ) / 10 )
set %lasthp 0
set %laststam 0
set %lastmana 0
; Current OSI bandage delay
; This one seems to be the current formula now, if heals overlap increment 11 by 1 until they don't
set %aid_delay ( 11 - #dex / 20 ) * 10
gosub InitMenu
;Main Script Body
;===========================================
Loop:
gosub Health
gosub Stamina
gosub UpdateStatus
gosub pausebutton
goto Loop
sub Health
if #hits = #maxhits
{
menu font color black
menu delete action
menu font bgcolor lime
menu text action 50 35 Ok
return
}
if #hits < %redhp
{
if C in #charstatus
{
menu font color red
menu delete action
menu font bgcolor yellow
menu text action 50 35 Oooohhh *bleep*, poisoned AND nearly dead.
repeat
{
event macro 15 201
target 2s
event macro 23 0
wait 10
}
until C <> #charstatus
}
}
if #hits < %redhp
{
menu font color red
menu delete action
menu font bgcolor yellow
menu text action 50 35 Last ditched attempt to save your ass!
event macro 15 202
target 2s
event macro 23 0
}
if #scnt2 < %usenextaid
{
return
}
if C in #charstatus
{
finditem ZLF C
if #findkind <> -1
{
menu font color black
menu delete action
menu font bgcolor yellow
menu text action 50 35 Poisoned (Aids)
set #lobjectid #findid
event macro 17 0
target 1s
event macro 23 0
set %usenextaid ( #scnt2 + %aid_delay )
return
}
}
if #hits < #maxhits
{
finditem ZLF C
if #findkind <> -1
{
menu font color black
menu delete action
menu font bgcolor yellow
menu text action 50 35 Healing (Aids)
set #lobjectid #findid
event macro 17 0
target 1s
event macro 23 0
set %usenextaid ( #scnt2 + %aid_delay )
}
}
return
sub Stamina
if #mana < 15
{
return
}
if #stamina < %yellowstam
{
event macro 15 205
wait 10
}
return
sub pausebutton
if #menubutton <> N/A
{
menu delete pausebutton
menu text color black
menu button pausebutton 0 60 330 20 Resume
set #menubutton N/A
gosub ResumeButton
}
return
sub ResumeButton
repeat
{
wait 1
}
until #menubutton <> N/A
menu delete pausebutton
menu font bgcolor red
menu button pausebutton 0 60 330 20 Pause
set #menubutton N/A
return
sub UpdateStatus
gosub CkHp
gosub CkStam
gosub CkMana
return
sub CkHp
if %lasthp = #hits
{
return
}
menu font bgcolor lime
if #hits < %yellowhp
{
menu font bgcolor yellow
}
if #hits < %redhp
{
menu font bgcolor red
}
menu delete hp
menu font color black
menu text hp 28 5 #hits , / , #maxhits
set %lasthp #hits
return
sub CkStam
if %laststam = #stamina
{
return
}
menu font bgcolor lime
if #stamina < %yellowstam
{
menu font bgcolor yellow
}
if #stamina < %redstam
{
menu font bgcolor red
}
menu delete stamina
menu font color black
menu text stamina 243 5 #stamina , / , #maxstam
set %laststam #stamina
return
sub CkMana
if %lastmana = #mana
{
return
}
menu font bgcolor lime
if #mana < %yellowmana
{
menu font bgcolor yellow
}
if #mana < %redmana
{
menu font bgcolor red
}
menu delete mana
menu font color black
menu text mana 127 5 #mana , / , #maxmana
set %lastmana #mana
return
;Menu Sub
sub InitMenu
menu clear
Menu hideEUO
Menu window size 330 80
Menu show
Menu window color black
Menu font bgcolor red
Menu font size 10
menu Window Title The Reaper's PvE Dexxer Auto-Healer
menu button pausebutton 0 60 330 20 Pause
menu font color red
Menu font bgcolor blue
menu text Thp 5 5 HP:
menu text Tmana 90 5 Mana:
menu text Tstamina 190 5 Stamina:
menu text Taction 5 35 Action:
menu font bgcolor lime
menu font color black
menu text hp 28 5 #hits , / , #maxhits
menu text mana 127 5 #mana , / , #maxmana
menu text stamina 243 5 #stamina , / , #maxstam
menu text bgcolor orange
menu text Tchar 200 35 Character:
menu text char 262 35 #charname
menu text action 50 35 Ok
set #menubutton N/A
menu show 850 600
wait 30
gosub UpdateStatus
return
PS - Nilmer has a speedy menu builder that really helped me with this, since I've never actually made my own menu's from scratch before, definitely work a look.
PPS - Have fun!!