Author Topic: ZLF =[ How to proced?  (Read 11477 times)

0 Members and 1 Guest are viewing this topic.

Offline HardY-Topic starter

  • Full Member
  • ***
  • Posts: 237
  • Activity:
    0%
  • Reputation Power: 3
  • HardY- has no influence.
  • Gender: Male
  • Respect: +16
  • Referrals: 3
    • View Profile
Re: ZLF =[ How to proced?
« Reply #30 on: November 29, 2011, 02:37:09 PM »
0
Well, like I said in my last...

If you only carry faction bandages, and only intend to carry faction bandages, then none of this matters. Just find ZLF and it MUST be faction bandages, because that's all you ever carry.

As to a 12 second wait... well there are much better ways around that.

There is a formula you can use to determine bandage time. The problem with that method is that the timer is based on your stats (dex) which can change. If it changes while you are applying the bandage, then the timer will be longer then you anticipated before you applied the bandage.

The method that is better to use would be a journal scanning method. There are a few messages to look for, but easily scripted.

Have a look at ScriptUO Healing Commander which is basically a showcase for TM's journal scanning tools.

Oh yeah... Do it NOW you twit!

Have to keep up the ass persona.

(See freddy, that's being an ass, oh wait... so is this  :P)

My scripts is allready working with my changes, i posted it some lines above, the point is faction bandages have a 18s timer between the time you start heal and the time you can heal again, it don't change with dex, so i'm using a journal scanner, that i make on my A hardy simple heal from 2007, and using now faction bandage, then between delay for use again, it will use the normal bandage one.

Its the script
Code: [Select]
;=========================================================================;
; Script Name: A HardY Simple Bandage Healer                              ;
; Author: A HardY                                                         ;
; Version: 2.0                                                            ;
; Shard OSI/FS: OSI/FS                                                    ;
; Revision Date: 29-nov-2011                                              ;
; Purpose: Auto Heal with bandages using                                  ;
;     Journal timer                                                       ;                                          ;
;=========================================================================;
;You need The statusbar open or it don't work.
;You only need Bands to work, it will search when you lose hp, become bleed,
;and will heal yourself.
;************************
;==========================================================================
;Set Variables
;==========================================================================
set %started You_begin_applying_the_bandages
set %healed You_finish_applying_the_bandages
set %failed You_apply_the_bandages
set %nulled You_heal_what_little_damage_your
set %nodam That_being_is_not_damaged
set %bleed The_bleeding_wounds_have
set %faction Any_curses_on_you_have_been_lifted
set %warnonlow 0
set %warnamount 10
set %Factiontime #scnt
set %Factionbandage NO ; yes / no
;==========================================================================
; Check for Logged in, Status Bar and DMC
;==========================================================================
checkingame:
if ( #cliLogged = 0 )
{
wait 1
goto checkingame
}

if ( DMC notin #opts )
{
display ok ERROR!$
+This script requires "Don't move cursor" enabled!$
+Enable this option in the EasyUO Tools menu and$
+restart the script.$
halt
}
wait 2s
if ( #MAXHITS = N/A )
{
event macro 8 2
}
;==========================================================================
;Start the script
;==========================================================================
start:
wait 1
if ( #hits = #maxhits && c notin #charstatus && #charghost = NO )
{
goto start
}
;==========================================================================
; Death Support
; If dead, wait to be rezzed, then start over.
;==========================================================================
if ( #charghost = YES )
{
stilldead:
if ( #charghost = NO )
{
  goto start
}
wait 1
goto stilldead
}
;==========================================================================
; Begin the act of bandaging self
; If enabled, warn user if low on bandages
;==========================================================================
finditem ZLF C
if #findkind <> -1
{
for #findindex 1 #findcnt
{
if #scnt > %Factiontime && %Factionbandage = YES
{
event Property #findID
set %factband #findstack , #spc , Enchanted , #spc ,
if %factband in #property
 {
  set #lobjectid #findid
  event macro 17 0
  target 1s
  event macro 23 0
  ; set %Factiontime #scnt + 12
 } ; if %factband in #property
} ;if #scnt > %Factiontime
else
{
event Property #findID
set %factband #findstack , #spc , Clean , #spc ,
if %factband in #property
 {
  set #lobjectid #findid
  event macro 17 0
  target 1s
  event macro 23 0
  } ; if %factband in #property
} ; Else
} ; for #findindex 1 #findcnt
} ; if #findkind <> -1
if ( %warnonlow = 1 && %warnamount >= #findstack )
{
  event ExMsg #lobjectID 3 38 Low on bandaids!
}
wait 1
goto didwestart
}
;==========================================================================
; If no bandages found, wait for more to arrive
; If enabled, warn user of no bandages
;==========================================================================
if ( %warnonlow = 1 )
{
event ExMsg #charID 3 38 Out of Bandages!
}

startlooking:
finditem ZLF C
if ( #findkind = 0 )
{
goto start
}
;==========================================================================
; The everpresent check-for-death routine
if ( #charghost = YES )
{
goto start
}
;==========================================================================
wait 1
goto startlooking
;==========================================================================
; Check the journal to ensure we started healing
; #jIndex provides dynamic 1-way searching
;==========================================================================
didwestart:
wait 1
set %jend #jIndex
for %r %jstart %jend
{
scanjournal %r
if ( %started in #journal && :__ notin #journal )
{
  set %failsafe #SCNT + 13
  set %jstart #jIndex
  goto areyoudoneyet
}
}

;==========================================================================
; The everpresent check-for-death routine
if ( #charghost = YES )
{
goto start
}
;==========================================================================

;If we failed to start healing, start over
goto start

;==========================================================================
; Healing started, start checking if we are done healing.
; Search in both directions
;==========================================================================

areyoudoneyet:
set %now #SCNT
;==========================================================================
; The everpresent check-for-death routine
if ( #charghost = YES )
{
goto start
}
;==========================================================================

wait 1
set %jend #jIndex

for %r %jstart %jend
{
scanJournal %r
if ( %faction in #journal )
{
  set %Factiontime #scnt + 14
  if ( : notin #journal )
  {
  goto start
  }
}
if ( %healed in #journal || %failed in #journal || %nulled in #journal || %nodam in #journal || %bleed in #journal )
{
  if ( : notin #journal )
  {
  goto start
  }
}
}
;if we have been healing for more than 12 seconds, break out of the loop.
;added to guard against against possible looping bug
if ( %now > %failsafe )
{
goto start
}
;If not done, keep checking
goto areyoudoneyet
;==========================================================================
; End of File
;==========================================================================

Any idea to make it clean and smarter i would appreciate. Its the way i find to use the bandages

Code: [Select]
finditem ZLF C
if #findkind <> -1
{
for #findindex 1 #findcnt
{
if #scnt > %Factiontime && %Factionbandage = YES
{
event Property #findID
set %factband #findstack , #spc , Enchanted , #spc ,
if %factband in #property
 {
  set #lobjectid #findid
  event macro 17 0
  target 1s
  event macro 23 0
  ; set %Factiontime #scnt + 12
 } ; if %factband in #property
} ;if #scnt > %Factiontime
else
{
event Property #findID
set %factband #findstack , #spc , Clean , #spc ,
if %factband in #property
 {
  set #lobjectid #findid
  event macro 17 0
  target 1s
  event macro 23 0
  } ; if %factband in #property
} ; Else
} ; for #findindex 1 #findcnt
} ; if #findkind <> -1

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: ZLF =[ How to proced?
« Reply #31 on: November 29, 2011, 08:59:11 PM »
0
Code: [Select]
Finditem ZLF C ;No Backpackonly?
if #findkind <> -1 {
for #findindex 1 #findcnt {
if #scnt > %Factiontime && Factionbandage = YES{
event property #findid
if Enchanted in #property{
set #lobjectID #findid
event macro 17
target ;Default 3s if you would have lagg at the targeting moment, no missing of bandage
event macro 23
set %Factiontime #scnt + 12
break ;Break trough the for loop
}
}
Else{
if Clean in #property{
set #lobjectID #findid
event macro 17
target ;Default 3s if you would have lagg at the targeting moment, no missing of bandage
event macro 23
break ;Break trough the for loop
}
}
}
}
just a small Idea

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: ZLF =[ How to proced?
« Reply #32 on: November 30, 2011, 06:52:16 AM »
0
what about bandage timer? ))
What you witness -- is whatver..
uogamers hybrid.

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: ZLF =[ How to proced?
« Reply #33 on: November 30, 2011, 06:57:08 AM »
0
what about bandage timer? ))
Regular bandages and Faction bandages can be "triggered" via Journal, as the author said.:)

Offline HardY-Topic starter

  • Full Member
  • ***
  • Posts: 237
  • Activity:
    0%
  • Reputation Power: 3
  • HardY- has no influence.
  • Gender: Male
  • Respect: +16
  • Referrals: 3
    • View Profile
Re: ZLF =[ How to proced?
« Reply #34 on: November 30, 2011, 01:16:06 PM »
0
Code: [Select]
Finditem ZLF C ;No Backpackonly?
if #findkind <> -1 {
for #findindex 1 #findcnt {
if #scnt > %Factiontime && Factionbandage = YES{
event property #findid
if Enchanted in #property{
set #lobjectID #findid
event macro 17
target ;Default 3s if you would have lagg at the targeting moment, no missing of bandage
event macro 23
set %Factiontime #scnt + 12
break ;Break trough the for loop
}
}
Else{
if Clean in #property{
set #lobjectID #findid
event macro 17
target ;Default 3s if you would have lagg at the targeting moment, no missing of bandage
event macro 23
break ;Break trough the for loop
}
}
}
}
just a small Idea

I will use your routine, only now i'm starting to understand how break is useful =D, i will make a test today ( i will do a champ alone) then i post if is stop my loop issue.

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: ZLF =[ How to proced?
« Reply #35 on: November 30, 2011, 07:59:19 PM »
0
I dont know why you want to work with journal, coz in any way, there should be a bandage delay that doesnt change.. Right?
Code: [Select]
set %bandagetimer #scnt
set %Factiontime #scnt
repeat
  gosub Bandageself
  wait 1
until = #false

Sub BandageSelf
  if #hits < #maxhits && #scnt > %bandagetimer
  {
    finditem ZLF C_
    for #findindex 1 #findcnt
    {
      event property #findid
      if Enchanted in #property && #scnt > %Factiontime
      {
        set #lobjectid #findid
        set %Factiontime #scnt + 12
        break
      }
      set #lobjectid #findid
    }
    if #findcnt > 0
    {
      event macro 17
      target
      event macro 23
      set %bandagetimer #scnt + 12
    }
  }
return

Update: Right. Now I remembered that you got bleed on OSI shards, so that's why you use the journal. Well it's easy to implement a journal scan in there. Just write if you need help with that.
ps; your gotos make your script hard to read.. you could use subs to make it more readable.
« Last Edit: November 30, 2011, 08:13:18 PM by camotbik »
What you witness -- is whatver..
uogamers hybrid.

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: ZLF =[ How to proced?
« Reply #36 on: November 30, 2011, 08:48:55 PM »
0
Gotos make it hard to convert it later in other scriptlanguanges(Openuo as Example) As best is replace Gotos with repeat .. until. and when not need anymore break through with break or "reach" the until.

Offline HardY-Topic starter

  • Full Member
  • ***
  • Posts: 237
  • Activity:
    0%
  • Reputation Power: 3
  • HardY- has no influence.
  • Gender: Male
  • Respect: +16
  • Referrals: 3
    • View Profile
Re: ZLF =[ How to proced?
« Reply #37 on: November 30, 2011, 08:54:29 PM »
0
Gotos make it hard to convert it later in other scriptlanguanges(Openuo as Example) As best is replace Gotos with repeat .. until. and when not need anymore break through with break or "reach" the until.

This break help a lot

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: ZLF =[ How to proced?
« Reply #38 on: December 01, 2011, 05:24:25 AM »
0
I took a closer look at your journal scaning block it looks kind of F up.. This example doesnt contain all the messages it's just a way to show you how to use journal scaning in a secure way. ( i added the brackets to 1liners, so you would understand(if you got problems with them)).
Code: [Select]
set %_jindex #jindex
set %HealingFlag #false
set %heal_timeout #sCnt + 6
repeat
  if #jindex >= %_jindex
  {
    scanjournal %_jindex
    if state in #journal
    {
      set %mortal #true
      set %healingflag #true
    }
    if not_damaged in #journal ||  must_wait in #journal || #scnt > %heal_timeout
    {
      set %healingflag #true
    }
    if you_finish_applying in #journal || stop_the_bleeding in #journal || little in #journal
    {
      set %healingflag #true
    }
    set %_jindex %_jindex + 1
  }
until %HealingFlag = #true
« Last Edit: December 01, 2011, 05:26:04 AM by camotbik »
What you witness -- is whatver..
uogamers hybrid.

Tags: