ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: HardY- on November 27, 2011, 07:28:16 PM

Title: ZLF =[ How to proced?
Post by: HardY- on November 27, 2011, 07:28:16 PM
can anyone teach me how i use factbandages on pvp they have a coldown, i want use normal bandage until the timer go out, how i need proced?

Actually on my bandage script i use

finditem ZLF C
if ( #findkind = 0 )
{
set #lobjectid #findid
event macro 17 0
target 1s
event macro 23 0

the problem is, i want make a way to use both bandages (faction and normal) at same time, they have the same id, so its a real problem to me.

I thinked in:

display ok Please target your fact band $
set #targcurs 1
finditem #ltargetid
wait 20
set %factID #ltargetid

display ok Please target your band$
set #targcurs 1
finditem #ltargetid
wait 20
set %bandID #ltargetid

but the point is, how i make a timer, for when i will use normal bands and when i can use faction one again.


Title: Re: ZLF =[ How to proced?
Post by: Cerveza on November 27, 2011, 07:51:21 PM
Property them bandaids.
Title: Re: ZLF =[ How to proced?
Post by: Crome969 on November 27, 2011, 08:12:15 PM
Property them bandaids.
Create 2 Timer, regular Bandages and faction Bandages. Make a loop who first check if time of Faction Bandages is done or not. if done then check Lifepoints, if Lifepoints are hitted then Scan for ZLF, read the Property to select the right Bandages, target yourself and add the "Delay of Factionbandages" on your Factiontimer .Do the Same with your regular bandages\timer
Title: Re: ZLF =[ How to proced?
Post by: dxrom on November 27, 2011, 09:58:12 PM
I love faction bandaids... I use them on my mages ALOT. (for that remove curse)
Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 28, 2011, 07:48:16 AM
ok, i'm doing some changes here, have a way to i use finditem #property ? or Find property?
Title: Re: ZLF =[ How to proced?
Post by: TrailMyx on November 28, 2011, 07:56:40 AM
Check out the docs on EasyUO:

http://wiki.easyuo.com/index.php?title=Event_Property
Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 28, 2011, 08:01:55 AM
Check out the docs on EasyUO:

http://wiki.easyuo.com/index.php?title=Event_Property

Ye i'm reading about and google usage of it, i got the problem of the property of bandage change every usage so i fix that way

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
}


:D

Now i need learn to work with #timer =D, i will search about.
Title: Re: ZLF =[ How to proced?
Post by: Crome969 on November 28, 2011, 08:25:36 AM
Code: [Select]
Sub ScanBandages
Finditem ZLF C_ , #backpackID
if #findkind <> -1
{
for #findindex 1 #findcnt
{
event #property
if #scnt < %Factiontimer && Faction in Property && #scnt < %HealingTimer
{
set %Trigger Faction
set %BandageID #findid
Gosub Execute_Bandage
Break
}
elseif #scnt < %HealingTimer && Faction notin #property
{
set %Trigger Regular
set %BandageID #findid
Gosub Execute_Bandage
Break
}
}
}
Return

Sub Execute_Bandage
if #scnt < %Factiontime && %Trigger  = Faction || #scnt < %HealingTimer && %Trigger  =  Regular
{
set #LtargetKind 1
Set #LobjectID  %BandageID
event macro 17
Target 3s
Event macro 23
set %Healingtimer XXX;Here must come your own Code for Healingdelays
IF %Trigger  =  Faction
{
set %Factiontime #scnt + XXX ;Your Factiondelay
}
Set %Trigger = Default
}
Return
Codelogical could be something like this(Iam sorry no full Code, iam totaly out of Easyuo and didnt have the time to test:%).You Minor prior faction Bandages, and then regular.
Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 28, 2011, 08:33:17 AM
Code: [Select]
Sub ScanBandages
Finditem ZLF C_ , #backpackID
if #findkind <> -1
{
for #findindex 1 #findcnt
{
event #property
if #scnt < %Factiontimer && Faction in Property && #scnt < %HealingTimer
{
set %Trigger Faction
set %BandageID #findid
Gosub Execute_Bandage
Break
}
elseif #scnt < %HealingTimer && Faction notin #property
{
set %Trigger Regular
set %BandageID #findid
Gosub Execute_Bandage
Break
}
}
}
Return

Sub Execute_Bandage
if #scnt < %Factiontime && %Trigger  = Faction || #scnt < %HealingTimer && %Trigger  =  Regular
{
set #LtargetKind 1
Set #LobjectID  %BandageID
event macro 17
Target 3s
Event macro 23
set %Healingtimer XXX;Here must come your own Code for Healingdelays
IF %Trigger  =  Faction
{
set %Factiontime #scnt + XXX ;Your Factiondelay
}
Set %Trigger = Default
}
Return
Codelogical could be something like this(Iam sorry no full Code, iam totaly out of Easyuo and didnt have the time to test:%).You Minor prior faction Bandages, and then regular.

You had a good idea, but i think it won't will work well, for example i'm trying use scanjournal, to do the script, because fixed healing time, change when you got cursed, or use pots.

I will use your %HealingTimer idea to the faction bandage one, but i think i will still using the journal scannr for base healing.
Title: Re: ZLF =[ How to proced?
Post by: Crome969 on November 28, 2011, 08:39:18 AM
When using Journalscanning you must rebuild the IDEA instead of a Timer for 2 Items, make 1 timer..
When hitting the Trigger in Journal and hits check if Factiontimer is down then apply Faction,refresh Factiontimer, else use regular. Instead of kicking all the time the Timer of faction or not. Kick the Journal and apply the Question when hits && Journal allow to proof the trigger:D
Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 28, 2011, 08:43:36 AM
When using Journalscanning you must rebuild the IDEA instead of a Timer for 2 Items, make 1 timer..
When hitting the Trigger in Journal and hits check if Factiontimer is down then apply Faction,refresh Factiontimer, else use regular. Instead of kicking all the time the Timer of faction or not. Kick the Journal and apply the Question when hits && Journal allow to proof the trigger:D

I will try make some changes here, and later i post result, really thanks for the help.
Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 28, 2011, 04:15:34 PM
I finished the script, anyone want test? I'm upgrading my a hardy simple heal 1.0 for 2.0, for allow fact bandage i tested it here on atl, it seen work, i created an YES\NO for use or don't use faction bandies.

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
;==========================================================================

I know the script is a lot confused atm, is because i just "Upgrade" from my old one, but i will start make it more clean.

I don't know why sometimes (rare cases) it try heal on a loop.
Title: Re: ZLF =[ How to proced?
Post by: Laptop Heat on November 28, 2011, 08:39:11 PM
Is there a reason no one has mentioned #FINDCOL ?  This is offhand, but it would look something like this?

Finditem ZLF C_ , #backpackID
if #findkind <> -1
{
 for #findindex 1 #findcnt
 {
  if #FINDCOL = XXXX    ; I don't know the faction color offhand
   gosub FactionBandage
  if #FINDCOL = 0       ; Regular bandage
   gosub RegularBandage
 }

}


With Event Property you can easily move too fast if you have any type of lag and get a "$" (default) value meaning your script  will not see the bandage as a faction bandage.  I don't think it's going to make a huge difference in time, but I would bet #findcol is a little faster since you have to do the finditem anyway.

If you do plan on just using the #Property you might want to write in a holding sub to make sure you give the script enough time to update the variable.  It's been a while since I've written, so if something I've suggested isn't correct please correct me. 

Sub WaitForProperty
set %MaxDelay #Scnt + 2
While #Property = $ && %MaxDelay > #Scnt
wait 1
if #Property = $
 return #False
else
 return #True


Does this make sense?

Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 28, 2011, 09:04:28 PM
Is there a reason no one has mentioned #FINDCOL ?  This is offhand, but it would look something like this?

Finditem ZLF C_ , #backpackID
if #findkind <> -1
{
 for #findindex 1 #findcnt
 {
  if #FINDCOL = XXXX    ; I don't know the faction color offhand
   gosub FactionBandage
  if #FINDCOL = 0       ; Regular bandage
   gosub RegularBandage
 }

}


With Event Property you can easily move too fast if you have any type of lag and get a "$" (default) value meaning your script  will not see the bandage as a faction bandage.  I don't think it's going to make a huge difference in time, but I would bet #findcol is a little faster since you have to do the finditem anyway.

If you do plan on just using the #Property you might want to write in a holding sub to make sure you give the script enough time to update the variable.  It's been a while since I've written, so if something I've suggested isn't correct please correct me. 

Sub WaitForProperty
set %MaxDelay #Scnt + 2
While #Property = $ && %MaxDelay > #Scnt
wait 1
if #Property = $
 return #False
else
 return #True


Does this make sense?



Why make 2 If findcol, isn't better for the euox make if and else, so it will use regular bands and enhanted(nofact) ones, but i like the idea of findcol
Title: Re: ZLF =[ How to proced?
Post by: Crome969 on November 29, 2011, 02:51:23 AM
Is there a reason no one has mentioned #FINDCOL ?  This is offhand, but it would look something like this?

Finditem ZLF C_ , #backpackID
if #findkind <> -1
{
 for #findindex 1 #findcnt
 {
  if #FINDCOL = XXXX    ; I don't know the faction color offhand
   gosub FactionBandage
  if #FINDCOL = 0       ; Regular bandage
   gosub RegularBandage
 }

}


With Event Property you can easily move too fast if you have any type of lag and get a "$" (default) value meaning your script  will not see the bandage as a faction bandage.  I don't think it's going to make a huge difference in time, but I would bet #findcol is a little faster since you have to do the finditem anyway.

If you do plan on just using the #Property you might want to write in a holding sub to make sure you give the script enough time to update the variable.  It's been a while since I've written, so if something I've suggested isn't correct please correct me. 

Sub WaitForProperty
set %MaxDelay #Scnt + 2
While #Property = $ && %MaxDelay > #Scnt
wait 1
if #Property = $
 return #False
else
 return #True


Does this make sense?



Findcol means you havnt coloured regular bandages, else you may could have a problem;)
Title: Re: ZLF =[ How to proced?
Post by: Laptop Heat on November 29, 2011, 07:40:46 AM
If you use #Findcol with a IF...ELSE statement then it wouldn't matter what color you made your bandages.  I have never even seen a faction bandage, but if for some reason you color your regular bandages the same color as your faction bandages then this will give you an issue.

The IF... ELSE comment would definitely make it a better bit of code, thanks for suggesting that. 
Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 29, 2011, 07:58:39 AM
i will try with findcol, but first i need know what i did wrong, why sometimes the script i did some posts above try to heal a lot of times in a loop;
Title: Re: ZLF =[ How to proced?
Post by: Cerveza on November 29, 2011, 08:06:36 AM
Here's my take.

Findcol *might* not be right.
#property will ALWAYS be right.

I don't believe there is any kind of speed issue between the two, so I would recommend doing an event property on all the bandages you have and using the ones with "Faction" or whatever wording is different.
Title: Re: ZLF =[ How to proced?
Post by: Laptop Heat on November 29, 2011, 08:29:21 AM
I had a looting script that would return $ as property every now and then and it would skip the corpse.  I put in a small wait and it seemed to fix it, but that might not have been the issue.  Why would #FINDCOL ever be wrong?  Kind of confused about that.  The Finditem has to be done regardless and all the information is there already processed so it seems redundant to do an event property on top of that.

Title: Re: ZLF =[ How to proced?
Post by: Cerveza on November 29, 2011, 08:46:07 AM
#FINDCOL will always return the correct information about what color something is. What I'm saying is that the bandage color may not be what you are looking for. Aren't Faction bandages dyable?

If the color of faction bandages can change, then #findcol will never find them, correct? Will the name ever change? Thus #property > #findcol.

Something that will never change, like ORE for example would be an excellent use of #findcol.

Code: [Select]
sub PropertyPwnsFindcol
finditem ZLF C_ , #backpackID
if #findCnt > 0
  {
  event Property #findID
  if faction in #property
    {
    msg Hey look, faction bandages $
    msg Maybe I should do whatever it was I wanted to do with them $
    return
    }
  msg Hey look, bandages that are NOT faction bandages $
  msg I'm just going to ignore these things and move on $
  ignoreitem #findID
  }
msg Didn't find any bandages, sorry $
return
Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 29, 2011, 09:35:54 AM
#FINDCOL will always return the correct information about what color something is. What I'm saying is that the bandage color may not be what you are looking for. Aren't Faction bandages dyable?

If the color of faction bandages can change, then #findcol will never find them, correct? Will the name ever change? Thus #property > #findcol.

Something that will never change, like ORE for example would be an excellent use of #findcol.

Code: [Select]
sub PropertyPwnsFindcol
finditem ZLF C_ , #backpackID
if #findCnt > 0
  {
  event Property #findID
  if faction in #property
    {
    msg Hey look, faction bandages $
    msg Maybe I should do whatever it was I wanted to do with them $
    return
    }
  msg Hey look, bandages that are NOT faction bandages $
  msg I'm just going to ignore these things and move on $
  ignoreitem #findID
  }
msg Didn't find any bandages, sorry $
return

Hmm, you show to us another way of do the check in tree =) , with your example is just add   if faction in #property && %counter < #scnt then inside the counter just add set %counter #scnt + 14 (the timer is 18 but if you was max dex you still need 4 seconds to do the next bandage so 14 is fine.

My one actually isn't that clean

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

For example Cerveza at your way don't have a chance of 50% in the first bandage it use normal bandage without the faction one even if the timer is right ?

because you finditem first then only after make the find property, if the first search isn't the right one (faction), it will use normal bandage, to after try again the faction, and if you are unlucky again and again you never will use the faction right?

Not sure about euox interpreters, but at first read i thinked on that.
Title: Re: ZLF =[ How to proced?
Post by: Cerveza on November 29, 2011, 09:44:43 AM
Oh, if you want to include a timer... easy enough.

Code: [Select]
set %timer_bandage #sCnt ; set the timer in the script setup

sub PropertyPwnsFindcol
finditem ZLF C_ , #backpackID
if #findCnt < 1 || if %timer_bandage > #sCnt
  return ; no bandages OR timer hasn't completed, go home
event Property #findID ; bandages are found, lets examine them with event property
if faction in #property
  {
  msg Hey look, faction bandages $
  msg Maybe I should do whatever it was I wanted to do with them $
  ; use bandages here
  set %timer_bandage ( #sCnt + 12 ) ; ONLY set the timer if you use a bandage, which is here
  return
  }
msg Hey look, bandages that are NOT faction bandages $
msg I'm just going to ignore these things and move on $
ignoreitem #findID
return
Title: Re: ZLF =[ How to proced?
Post by: Crome969 on November 29, 2011, 10:56:04 AM
What Cerveza explained is exactly what i mean. Not only Faction Bandages may could be coloured, regular as well. Every time you ask for a color,and it could be a minimum chance it will be making issues. For a short code just to run maybe okay but when you want it 100% stable #property is the best way. Other alternatives would be different bags:) Example: Regular bandages main Bag, Faction Bandages other Bag then you never will need property and\or Findcol ....
Title: Re: ZLF =[ How to proced?
Post by: freddy on November 29, 2011, 11:56:08 AM
#findcol will work just fine if you know what the colors are, and if this script is for yourself, then you don't really need to worry about errors since you'll also be setting the known colors yourself.

As for event property, if you're worried about speed issues, set the lpc higher than default.

o and nice way to be an ass about it cerveza
Title: Re: ZLF =[ How to proced?
Post by: Cerveza on November 29, 2011, 12:30:55 PM
Quote from: freddy
o and nice way to be an ass about it cerveza

How am I "being an ass" freddy?

Findcol is very useful for some things. Ore, lumber etc... items that will never be a different color. I mention that. I also go on to mention that things that *can* change color wouldn't be the best things to identify with #findcol as the item may not be the color you are looking for. I also explain that #property will always be there, even if the item has changed color.

If it's just for yourself, then I'd recommend NEVER CARRYING ANYTHING EXCEPT FACTION BANDAGES - then you never have to worry about any other type of ZLF items, right?
Title: Re: ZLF =[ How to proced?
Post by: Crome969 on November 29, 2011, 12:46:14 PM
o and nice way to be an ass about it cerveza

Sorrry i dont understand your issue here. Cerv only tried to show a other way and explained advantages and disadvantages. Maybe his writing style isnt comparing to a peaceful Flower Guy, but all around he is fully right.
You always can say "Okay i will make it with this and that" and you must compare your speed with the fact,you dont want to have a failing script.
When you say "Okay i never will share the script or i never will use coloured bandages" then findcol is enough or even the findtype when you seperate the bandages.On the other side #property is a more safe method to declare all these "possible" Cases. it doesnt matter if your bandaids are pink,red,gray,blue in end as long as "Faction" in #property you will find. And if you do "If #findcol = xxxx" or "If Faction in #property" dont really matter in the code... or am i totaly wrong?
Title: Re: ZLF =[ How to proced?
Post by: manwinc on November 29, 2011, 12:58:17 PM
#Findcol is Fine, I don't think You can Dye Faction bandis. And I think anyone who spends the time DYING their Faction Bandis Shouldn't be Pvp'ing anyways.
Code: [Select]

set %Faction_Timer #Systime


Repeat
if #hits < #Maxhits || C In #charstatus
{
Finditem ZLF C_ , #backpackid
if #findcnt = 0
Halt
set %Faction_Bandis N/A
For #findindex 1 #findcnt
{
if #Findcol = XXXX ; Faction bandis
set %Faction_Bandis #Findid
Else
Set %Normal_Bandage #Findid
}
if %Faction_Timer < #Systime && %Faction_Bandis <> N/A
set %Bandages %Faction_Bandis
Else
Set %Bandages %Normal_Bandage
Gosub Apply #Charid %Bandages
if %Faction_Bandis = %Bandages
set %Faction_Timer #Systime + 8500
}
until Leprachauns = Rainbows

Title: Re: ZLF =[ How to proced?
Post by: Laptop Heat on November 29, 2011, 01:03:44 PM
Just curious...

Why would you ever color bandages or faction bandages? 

I agree, if you want a %100 success and you want to color your bandages rainbow Event Property is the only 100% way of doing it.

Maybe I should look back through my script I had an issue with #property not instantly updating.  I might have overlooked something else.

If the difference in time between doing 1 finditem and a for loop with IF...ELSE isn't noticeably faster than doing 1 finditem, a for loop, 2 event properties and the IF...ELSE statements to go along with that then I would prefer going by the #Property variable.  Any Bandage script I had was always within other script and usually needed to be as quick and efficient as possible, but it doesn't matter how fast it is if it's not going to give you the result you need every time no matter what. 

Different strokes for different folks.

 
Title: Re: ZLF =[ How to proced?
Post by: Cerveza on November 29, 2011, 01:27:43 PM
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 (http://www.scriptuo.com/index.php?topic=20.0) 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)
Title: Re: ZLF =[ How to proced?
Post by: manwinc on November 29, 2011, 01:49:25 PM
I think you are missing one Fact Cerveza.

Faction bandi's have an 8 second timer. Not the HEAL timer, But an 8 second timer between being able to use them. Hence why he wants to use both.
Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 29, 2011, 02:37:09 PM
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 (http://www.scriptuo.com/index.php?topic=20.0) 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
Title: Re: ZLF =[ How to proced?
Post by: Crome969 on November 29, 2011, 08:59:11 PM
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
Title: Re: ZLF =[ How to proced?
Post by: camotbik on November 30, 2011, 06:52:16 AM
what about bandage timer? ))
Title: Re: ZLF =[ How to proced?
Post by: Crome969 on November 30, 2011, 06:57:08 AM
what about bandage timer? ))
Regular bandages and Faction bandages can be "triggered" via Journal, as the author said.:)
Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 30, 2011, 01:16:06 PM
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.
Title: Re: ZLF =[ How to proced?
Post by: camotbik on November 30, 2011, 07:59:19 PM
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.
Title: Re: ZLF =[ How to proced?
Post by: Crome969 on November 30, 2011, 08:48:55 PM
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.
Title: Re: ZLF =[ How to proced?
Post by: HardY- on November 30, 2011, 08:54:29 PM
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
Title: Re: ZLF =[ How to proced?
Post by: camotbik on December 01, 2011, 05:24:25 AM
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