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

0 Members and 1 Guest are viewing this topic.

Offline Laptop Heat

  • Jr. Member
  • **
  • Posts: 10
  • Activity:
    0%
  • Reputation Power: 1
  • Laptop Heat has no influence.
  • Respect: +5
  • Referrals: 0
    • View Profile
Re: ZLF =[ How to proced?
« Reply #15 on: November 29, 2011, 07:40:46 AM »
0
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. 

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 #16 on: November 29, 2011, 07:58:39 AM »
0
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;

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ZLF =[ How to proced?
« Reply #17 on: November 29, 2011, 08:06:36 AM »
0
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.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Laptop Heat

  • Jr. Member
  • **
  • Posts: 10
  • Activity:
    0%
  • Reputation Power: 1
  • Laptop Heat has no influence.
  • Respect: +5
  • Referrals: 0
    • View Profile
Re: ZLF =[ How to proced?
« Reply #18 on: November 29, 2011, 08:29:21 AM »
0
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.


Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ZLF =[ How to proced?
« Reply #19 on: November 29, 2011, 08:46:07 AM »
0
#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
« Last Edit: November 29, 2011, 08:52:36 AM by Cerveza »
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

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 #20 on: November 29, 2011, 09:35:54 AM »
0
#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.
« Last Edit: November 29, 2011, 09:42:12 AM by HardY- »

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ZLF =[ How to proced?
« Reply #21 on: November 29, 2011, 09:44:43 AM »
0
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
« Last Edit: November 29, 2011, 10:03:22 AM by Cerveza »
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

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 #22 on: November 29, 2011, 10:56:04 AM »
0
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 ....

Offline freddy

  • Sr. Member
  • *
  • Posts: 271
  • Activity:
    0%
  • Reputation Power: 4
  • freddy has no influence.
  • Gender: Male
  • Respect: +37
  • Referrals: 1
    • View Profile
Re: ZLF =[ How to proced?
« Reply #23 on: November 29, 2011, 11:56:08 AM »
0
#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
« Last Edit: November 29, 2011, 12:00:19 PM by freddy »

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ZLF =[ How to proced?
« Reply #24 on: November 29, 2011, 12:30:55 PM »
0
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?
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

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 #25 on: November 29, 2011, 12:46:14 PM »
0
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?

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: ZLF =[ How to proced?
« Reply #26 on: November 29, 2011, 12:58:17 PM »
0
#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

Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline Laptop Heat

  • Jr. Member
  • **
  • Posts: 10
  • Activity:
    0%
  • Reputation Power: 1
  • Laptop Heat has no influence.
  • Respect: +5
  • Referrals: 0
    • View Profile
Re: ZLF =[ How to proced?
« Reply #27 on: November 29, 2011, 01:03:44 PM »
0
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.

 

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ZLF =[ How to proced?
« Reply #28 on: November 29, 2011, 01:27:43 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)
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: ZLF =[ How to proced?
« Reply #29 on: November 29, 2011, 01:49:25 PM »
0
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.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Tags: