Author Topic: TrailMyx's Subroutine collection foro OEUO - Includes FINDITEM!  (Read 26717 times)

0 Members and 1 Guest are viewing this topic.

Offline NObama

  • 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: +325
  • Referrals: 2
    • View Profile
Re: TrailMyx's Subroutine collection foro OEUO - Includes FINDITEM!
« Reply #15 on: October 14, 2010, 06:27:55 PM »
+1
Ok - making a little more sense.  What I can't understand is why this code executed several times, then abruptly stopped working:

Code: [Select]
dofile("tm_subs_collection8.lua")
temp = {}
count = 0
count, temp = TM_FindItemsByID(4102)
if count > 0 then
print(count)
end

Now, when I run I just get "Stopped."

Also, the result it was returning before (133) did not accurately count all the POF in the nearby containers.  

EDIT:  Ah ha!  I must have closed containers.  This doesn't count inside closed containers, apparently...is that intended, TM?

« Last Edit: October 14, 2010, 06:31:47 PM by NObama »

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • 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: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: TrailMyx's Subroutine collection foro OEUO - Includes FINDITEM!
« Reply #16 on: October 14, 2010, 06:32:00 PM »
+1
So it worked how many times?
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline NObama

  • 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: +325
  • Referrals: 2
    • View Profile
Re: TrailMyx's Subroutine collection foro OEUO - Includes FINDITEM!
« Reply #17 on: October 14, 2010, 06:33:09 PM »
+1
I worked until I closed all the containers on screen (logged out/logged back in due to inactivity).  See edit above.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • 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: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: TrailMyx's Subroutine collection foro OEUO - Includes FINDITEM!
« Reply #18 on: October 14, 2010, 06:34:58 PM »
+1
That's probably a problem with prior then.  Add that to the bug list.
FindItemsByID is a very simple sub.
« Last Edit: October 14, 2010, 06:37:05 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • 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: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: TrailMyx's Subroutine collection foro OEUO - Includes FINDITEM!
« Reply #19 on: October 15, 2010, 08:19:52 AM »
+1
Iterating through a table and extracting the index and item is just a Lua idiom, so just snuggled up with a Lua book for a few minutes and read up on "pairs" or "ipairs".

Anyway, I posted a few examples in the other thread.  Should be useful.
« Last Edit: October 19, 2010, 03:32:44 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • 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: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: TrailMyx's Subroutine collection foro OEUO - Includes FINDITEM!
« Reply #20 on: October 29, 2010, 07:42:36 AM »
+1
Updated to version 9.  Fixed a timer bug.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Superslayer

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +100
  • Referrals: 0
    • View Profile
Re: TrailMyx's Subroutine collection foro OEUO - Includes FINDITEM!
« Reply #21 on: November 01, 2010, 04:11:10 PM »
+1
nvrmind...to drunk again..
« Last Edit: November 01, 2010, 11:19:50 PM by Superslayer »

Offline smokinjoe26

  • Jr. Member
  • **
  • Posts: 25
  • Activity:
    0%
  • Reputation Power: 1
  • smokinjoe26 has no influence.
  • Respect: +2
  • Referrals: 0
    • View Profile
Re: TrailMyx's Subroutine collection foro OEUO - Includes FINDITEM!
« Reply #22 on: March 04, 2012, 05:58:13 AM »
+1
I realize that this is an old topic and OpenEUO is a forgotten cause.  Although, while working with it.  I have found the following when running the below script ...

Code: [Select]
UO.TargCurs = true
wait(100)
while (UO.TargCurs == true) do
  wait(5000)
  print("Target the item you want info on")
end
local obtype = UO.LTargetID
for i = 0, UO.ScanItems(true) do
  local id,type,kind,contid,x,y,z,stack,rep,col = UO.GetItem(i)   
  if id == obtype then
    local name, info = UO.Property(id)
    print ('i = item number ' .. i .. ' in scan items')
    print('name:'..name, 'info:'..info)
    print("the id is:"..id, "the type is:"..type, "the kind is:"..kind, "the contid is:"..contid, "the x coordinate is:"..x, "the y coordinate is:"..y, "the z coordinate is:"..z, "the stack amount is:"..stack, "the rep is:"..rep, "the col is:"..col)
  end
end

I checked my runebook with this and got the following printed result:

i = item number 0 in scan items
name:Runebook
info:Exceptional
Blessed
Weight: 1 Stone
BOD
the id is:1160486928
the type is:8901
the kind is:0
the contid is:1135523425
the x coordinate is:877
the y coordinate is:536
the z coordinate is:0
the stack amount is:0
the rep is:0
the col is:1121


Basically, what I am getting at and what it boils down to is that the subs collections was not scanning the item numbered zero for one of the find item functions.  Mainly pertaining to UO.GetItem(val).  UO.GetItem starts at zero.  I am not sure why but it does.  My character attempting to get bods would not use his runebook because it was UO.GetItem number zero.  Others may ave this same problem.  Just providing potentially useful info is all ... I am not sure if TM wants to mess with this or not.

I changed all of these:
i=1,UO.ScanItems
To these:
i=0,UO.ScanItems

Happy scripting to all.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • 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: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: TrailMyx's Subroutine collection foro OEUO - Includes FINDITEM!
« Reply #23 on: March 04, 2012, 09:57:51 AM »
+1
I apologize for that.  I've had that fixed in my version for a LONG time now.  I don't know why I never posted it.  Thank you for point it out to everyone - I'll update this thread with the latest version.  Thanks smokinjoe!
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: OEUO Tools