euo multi-function heal script

Discussion about the technical aspects of scripting. Ask about all issues involving your freelance projects here.
Locked
krystol
Elder Scribe
Posts: 133
Joined: Tue Oct 12, 2010 12:07 am

euo multi-function heal script

Post by krystol »

Code: Select all

;==================================
; Script Name:  Aids & Pots 
; Author: Fleona
; Version: 2.0.1
; Client Tested with: 4.0.6a (should work for all)
; EUO version tested with: 1.42
; Shard OSI /
; Revision Date: 3/4/11
; Public Release: 1/14/08
; Global Variables Used: n/a
; Purpose: Auto Use Bandaids+++
;==================================
set %pottype GHpots ;GCpots="Use Greater Cure" GHpots="Use Greater Heal"
set %hp_limit 70 ;set health to use pots at
set %stamina_DF 50 ;set stamina lost for divine fury
set %aids_delay 3 ;increase for lag, 0-3 is ideal
set %peace_delay 100

;-------Setup weapon speicals-----------------
; delete ";" from beginning of next line, run script, then put ";" back.. u are ready
;gosub setupWepSpecials

;-------DO NOT EDIT BELOW THIS----------------
;initiate Variables
set #LPC 75
set %AutoDF Off ; On/Off
set %AutoPot Off ; On/Off
set %AutoPeace Off ; On/Off
set %wepAbility Off
set %aids_timer #SCNT2
set %pot_timer #SCNT2
set %peace_timer #SCNT2
set %aid_type ZLF
set %Gheal_pot UUF
set %Gcure_pot NUF
set %instr PGP_MQF_LQF_PRF_QRF_NRF
set #MENUBUTTON 0
set %active 4860358_5386718_5384662_4336061 ;

gosub showEUOMenu1
;-------MainLoop begins here--------------
_Mainloop:
onhotkey 1 alt
   gosub togwepAbilityPrimary
onhotkey 2 alt
   gosub togwepAbilitySecondary
onhotkey 3 alt
   gosub togwepAbilityOff
if #MENUBUTTON <> 0
   gosub #MENUBUTTON
if #CHARGHOST = yes || H in #CHARSTATUS
   goto _Mainloop
if #HITS < #MAXHITS || C in #CHARSTATUS
   gosub aids
if %AutoPot = On
      gosub %pottype
if %AutoPeace = On
   gosub peace
if %wepAbility <> Off && #MANA >= 40
{
  if %wepAbility = Primary
     gosub prime
  else
     gosub secondary
}
if %AutoDF = On
   gosub autoDF
if #MENUBUTTON = CLOSED
   halt
goto _Mainloop
;-------MainLoop ends here----------------

;===========SUBS==============================
;---------------------------------
sub aids
set %timeleft %aids_timer - #SCNT2
;if C in #CHARSTATUS && %timeleft < 15 && %timeleft > 5
   ;gosub CureSelf
if #SCNT2 <= %aids_timer
   return
finditem %aid_type C_ , #BACKPACKID
if #FINDKIND < 0
   return
event macro 1 0 [bandself
set %delay_calc ( ( 1225 - ( #DEX * 5 ) ) / 10 ) + %aids_delay
set %aids_timer #SCNT2 + %delay_calc
return

;---------------------------------
sub togAutoPot
if %Autopot = On
    set %Autopot Off
else
     set %Autopot On
menu delete togAutoPot
menu Button togAutoPot 8 8 45 21 Pot %Autopot
set #menubutton 0
return

;---------------------------------
sub GHpots
  if #SCNT2 <= %pot_timer
     return
  if #HITS > %hp_limit
     return
  finditem %Gheal_pot C_ , #BACKPACKID
  if #FINDKIND = -1
     return
  set %potid #FINDID
  if C in #CHARSTATUS
     gosub CureSelf
  ;wait 5
  ;event macro 24 2
  wait 5
  set #LOBJECTID %potid
  event macro 17 0
  set %pot_timer #SCNT2 + 130
return

;---------------------------------
sub GCpots
if #SCNT2 <= %pot_timer
   return
if #HITS > %hp_limit
   return
if C notin #CHARSTATUS
   return
finditem %Gcure_pot C_ , #BACKPACKID
if #FINDKIND = -1
   return
set %potid #FINDID
;event macro 24 2
wait 10
set #LOBJECTID %potid
event macro 17 0
set %pot_timer #SCNT2 + 5
return

;---------------------------------
sub togAutoPeace
if %AutoPeace = On
    set %AutoPeace Off
else
     set %AutoPeace On
menu delete togAutoPeace
menu Button togAutoPeace 8 33 100 21 Peace %AutoPeace
set #menubutton 0
return

;---------------------------------
sub peace
if #SCNT2 <= %peace_timer
   return
finditem %instr C_ , #BACKPACKID
if #FINDKIND <> 0
   return
set #LOBJECTID #FINDID
event macro 17 0
wait1
event macro 13 9
target 2s
event macro 23 0
set %peace_timer #SCNT2 + %peace_delay
return

;---------------------------------
sub togAutoDF
if %AutoDF = On
    set %AutoDF Off
else
     set %AutoDF On
menu delete togAutoDF
menu Button togAutoDF 60 8 45 21 DF %AutoDF
set #menubutton 0
return

;---------------------------------
sub autoDF
set %staminaloss #MAXSTAM - #STAMINA
if %staminaloss <= %stamina_DF || #HITS < 60 || #MANA < 50
   return
event macro 15 205 [cs divinefury
wait 10
return

;---------------------------------
sub togwepAbilityOff
set %wepAbility Off
set #menubutton 0
event ExMsg #charID 3 0 %wepAbility
wait 2
return

;---------------------------------
sub togwepAbilityPrimary
set %wepAbility Primary
set #menubutton 0
event ExMsg #charID 3 0 %wepAbility
wait 2
return

;---------------------------------
sub togwepAbilitySecondary
set %wepAbility Secondary
set #menubutton 0
event ExMsg #charID 3 0 %wepAbility
wait 2
return

;---------------------------------
sub prime
if #MANA < 40
   return
savePix 980 629 1
;savePix 980 672 1 edited line
wait 2
if #PIXCOL notin %active
   event macro 35 0
return

;---------------------------------
sub secondary
if #MANA < 40
   return
savePix 980 629 1
wait 2
if #PIXCOL notin %active
   event macro 36 0
return

;---------------------------------
sub CureSelf
  event macro 15 10 ;cure=10 cbfire=201
  target 15
  event macro 23 0
  wait 2
return

;---------------------------------
sub showEUOMenu1
   menu Clear
   menu Window Title ~
   menu Window Transparent 75
   menu Window Color black
   menu Window Size 80 85
   menu Font Name MS Sans Serif
   menu Font Transparent #false
   menu Font Align left
   menu Font Size 8
   menu Font Color white
   menu Font Style
   menu Font BGColor Green
  menu Button togAutoPot 8 8 45 21 Pot %Autopot
  menu Button togAutoDF 60 8 45 21 DF %AutoDF
  menu Button togAutoPeace 8 33 100 21 Peace %AutoPeace
   menu Button togwepAbilityOff 8 58 30 21 Off
   menu Button togwepAbilityPrimary 43 58 30 21 Prm
   menu Button togwepAbilitySecondary 76 58 30 21 2nd
  menu Show 720 0
   menu HideEUO
return

;---------------------------------
sub setupWepSpecials
  event macro 8 14
  while #CONTKIND <> AIUC
  {
  event macro 8 14
  wait 2s
  }
  while #CONTPOSX <> 200 && #CONTPOSY <> 200
  {
   contpos 200 200
   wait 2s
  }
  click 440 325 g
  wait 10
  click 1000 690 mc
  wait 10
  click 440 370 g
  wait 10
  click 1000 647 mc
  halt
return
Last edited by krystol on Sat Mar 05, 2011 1:24 pm, edited 1 time in total.
User avatar
Adrias
Legendary Scribe
Posts: 426
Joined: Tue Sep 07, 2010 10:34 pm

Re: euo multi-function heal script

Post by Adrias »

so tl;dr for us who don't want to read through the script?
krystol
Elder Scribe
Posts: 133
Joined: Tue Oct 12, 2010 12:07 am

Re: euo multi-function heal script

Post by krystol »

dunno what you mean. but, maybe its this. there are a few editable lines:

;==================================
set %pottype GHpots ;GCpots="Use Greater Cure" GHpots="Use Greater Heal"
set %hp_limit 70 ;set health to use pots at
set %stamina_DF 50 ;set stamina lost for divine fury
set %aids_delay 3 ;increase for lag, 0-3 is ideal
set %peace_delay 100

;-------Setup weapon speicals-----------------
; delete ";" from beginning of next line, run script, then put ";" back.. u are ready
;gosub setupWepSpecials

i retested the script and found the the primary ability was broken again after i had it working so i edited it again with what i fixed it with.
i loaded uo then euo with script without messing with the script where it tells you to delete the ; run stop reinsert ; and it worked fine. i have also seen it not work, stop script run and then it worked without revision, but it may be necessary to do atleast once.

is that what you were looking for adrias?
User avatar
Adrias
Legendary Scribe
Posts: 426
Joined: Tue Sep 07, 2010 10:34 pm

Re: euo multi-function heal script

Post by Adrias »

Was looking more for a synopsis of what the script does and what the point of it is
krystol
Elder Scribe
Posts: 133
Joined: Tue Oct 12, 2010 12:07 am

Re: euo multi-function heal script

Post by krystol »

if you just run the script it will use bandaids whenever you have less then max hp at the max speed you can band-aid.
the menu toggles on/off : [ potions , divine fury -these can be altered ], auto peace, weapon abilites on/off, prim,second
User avatar
Yoda
Legendary Scribe
Posts: 813
Joined: Thu Feb 24, 2011 11:38 am
Location: Canada

Re: euo multi-function heal script

Post by Yoda »

I love this script.. a tonne
Guildmaster: JDI - Est 2011
User avatar
Pentaur
Journeyman Scribe
Posts: 20
Joined: Sun Oct 23, 2011 11:04 am
Location: Rhode Island, Usa

Re: euo multi-function heal script

Post by Pentaur »

I tried this script and enjoyed it a bunch. So I started thinking about some things I would add to it yet keep it simple and clean like the original. Here's my modifications.

First I changed the healing with bandaids to Blazin Healer. I found I was going through too many bandaids for simple things. Blazin Healer allowed me to set it to 75% of my Hp's before kicking in (which is what it's set at in my modifications). It also used bandaids from anywhere in my inventory and not from just my main pack.

Second I added an auto pet res accept (I think it's Kiana's) that I found buried in the coding section. There's no toggle button or anything it just clicks yes when you have to res a pet.

Third I added one more button down at the bottem for Dram's Automount script...It can be toggled off when you need to use stealth to get around but will remount you if you get knocked off your ride. It's set to my mount but can easily be changed to whatever your Ethereal mount(line 18) and backpack ID(line 151) is. Currently it says Mount N/A when you first load it but once you press the button it runs fine (I'm not a coder or anything and most of this is just cut/paste from other scripts) so I'm not sure on how to fix that but it runs well and doesn't seem to hinder anything.

All in all a great script. I went from running 6-7 scripts at one time down to 3 (sometimes 2 when I go w/o the pets)...So much nicer when recovering from a crash and a lot easier to keep track of all the things going on at once. Much kudoes to Fleona for putting in the work.

Pertinart

Code: Select all

                             ;==================================
; Script Name:  Aids & Pots
; Author: Fleona
; Version: 2.0.1
; Client Tested with: 4.0.6a (should work for all)
; EUO version tested with: 1.42
; Shard OSI /
; Revision Date: 3/4/11
; Public Release: 1/14/08
; Global Variables Used: n/a
; Purpose: Auto Use Bandaids+++
;==================================
set %pottype GHpots ;GCpots="Use Greater Cure" GHpots="Use Greater Heal"
set %hp_limit 75 ;set health to use pots at
set %stamina_DF 50 ;set stamina lost for divine fury
set %aids_delay 3 ;increase for lag, 0-3 is ideal
set %peace_delay 100
set %mount PSCGGWD ;set etheral mount here
set %HP 75
set %pause 1
;-------Setup weapon speicals-----------------
; delete ";" from beginning of next line, run script, then put ";" back.. u are ready
;gosub setupWepSpecials

;-------DO NOT EDIT BELOW THIS----------------
;initiate Variables
set #LPC 75
set %AutoDF Off ; On/Off
set %AutoPot Off ; On/Off
set %AutoPeace Off ; On/Off
set %wepAbility Off
set %aids_timer #SCNT2
set %pot_timer #SCNT2
set %peace_timer #SCNT2
set %aid_type ZLF
set %Gheal_pot UUF
set %Gcure_pot NUF
set %instr PGP_MQF_LQF_PRF_QRF_NRF
set #MENUBUTTON 0
set %active 4860358_5386718_5384662_4336061 ;

gosub showEUOMenu1
;-------MainLoop begins here--------------
_Mainloop:
onhotkey 1 alt
   gosub togwepAbilityPrimary
onhotkey 2 alt
   gosub togwepAbilitySecondary
onhotkey 3 alt
   gosub togwepAbilityOff
if #MENUBUTTON <> 0
   gosub #MENUBUTTON
if #CHARGHOST = yes || H in #CHARSTATUS
   goto _Mainloop
if ( #hits * 100 ) / #maxhits <= %HP || C in #charstatus
   gosub aids
if #CONTSIZE = 275_150 && #CONTKIND = GJZ
   gosub petRes
if %AutoPot = On
   gosub %pottype
if %AutoMnt = On
   gosub AutoMnt
if %AutoPeace = On
   gosub peace
if %wepAbility <> Off && #MANA >= 40
{
  if %wepAbility = Primary
     gosub prime
  else
     gosub secondary
}
if %AutoDF = On
   gosub autoDF
if #MENUBUTTON = CLOSED
   halt
goto _Mainloop
;-------MainLoop ends here----------------

;===========SUBS==============================
;---------------------------------
sub aids
 {
  event macro 1 0 [bandself
  set %time ( 11 - ( #dex / 20 ) ) * 20
  if %time < 5
    set %time 5
  wait %time + %pause
  }
;---------------------------------
sub petRes

{
    set %x #CONTPOSX + 62
    set %y #CONTPOSY + 115
    ;click at +62 +115
    click %x %y DMC
    wait 10
}

;----------------------------
sub GHpots
  if #SCNT2 <= %pot_timer
     return
  if #HITS > %hp_limit
     return
  finditem %Gheal_pot C_ , #BACKPACKID
  if #FINDKIND = -1
     return
  set %potid #FINDID
  if C in #CHARSTATUS
     gosub CureSelf
  ;wait 5
  ;event macro 24 2
  wait 5
  set #LOBJECTID %potid
  event macro 17 0
  set %pot_timer #SCNT2 + 130
return

;---------------------------------
sub GCpots
if #SCNT2 <= %pot_timer
   return
if #HITS > %hp_limit
   return
if C notin #CHARSTATUS
   return
finditem %Gcure_pot C_ , #BACKPACKID
if #FINDKIND = -1
   return
set %potid #FINDID
;event macro 24 2
wait 10
set #LOBJECTID %potid
event macro 17 0
set %pot_timer #SCNT2 + 5
return
;----------------------
sub togAutoMnt
if %AutoMnt = On
    set %AutoMnt Off
else
     set %AutoMnt On
menu delete togAutoMnt
menu Button togAutoMnt 8 83 100 21 Mnt %AutoMnt
set #menubutton 0
return

;---------------------------------
sub AutoMnt
finditem %mount c_ZUCISND    ;;;Put your Backpacks ID here (should read C_ITEMID)

     if #findkind <> -1
     {
          set #lobjectid %mount
          set #ltargetid #findid
          event macro 17
          return
     }
return

;---------------------------------
sub togAutoPeace
if %AutoPeace = On
    set %AutoPeace Off
else
     set %AutoPeace On
menu delete togAutoPeace
menu Button togAutoPeace 8 33 100 21 Peace %AutoPeace
set #menubutton 0
return

;---------------------------------
sub peace
if #SCNT2 <= %peace_timer
   return
finditem %instr C_ , #BACKPACKID
if #FINDKIND <> 0
   return
set #LOBJECTID #FINDID
event macro 17 0
wait1
event macro 13 9
target 2s
event macro 23 0
set %peace_timer #SCNT2 + %peace_delay
return

;---------------------------------
sub togAutoDF
if %AutoDF = On
    set %AutoDF Off
else
     set %AutoDF On
menu delete togAutoDF
menu Button togAutoDF 60 8 45 21 DF %AutoDF
set #menubutton 0
return

;---------------------------------
sub autoDF
set %staminaloss #MAXSTAM - #STAMINA
if %staminaloss <= %stamina_DF || #HITS < 60 || #MANA < 50
   return
event macro 15 205 [cs divinefury
wait 10
return

;---------------------------------
sub togwepAbilityOff
set %wepAbility Off
set #menubutton 0
event ExMsg #charID 3 0 %wepAbility
wait 2
return

;---------------------------------
sub togwepAbilityPrimary
set %wepAbility Primary
set #menubutton 0
event ExMsg #charID 3 0 %wepAbility
wait 2
return

;---------------------------------
sub togwepAbilitySecondary
set %wepAbility Secondary
set #menubutton 0
event ExMsg #charID 3 0 %wepAbility
wait 2
return

;---------------------------------
sub prime
if #MANA < 40
   return
savePix 980 629 1
;savePix 980 672 1 edited line
wait 2
if #PIXCOL notin %active
   event macro 35 0
return

;---------------------------------
sub secondary
if #MANA < 40
   return
savePix 980 629 1
wait 2
if #PIXCOL notin %active
   event macro 36 0
return

;---------------------------------
sub CureSelf
  event macro 15 10 ;cure=10 cbfire=201
  target 15
  event macro 23 0
  wait 2
return

;---------------------------------
sub showEUOMenu1
   menu Clear
   menu Window Title ~
   menu Window Transparent 75
   menu Window Color black
   menu Window Size 80 110
   menu Font Name MS Sans Serif
   menu Font Transparent #false
   menu Font Align left
   menu Font Size 8
   menu Font Color white
   menu Font Style
   menu Font BGColor Green
  menu Button togAutoPot 8 8 45 21 Pot %Autopot
  menu Button togAutoDF 60 8 45 21 DF %AutoDF
  menu Button togAutoPeace 8 33 100 21 Peace %AutoPeace
   menu Button togwepAbilityOff 8 58 30 21 Off
   menu Button togwepAbilityPrimary 43 58 30 21 Prm
   menu Button togwepAbilitySecondary 76 58 30 21 2nd
  menu Button togAutoMnt 8 83 100 21 Mount %AutoMnt
  menu Show 720 0
   menu HideEUO
return

;---------------------------------
sub setupWepSpecials
  event macro 8 14
  while #CONTKIND <> AIUC
  {
  event macro 8 14
  wait 2s
  }
  while #CONTPOSX <> 200 && #CONTPOSY <> 200
  {
   contpos 200 200
   wait 2s
  }
  click 440 325 g
  wait 10
  click 1000 690 mc
  wait 10
  click 440 370 g
  wait 10
  click 1000 647 mc
  halt
return
User avatar
Devlin
Legendary Scribe
Posts: 652
Joined: Thu Mar 18, 2010 12:50 pm

Re: euo multi-function heal script

Post by Devlin »

This is basically healR and my rearmer combined it appears. But it also has pots and casts spells, meaning it has a lot of potential to cause death, either from casting, pausing you while running, removing shield when you least expect it, etc.

Also a couple coding issues.
use return at the end of a sub
the weapon ability stuff has no mention of HOW to edit the line, just that it is a custom line.
this line "if #PIXCOL notin %active" should be "cmppix 1 t" Goes with the savepix command and works wonders.
Resident Wiki Editor/Village Idiot

EasyUO Scripts
ReArmer
ReArmer (Old Version)
ReReader
Separate Journal for Guild or Public Chat (Old)
---------------------------------------------
Combat Focus Guide (Godmode Formula)
User avatar
Yoda
Legendary Scribe
Posts: 813
Joined: Thu Feb 24, 2011 11:38 am
Location: Canada

Re: euo multi-function heal script

Post by Yoda »

I don't use the functions for weapon ability that often I admit
Guildmaster: JDI - Est 2011
User avatar
Yoda
Legendary Scribe
Posts: 813
Joined: Thu Feb 24, 2011 11:38 am
Location: Canada

Re: euo multi-function heal script

Post by Yoda »

bumped so dramoor can laugh
Guildmaster: JDI - Est 2011
User avatar
Agony
Legendary Scribe
Posts: 244
Joined: Wed Dec 01, 2010 1:10 am

Re: euo multi-function heal script

Post by Agony »

Hey Krystol, I love your script! Thanks!
...Dimiir Borgu
Locked