ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Superslayer on February 10, 2009, 01:10:36 PM

Title: [FIXED] finditem ... Am I retarded?
Post by: Superslayer on February 10, 2009, 01:10:36 PM
Code: [Select]
set %securetypes CKF_UXM_TXM_AUD_CUD_HKF_SPF_GRL_FRL_KUD_LKF
 display ok Please target the secure for your regs and/or scrolls.
 retarget:
 set #targcurs 1
 while #targcurs = 1
 wait 0
 finditem #ltargetid
 if #findtype <> %securetypes
 {
  display ok Container not supported. Please target again.
  goto retarget
 }
bla bla

Either everything is not supported, or everything is ...really WTF
Title: Re: finditem ... Am I retarded?
Post by: OMGBurgers on February 10, 2009, 01:23:44 PM
change:
if #findtype <> %securetypes

to:
if #findtype notin %securetypes
Title: Re: finditem ... Am I retarded?
Post by: Superslayer on February 10, 2009, 01:30:21 PM
That worked buy why?  In another sub of mine, I use "<>" when finding runebooks and other books.  Does it really vary that much from item type to type?

Thanks by the way, now I can get the whiskey  :P
Title: Re: finditem ... Am I retarded?
Post by: OMGBurgers on February 10, 2009, 01:48:31 PM
It worked because the string you're comparing (#findtype) will always and only be a single value/type.  The string you're comparing it to houses many different values/types which means it will never equal.  So instead you just want to see if one value is contained within the other instead of looking for equality.

I do it all the time where I can't figure out why, then I see I have notin/<> or something used when I should be using the other haha.
Title: Re: finditem ... Am I retarded?
Post by: Superslayer on February 10, 2009, 01:51:49 PM
Yikes, another reason why the euo documentation is so lame and minimal. Thanks OMGBurgers.