Author Topic: [FIXED] finditem ... Am I retarded?  (Read 2891 times)

0 Members and 1 Guest are viewing this topic.

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
[FIXED] finditem ... Am I retarded?
« on: February 10, 2009, 01:10:36 PM »
0
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
« Last Edit: May 07, 2009, 11:36:09 AM by TrailMyx »

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: finditem ... Am I retarded?
« Reply #1 on: February 10, 2009, 01:23:44 PM »
0
change:
if #findtype <> %securetypes

to:
if #findtype notin %securetypes

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: finditem ... Am I retarded?
« Reply #2 on: February 10, 2009, 01:30:21 PM »
0
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

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: finditem ... Am I retarded?
« Reply #3 on: February 10, 2009, 01:48:31 PM »
0
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.

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: finditem ... Am I retarded?
« Reply #4 on: February 10, 2009, 01:51:49 PM »
0
Yikes, another reason why the euo documentation is so lame and minimal. Thanks OMGBurgers.

Tags: