ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: cybercasper on October 13, 2016, 06:45:07 PM

Title: trying to get a maxweight to weight
Post by: cybercasper on October 13, 2016, 06:45:07 PM
I am looking how I would incorporate a weight into my script. what I want to be able to do is once my weight is say 50 I want it to open my secure, which I have already finished, and pull out enough of one item to put it to my maxweight. can anyone enlighten me on how to do this since I have looked at a lot of different scripts and they are more focused on when it is at maxweight to unload or use a bag of sending.
Title: Re: trying to get a maxweight to weight
Post by: The Ghost on October 14, 2016, 11:50:11 AM
CEO most have something  in his crafting build.   
Title: Re: trying to get a maxweight to weight
Post by: 12TimesOver on October 14, 2016, 11:59:37 AM
I am looking how I would incorporate a weight into my script. what I want to be able to do is once my weight is say 50 I want it to open my secure, which I have already finished, and pull out enough of one item to put it to my maxweight. can anyone enlighten me on how to do this since I have looked at a lot of different scripts and they are more focused on when it is at maxweight to unload or use a bag of sending.
You would need to know the weight of the item you were pulling out (of course) then simply work with #MAXWEIGHT - #WEIGHT to know how many to pull out. %totalitems = (#maxweight - #weight) / weightof1item

Not sure I'm understanding you correctly though.

X
Title: Re: trying to get a maxweight to weight
Post by: cybercasper on October 14, 2016, 03:56:55 PM
This is what I'm doing I'm trying to train archery on an artic orge lord. But during the night I run out of arrows so I log off what I wanted it to do was check for the arrows and once I run out I want it to refill from a secure. Maybe I'm going about it all wrong maybe I should have it check for item and if item isn't there then put xxxx amount in my backpack
Title: Re: trying to get a maxweight to weight
Post by: 12TimesOver on October 14, 2016, 05:30:06 PM
This is what I'm doing I'm trying to train archery on an artic orge lord. But during the night I run out of arrows so I log off what I wanted it to do was check for the arrows and once I run out I want it to refill from a secure. Maybe I'm going about it all wrong maybe I should have it check for item and if item isn't there then put xxxx amount in my backpack
Nope, you got the right idea. Pretty simple really, something like:

repeat
   finditem %arrowtypes
   If #findstack < somenumber
      {
      set %arrowstoget #MAXWEIGHT - #WEIGHT ;arrows are one stone
      gosub restock %arrowstoget
      }
until

sub restock
   namespace push
   namespace local restock
   set !arrows %1
   get your arrows out of the secure
   put them in your pack
   etc
   etc
   Namespace stuff
return

You know, something along these lines. I need to go watch Stranger Things so I'm hurrying :)

X
Title: Re: trying to get a maxweight to weight
Post by: The Ghost on October 14, 2016, 06:09:15 PM
I was under the impression that  I help you make a snippet to restock when were out of arrow.
Title: Re: trying to get a maxweight to weight
Post by: cybercasper on October 15, 2016, 02:21:47 AM
Ghost you did sir I just couldn't figure out the max weight part and u said ask orgiammi but not one offered help over there