ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: _C2_ on April 13, 2009, 06:22:33 PM

Title: so i want to see if this is correct to shorten a line
Post by: _C2_ on April 13, 2009, 06:22:33 PM
I discovered that you can only trap chests when they are facing a certain direction.  To amximize the spped of the script the script now notices if the chest is in a trappable position or not and re drops it until it gets it in a trappable position.

now I want to make it handle all the chests so i basically want to make sure this will distribute the argument correctly.

this works for the small crate perfectly:
if #findtype = ZTD
   do redrop stuff

so lets pretend the other crate positions that require redrop are xx1 xx2 xx3 and xx4
can i do this?

if #findtype = ( ZTD || xx1 || xx2 || xx3 || xx4 )

I think that works just been thinking but not had a chance to try it
Title: Re: so i want to see if this is correct to shorten a line
Post by: TrailMyx on April 13, 2009, 06:42:54 PM
Unfortunately that won't work.  You are actually trying to do boolean logic on items that aren't boolean, so you will be evaluating ( ZTD || xx1 || xx2 || xx3 || xx4 ) first before you compare that to #findtype.  And since ZTD, xx1-4 aren't booleans, this will always be false.  The better way to do it would be:

Code: [Select]
if #findtype in ZTD_xx1_xx2_xx3_xx4
Title: Re: so i want to see if this is correct to shorten a line
Post by: _C2_ on April 13, 2009, 07:25:46 PM
sweet!  I tried it and it was not working before i chceked back here.  I knew ther ewas a better way; i just never used it!   THx TM