Author Topic: chest weight check sub  (Read 2636 times)

0 Members and 1 Guest are viewing this topic.

Offline GemviperTopic starter

  • Sr. Member
  • *
  • Posts: 481
  • Activity:
    0%
  • Reputation Power: 0
  • Gemviper hides in shadows.
  • Respect: +57
  • Referrals: 2
    • View Profile
chest weight check sub
« on: November 09, 2015, 04:24:37 AM »
0
Hello,

I'm trying to work out a sub to drag a chest only if a)it's not empty and b) it's not too heavy for me to hold and I'm running into a couple of problems that I'm sure have already been solved(looked but didn't find).

Problem #1 - Maxweight
It seems that the maxweight found by easyuo and the actual maxweight in game are different? Example: if my max weight is 555, which exceeds the maxweight of my pack(550), easyuo is reporting my maxweight as being only 495, can I fix that?

Problem #2 - the math
I'm trying to set my current weight in a sub and to check container weight before dragging only if the combination of the two do not exceed maxweight. I've spent a good 3 hours trying and testing this tonight but can't get it just right, does someone have a rock solid "drag only if I can carry it" public sub?

Ideally I'd like to check both weight AND item number count but have it be as lightweight a sub as possible. I'll work on the item count check after I'm happy with the weight checks.

Offline Biza

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 1
  • Biza has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: chest weight check sub
« Reply #1 on: November 11, 2015, 07:06:50 AM »
0
Quote
Note:   This variable will not work unless the character status bar is open. You can use Event Macro 8 2 to open it from your script.

Cheffe wrote:
MaxWeight is a calculated value. It may differ from shard to (free-)shard based on their rules.

If the value is not right, just calculate your own based on your stats.

Basically cheffe is busy with life and never bothered to fix strong back after it was added in.

Code: [Select]
set %Strongback HS_IS
 
gosub Fatty
 
sub Fatty
if #CHARTYPE in %Strongback
set %Maxweight #maxweight + 60
else
set %Maxweight #maxweight
return

Use that in every older script ive ran, have no issues.


Edit: its also wise to take into account gear your wearing, you can do this by subtracting your normal carry weight from maxweight and using that number as #maxweight. Most scripts that use material handling also have a weight offset as a safety feature to combat lag causing you to go overweight. If your not moving then you can use the container max weight of 550 stones.

Edit: Edit: AAAAANNNDDD also keep in mind your character weighs 14 stones.

http://www.uoguide.com/Weight
« Last Edit: November 11, 2015, 07:17:14 AM by Biza »
Quote from: TrailMyx
These are the things we look for in new users and perspective Elite members:

Quoting Elites/GMods/Admins in your siggys.

Offline GemviperTopic starter

  • Sr. Member
  • *
  • Posts: 481
  • Activity:
    0%
  • Reputation Power: 0
  • Gemviper hides in shadows.
  • Respect: +57
  • Referrals: 2
    • View Profile
Re: chest weight check sub
« Reply #2 on: November 11, 2015, 09:53:17 AM »
0
Hehe, thanks for that... AAAAANNNNDDD :)

I work my stats to where I want them first, which usually involves getting Str to 130 to hit the max 550 stone carrying capacity. Yes, you can go higher but your main pack cannot, it's capped at 550 on OSI.
Code: [Select]
set %Maxweight #maxweight + 60
Since my stats are locked I can add just that line and change the 60 to be whatever is needed to zero out my character/gear weight. In my case that means setting the + 60 at + 42 instead. This isn't an intuitive fix, it's rigid and won't account for anything in game that changes my str, but it's a simple lightweight solution that works for my purposes. I tried something like this earlier and it didn't work but I realize now that the code had a "leak" in it and all of the setup code at the top of the script was getting executed over and over instead of just the core I wanted to repeat. Anyway, problem solved, thank you.

Chest weight Checks
I don't see an item weight in EUO after finding an item via finditem. When I do an event #property the weight is included in all chests and an empty chest reports 0 stones as weight AND has a weight of 1-2 stones. I don't see information reporting how many items are inside the chest at all. Most scripts I see attempt a drag anyway but key on the error message to process further, is it possible to calculate if a chest should be picked up or not based on weight/item count BEFORE doing a drag on it?




Offline Biza

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 1
  • Biza has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: chest weight check sub
« Reply #3 on: November 11, 2015, 11:32:09 PM »
0
550 is the cap yes, but unless your running around naked 130 str wont let you carry 550 stones in your pack.

14 stones character weight + Gear + normal items in your bag, aids, pots ect. - the 550

There is a way to make the script calculate how much you can carry based on your strength, Twinkle McNugget has it in his looter I think. That would be worth checking out because its pretty bullet proof.

Edit: it appears a mod with a sense of humor edited my post, I was unaware that posting a name of a person and his script was against board rules. Could the mod/comedian (the name made me chuckle) could pm me with the area in the rules I missed thad be greeeeeaaaatt.
« Last Edit: November 14, 2015, 02:31:20 AM by Biza »
Quote from: TrailMyx
These are the things we look for in new users and perspective Elite members:

Quoting Elites/GMods/Admins in your siggys.

Offline GemviperTopic starter

  • Sr. Member
  • *
  • Posts: 481
  • Activity:
    0%
  • Reputation Power: 0
  • Gemviper hides in shadows.
  • Respect: +57
  • Referrals: 2
    • View Profile
Re: chest weight check sub
« Reply #4 on: November 12, 2015, 04:05:42 AM »
0
No, you can't hold 550 stones of items in your pack because when geared you probably already weigh 70 stone and to are at 70/550, which is correctly reported by the status data. As long as it's correctly reported it's not a problem. Say you are 100 stone from cap(550) and want to drag an 80 stone pack... you can, but the script will read that as too heavy because you go to 530 which is over EUO's cap of 495. It's not really a problem until you get near the cap.

Offline Biza

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 1
  • Biza has no influence.
  • Gender: Male
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: chest weight check sub
« Reply #5 on: November 14, 2015, 01:51:50 AM »
0
As far as i know there is no cap for carry weight, only container. So if your not actually moving, recalling, teleport, gate or doing anything that generally requires moving in any way shape or form you may actually put 550 stones in your pack and worry not about your char weight. You can pick up 20 billion stones, you just cant move or put it in your pack. I think that there is no finite limit on str as far as carry weight goes, just a hardcap on bag weight. So if your strength is 180 with gear, well you can ignore your armor... In theory anyway. If there is a hard cap on str = carry weight.

http://www.uoguide.com/Strength_(statistic)

says that 125 is max, but with gear you can go over that cap by a lot. Never actually did any testing on this. for instance my farming slave has 137 str, his max carry weight is 579, so if my gear and char only weigh 30 stones, i can put 550 in my pack. No matter what I believe i can still cram 550 in my pack and go over weight a few stones and still be able to move aorund.
« Last Edit: November 14, 2015, 02:58:06 AM by Biza »
Quote from: TrailMyx
These are the things we look for in new users and perspective Elite members:

Quoting Elites/GMods/Admins in your siggys.

Tags: