Author Topic: Can someone help me with OpenEUO script? I think Backpack ID is the problem.  (Read 15876 times)

0 Members and 1 Guest are viewing this topic.

Offline Dan123The123ManTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Activity:
    0%
  • Reputation Power: 1
  • Dan123The123Man has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Ok this is an OpenEUO script and when I try to run the script I press play and I get this:

ENs BuffBar subs loaded
Running On
[17:43:00] Scanning the icon position of Whirlwind Attack.
...p\openeuo\scripts\sub_monster_function.lua:588: attempt to perform arithmetic on global 'nS' (a nil value)



The info is below along with the line 588:

""
function ItemInBag()
name,info = UO.Property(UO.BackpackID)
nS = string.find(info, "Contents: ")
nE = string.find(info, " Items")
sT = string.sub(info,nS+10,nE) <--- Line 588 in script.
nE = string.find(sT,"/")
sT = string.sub(sT,0,nE-1)
if tonumber(sT) ~= nil then
return tonumber(sT)
end
end

function InitItem()
if ItemInBag() > 120 then
print("["..GetTimeFormat().."] Your backpack almost full.")
return "loadoff"
end


""

Ok I asked someone for help with it and they said that it sounds like it has to do with my backpack and I guess the ID. They told me to hover over my backpack to see what it says and it says:

"Backpack
Weight: 17 Stones
Contents: 11/125 Items, 14/550 Stones"

They told me to put the "print(info)" in the script below and press F7 to see where the script breaks at

function ItemInBag()
pause()
name,info = UO.Property(UO.BackpackID)
print (info)
nS = string.find(info, "Contents: ")
print (nS)
nE = string.find(info, " Items")
print (nE)
sT = string.sub(info,nS+10,nE)
print (sT)
nE = string.find(sT,"/")
sT = string.sub(sT,0,nE-1)
print (sT)
if tonumber(sT) ~= nil then
return tonumber(sT)
end



then I playd the script and pressed F7 and it stopped at this line:


t = ScanItems(true,{Type=8901,ContID=UO.BackpackID})



Another person told me to paste this and play it in OpenEUO:


print("bpid: "..tostring(UO.BackpackID))
local t0,t1 = getticks(),0
local name, info = UO.Property(UO.BackpackID)
while ( string.len(tostring(info)) < 10 ) and
      ( t1 < 10 )                         do
  wait(50)
  name, info = UO.Property(UO.BackpackID)
  t1 = t1 + 1
end
print("msec: "..tostring(getticks()-t0))
print("name: "..tostring(name))
print("info: "..tostring(info))



The same person said I should get something back that says something like:

bpid: 1077213918
msec: 70
name: Backpack
info: Weight: 88 Stones
Contents: 32/125 Items, 85/550 Stones

"this person" also said ""this will test whether openeuo is able to read some key variables like backpackid, and how long it takes to populate the info portion of the object's property. sometimes it is empty on the first pass, in which case the code you're using will halt with an error like what you described in your first post. in other words nS may indeed be set to nil on this line:

nS = string.find(info, "Contents: ")

and the rest of the function doesn't take that into account.""




The results I got after hitting play were:

"bpid: 0
msec: 640
name:
info:
"


Can someone help me figure this out?
« Last Edit: December 06, 2015, 10:54:29 AM by Dan123The123Man »

Offline Tidus

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
0
It would be easier to read your post if you put the code into Code tags. 
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline Dan123The123ManTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Activity:
    0%
  • Reputation Power: 1
  • Dan123The123Man has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
0
is it easier to read now?


EDIT: Gah I just realized this was posted under the EasyUO section... Can someone move this to the OpenEUO section, or it doesnt matter I mean if someone from EasyUO would know about OpenEUO it doesnt matter to me.
« Last Edit: December 06, 2015, 11:47:24 AM by Dan123The123Man »

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
0
It really doesn't matter but I did move it for you, might as well keep OEU with OEU :)

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
0
long time since i did any openeuo....  so of no help but glad to see my OpenEUO Buffbar code is getting some use
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Tags: