ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Tholomew on January 22, 2009, 05:28:09 AM

Title: Power Scroll scan script
Post by: Tholomew on January 22, 2009, 05:28:09 AM
Hi,

I want to make a script that looks at all powerscrolls in a bag, I set all prices for what there worth within the script. And the script will total the amounts and display Total.

Here is some code, its just test to show, if this would be the best way to go about it. I know its not proper, its just showing you the basic flow.

Code: [Select]
finditem XXXX
if #property = 120 Swordsmanship
 {
  set amount + 0.5
  some ignore code
  return
 }
 if #property = 120 Macing
 {
  set %amount + 1
  some ignore code
  return
 }
 if #property = 120 Magery
 {
  set %amount + 12
  some ignore code
  return
 }
 if #property = 120 Ninjitsu
 {
  set %amount + 1
  some ignore code
  return
 }
 if #property = 120 Healing
 {
  set %amount + 0.2
  some ignore code
  return
 }
 
 Totals all the amounts and Displays

So like this id need to do that to every 120 powerscroll/stat scroll and a couple 15's Dont care rest.

Anyway any thoughts would be good. Thanks!
Title: Re: Power Scroll scan script
Post by: _C2_ on January 22, 2009, 07:41:43 AM
I'll post what i use as a scroll broker.  I have all the prices below and then combine all the same priced scrolls on the same line.  There are easier ways than what i did but it is very accurate and does multiple bags.

You can use it as a reference or just use it.  I am sure there are ways to shorten the code but wasn't trying to go super short, just super accurate...hehe.  when i get home i will attach it
Title: Re: Power Scroll scan script
Post by: Tholomew on January 22, 2009, 02:14:36 PM
Oh great! Cheers
Title: Re: Power Scroll scan script
Post by: TrailMyx on January 22, 2009, 02:17:57 PM
I see you are using decimals in your examples.  Remember that EasyUO is an integer-only based interpreter.  ;)
Title: Re: Power Scroll scan script
Post by: _C2_ on January 22, 2009, 07:07:22 PM
yeah so here it is.  i basically event prop scrolls and look for the key word combos and add all the same priced ones into the same line with || statements.

There is a price list at the bottom that covers a wide range for me and everything that I am paying the same for is added all at once as it evals scrolls for that line.

Not the best code but works perfectly.

oh yeah - this was never designed for public so i would like to credit rana70 and i think for the commas advice in the final total.

mode:
-sets up values automatically
-asks you to target bag and opens it.  only adds scrolls up inside the targeted bag.  loose stuff in pack or bank won't  mess it up.
-asks if u want to calc another bag.
-if no adds commas (thx rana) and posts in display.  if yes adds on another bag to total and displays.  can do unlimited bags!
Title: Re: Power Scroll scan script
Post by: Tholomew on January 22, 2009, 08:29:31 PM
Ah great! Thanks ill let you know how i get on.
Title: Re: Power Scroll scan script
Post by: Tholomew on January 22, 2009, 10:53:46 PM
Nice working, I just made it so everything called a price individually because my buy prices will change too frequent.

And added some msg instead of display haha like Calculating... at start and then Order Total: %totalamount

also made a version to skip setting up bags incase they dump them in trade window:X

Thanks a lot
Title: Re: Power Scroll scan script
Post by: _C2_ on January 23, 2009, 05:02:07 AM
NP- glad it gave u something to fuss with!   ;)