ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: KuhlKy on May 12, 2011, 08:19:39 AM

Title: scripting ?
Post by: KuhlKy on May 12, 2011, 08:19:39 AM
Was wondering if there was a way to get the weight of a keg for when you are making potions or a even a way to read what is written in the gump would be even better

any help would be appreciated.... thanks
Title: Re: scripting ?
Post by: Masscre on May 12, 2011, 08:33:34 AM
Check out event property this will give you weight and other info for items.
Title: Re: scripting ?
Post by: rana70 on May 12, 2011, 08:43:12 AM
Was wondering if there was a way to get the weight of a keg for when you are making potions or a even a way to read what is written in the gump would be even better

any help would be appreciated.... thanks

Hi,

maybe this little test script gives you a few ideas (Target an Item and it will read out the stuff),
check out the STR Commands in the Docs and I am sure you can get what you like !

Basic idea is to read out the text, narrow it down with the STR command
to your needs eg. cut out name or weight numbers and put this into a var to check on it
or calculate ...


Code: [Select]
; SUB Cut down Item Properties and Display
; This SUB will cut down Item Properties in single Lines
; and gives you the option to Display Lines you want
; and ignore Lines by setting up keywords
;
; Grab the ITEMID
Set #targcurs 1
Target
While #targcurs = 1
 wait 0
; Check out the Property of the Item
FindItem #ltargetID
Event Property #FindID
; #Property hold the full String now, store it for later use
Set %FullProperty #Property
; Get the Number of Lines we have
STR COUNT %FullProperty $
; Setup StartParameters for Line Selection
Set %LineCounterMax #strRES
Set %CutLeftPos 1
Set %DisplayOK #TRUE
Set %LineCounter 1
; Check out what to Display and what to Ignore
Repeat
{
 ; Get the most right poition of our Line
 STR POS %FullProperty $ %LineCounter
 Set %CutRightPos #strRES
 ; to Cut it out we need the Length of the Line
 Set %CutLength %CutRightPos - %CutLeftPos
 ; Cut out our Line from the Full Property
 STR MID %FullProperty %CutLeftPos %CutLength
 ; We got one Line out of the Property
 Set %DisplayLine #strRES
 ; Set %DisplayOK to #FALSE when something we don't want is in Line
 ; excludes: lines with weight or insured or requirement
 if weight in %DisplayLine || insured in %DisplayLine || requirement in %DisplayLine || Weapon , #SPC , Speed in %DisplayLine || Durability in %DisplayLine
  Set %DisplayOK #FALSE
 ; Display Line and prevent from SPAM Alert
  if %DisplayOK = #TRUE
  {
   Msg %DisplayLine $
   STR LEN %DisplayLine
   Set %WaitDelay #strRES * 5
   Wait %WaitDelay ; #strRES
  }
 ; Prepair for next Line
 Set %DisplayOK #TRUE
 Set %CutLeftPos %CutRightPos + 1
 Set %LineCounter %LineCounter + 1
}
Until %LineCounter > %LineCounterMax

halt
Title: Re: scripting ?
Post by: Endless Night on May 12, 2011, 09:31:07 AM
error here .. otherwise nice looking code

Set %DisplayOK = #FALSE
Title: Re: scripting ?
Post by: rana70 on May 12, 2011, 09:50:48 AM
error here .. otherwise nice looking code

Set %DisplayOK = #FALSE

I think I got the hint ....
and fixed it

thx
cu
Title: Re: scripting ?
Post by: KuhlKy on May 12, 2011, 10:14:30 AM
thanks for help I appreciate it
Title: Re: scripting ?
Post by: Scrripty on May 12, 2011, 10:20:24 AM
Why would you worry about kegs when pots stack and you can stack more than 100 at a time?  Kegs are kind of obsolete now.
Title: Re: scripting ?
Post by: 12TimesOver on May 12, 2011, 10:48:06 AM
Why would you worry about kegs when pots stack and you can stack more than 100 at a time?  Kegs are kind of obsolete now.
Why does someone have to ask this question every time the word "keg" makes it into a post? ;)

I don't use strictly bottles for either. Better profit margin when selling kegs of a potion.

X
Title: Re: scripting ?
Post by: Scrripty on May 12, 2011, 10:49:29 AM
Why would you worry about kegs when pots stack and you can stack more than 100 at a time?  Kegs are kind of obsolete now.
Why does someone have to ask this question every time the word "keg" makes it into a post? ;)

I don't use strictly bottles for either. Better profit margin when selling kegs of a potion.

X

This question gets asked because it's pointless and annoying to buy pots in kegs... :)
Title: Re: scripting ?
Post by: 12TimesOver on May 12, 2011, 10:52:20 AM
because it's pointless and annoying to buy pots in kegs... :)
Hehe, about as pointless and annoying to the seller as buying bottles to sell pots!!

 ;D
Title: Re: scripting ?
Post by: KuhlKy on May 12, 2011, 01:26:46 PM
I prefer to have potions in a keg for my use. It may not be your way Twinkle McNugget but that is what I prefer.
Title: Re: scripting ?
Post by: gimlet on May 12, 2011, 02:08:52 PM
I partly agree with Twinkle McNugget but on seige I can not afford bottles yet.