Author Topic: Why the *bleep* isn't this working...  (Read 8319 times)

0 Members and 1 Guest are viewing this topic.

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Why the *bleep* isn't this working...
« on: December 24, 2010, 02:02:46 PM »
0
This makes me want to scream.  It was working, then it stopped.  Argh.

Code: [Select]
  display ok Now, target the container$ with unfilled deeds in your pack
  set #TARGCURS 1
  repeat
  until #TARGCURS = 0
  set %deedbag #LTARGETID
  finditem EWH C_ , %deedbag ; Deeds
  if #FINDKIND = -1
  {
    display ok No Commodity deeds.$Please get some.
    halt
  }

Keep getting -1 on #findkind...why? WHY!

And before you ask, YES there are deeds in there and YES the item type is EWH.

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Why the *bleep* isn't this working...
« Reply #1 on: December 24, 2010, 02:21:35 PM »
0
if the container is not preopened... it will tell you no deeds becasue u never last object it t open it

Offline Dixie Wrecked

  • Full Member
  • ***
  • Posts: 124
  • Activity:
    0%
  • Reputation Power: 3
  • Dixie Wrecked has no influence.
  • Gender: Male
  • Respect: +31
  • Referrals: 1
    • View Profile
Re: Why the *bleep* isn't this working...
« Reply #2 on: December 24, 2010, 02:25:25 PM »
0
Tested code and it worked fine (looked fine, but never trust my own eyes!).  The only other thing that I can think of right now besides having an unopened container is not having EUO set to the right client, which is something I do all the time, especially when I have all 4 accounts scripting at once.
"hmm, theres no examples and directions sticky in new member intros.  you have to admit script library would have been a good place to put it"
- karrde

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Why the *bleep* isn't this working...
« Reply #3 on: December 24, 2010, 02:42:21 PM »
0
if the container is not preopened... it will tell you no deeds becasue u never last object it t open it

Give the man a prize.  Thanks C2.

Scrripty

  • Guest
Re: Why the *bleep* isn't this working...
« Reply #4 on: December 24, 2010, 05:32:05 PM »
0
It's also more proper to use if #findcnt > 0 instead of #findkind.

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Why the *bleep* isn't this working...
« Reply #5 on: December 24, 2010, 06:55:31 PM »
0
It's also more proper to use if #findcnt > 0 instead of #findkind.

Okay.  Why?

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: Why the *bleep* isn't this working...
« Reply #6 on: December 24, 2010, 07:08:34 PM »
0
Well think about it logically. 

Finditems in a container
Okay if the kind returns its not in a container then great. What?

Or better yet
If the number of that item in the container is 0

I never understoodwhat the point of findkind is.
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 _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Why the *bleep* isn't this working...
« Reply #7 on: December 24, 2010, 07:09:15 PM »
0
It is more of a preference between scripters.  I don't think that there is any particular reason that it is better.  I use them interchangably depending on if there is a remote chance that  I will find more than one.  in your case... there will never be more than one secure.  If you were looking for many items and started by using findkind... you next step might be if findcnt.  then findindex.  

You code is fine either way.  maddog uses findcnt religiously as does endless i believe.  tm uses findkind a lot.  both are stable especially in your case.  findcnt > 0 is basically the same thing as findkind <> -1 except that now you start with the count

Scrripty

  • Guest
Re: Why the *bleep* isn't this working...
« Reply #8 on: December 24, 2010, 07:59:25 PM »
0
Cheffe - "#Findkind is not the preferred method to check whether an item was found or not because it is harder for humans to debug. Please use #FINDCNT instead, whenever possible." 

Offline Dixie Wrecked

  • Full Member
  • ***
  • Posts: 124
  • Activity:
    0%
  • Reputation Power: 3
  • Dixie Wrecked has no influence.
  • Gender: Male
  • Respect: +31
  • Referrals: 1
    • View Profile
Re: Why the *bleep* isn't this working...
« Reply #9 on: December 24, 2010, 08:02:13 PM »
0
Cheffe - "#Findkind is not the preferred method to check whether an item was found or not because it is harder for humans to debug. Please use #FINDCNT instead, whenever possible." 

Hmmmm...so if I can get some monkeys to do my coding for me, I can have them use #FINDKIND?  One more reason I need a monkey army!!!
"hmm, theres no examples and directions sticky in new member intros.  you have to admit script library would have been a good place to put it"
- karrde

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +144
  • Referrals: 1
    • View Profile
Re: Why the *bleep* isn't this working...
« Reply #10 on: December 24, 2010, 09:11:35 PM »
0
Cheffe - "#Findkind is not the preferred method to check whether an item was found or not because it is harder for humans to debug. Please use #FINDCNT instead, whenever possible." 

Hmmmm...so if I can get some monkeys to do my coding for me, I can have them use #FINDKIND?  One more reason I need a monkey army!!!

This is prolly true since Monkeys use a different way of debugging !! So us humans better not use #FindKind !!


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: Why the *bleep* isn't this working...
« Reply #11 on: December 24, 2010, 09:21:18 PM »
0
Army of Monkeys!!!!!!!!!!!!

ARMY OF HELL MONKEYS!!!!!!!!!!!BUAHAHAHAHAHAHAHAHAHAHAHAHAHAH

They are actually in the works!
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 TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Why the *bleep* isn't this working...
« Reply #12 on: December 24, 2010, 09:57:52 PM »
0
Try to open the bag before you search.  As for findcnt vs. Findkind? Potato, potato. 6 or 1/2 dozen. Tomato, tomato.  Just because Cheffe says so, doesn't make it gospel. Use whatever works and whatever your comfortable using.

Edit:
Ah, I see you got the right suggestion below.  Darn phone surfin
« Last Edit: December 24, 2010, 10:04:39 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: Why the *bleep* isn't this working...
« Reply #13 on: December 24, 2010, 10:27:41 PM »
0
Try to open the bag before you search.  As for findcnt vs. Findkind? Potato, potato. 6 or 1/2 dozen. Tomato, tomato.  Just because Cheffe says so, doesn't make it gospel. Use whatever works and whatever your comfortable using.

Edit:
Ah, I see you got the right suggestion below.  Darn phone surfin

I'll choose to use things the way they're designed and at the developers request over a users suggestion every time. :)  It's much simpler to use #findcnt, easier for a noob to understand.  Use #findcnt.  It's the future.  It's less letters also.  So a tad faster overall.  I win. :)

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Why the *bleep* isn't this working...
« Reply #14 on: December 24, 2010, 11:19:46 PM »
0
I switched to #findcnt halfway through the script, just to confuse everybody.

So there.

 :P

Script is done.  I will never commoditify anything by hand ever again.  I will, however, continue to invent new words as the whim takes me.  Post it as soon as TM grants me my own script section. 

(going to be a lonely script until I LEARN HOW TO DO ARRAYS)
« Last Edit: December 24, 2010, 11:21:42 PM by NObama »

Tags: