Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - LV

Pages: [1]
1
Scripting Chat / Item Evaluation Scripts
« on: October 28, 2012, 09:35:57 PM »
Hi All,

I have looked through scripts in various places, but other than BMEvalItem, I have not come across any others that 'grade' the item into bands which allow items to be automagically priced to some degree.

Are there any other scripts like this, or does anyone keep the BM one updated with the newer (IE : ter-mur /gargoyle) item types updated?

I have incorporated the BMEvalItems into my vendor stocking script's next release, however in testing I notice that newer types are not recognized and return a value of 0.

Thanks in advance,
LV



2
Submit your Script / LV Vendor Stocker
« on: October 26, 2012, 04:19:03 PM »
New version Nov 14th to 0.99e with fixes and updates.

I have updated LV Vendor Stocker to the latest version (0.99e).  The file format has been compatible since it was first posted so there are no issues upgrading.  Make sure to grab the ReadWriteandUpdatedBMEval.zip, as it contains external files that are needed as well.  They belong in the same directory as the script.

Below is a fairly comprehensive list of its features.  I hope some people can test it, use it, and report back how they find it.  Thanks for giving it a try!

;   Stocks any item, does a full check of properties before stocking, and verifies it was stocked.
;   Has an 'Evaluate Only' mode that allows you to see the exact number of each item you need
;     in order to fully replenish your vendors.
;   It makes stacks of any quantity, so you can stock 10 stacks of 7 scrolls each for example.
;   It wont 'stock over' your currently placed items.  It will actually only replace the items bought.
;     For example, say you had a row of 10 stacks of 10 gate scrolls and sombody bought the third and
;     fifth stack of gate scrolls.  The script checks not just the quantity to stock, but the location
;     of where the existing stock is, and will replace the third and fifth location with new stock.  (This
;     is my favorite feature.)
;   It can stack all in same place in a bag, or make horizontal and vertical rows with flexible
;     spacing on each axis.
;   It handles as many vendors as you want, even different settings for the same vendors with the
;     items on each other being the same or different.
;   It will handle sub-packs on vendors up to 3 deep.  If you use 3 or more, you don't need this
;     program as you wont be running a vendor very long.
;   It fully handles an odd issue like dull copper VS just copper. This can create a problems when an items
;    full properties are a subset of a different items properties and have the same type id.  This is NOT
;    an issue here.
;   It WILL handle items to stock in containers (like a bag of armor) one of two ways.
;     1.  An item type for each container holding items.  I.E. "a bag" would be used for LRC Suits, and
;         "a small wooden box" could be used for LMC Suits.  This is the default - not all items have color.
;     2.  If you create/edit an item that does have a color property, there is an option to use it.
;         If you and set the "use color compare" option, it will then
;         use the color of the container or item as a comparator.  I.E. all "a bag" colored pink would then
;         be seen as a type and all "a bag" colored blue would be seen as a different item.
;     This IS an optional setting, and I suggest if your stocking items in container for sale as a whole,
;     that you use it for ALL containers.  Using it for some and not others can lead to an unpredictable
;     result.  For example, say you use "a bag" without the option set for LMC suits, and "a bag" with
;     color option set on green.  If you then hit stock, two things might happen.  If you added the green
;     bag first, it would run fine, but if you added it second, it will go to stock the plain "a bag"
;     and it will not care if its green or not and will stock the green bag as a plain bag.
;     I am not sure I explained that well, but the point is...IF your selling items in containers like
;     bags of armor, USE THE COLOR COMPARE OPTION ON EVERY BAGGED ITEM YOU ARE STOCKING.
;   It will stock items using BadManiac's BMEvalItem script.  I have added it to the needed files zip
;   as there was a bug that was never fixed in the posted one. There is a variable that is never reset
;   which the forum talks about.  In my version that is fixed.  I wish it was being maintained, it needs
;   updating badly and its a great script.
;   Portable between computers.  It does use the registry, but only to transfer data to files.  You
;     can move the data files or easily back them up.

Enjoy!

3
Script Debug / A menu questions
« on: October 15, 2012, 03:03:06 PM »
Hi everyone,

I have a question.  Is it possible to grab the current menu window coords (not contpos, the menu).  I don't seem to be able to find a mechanism for it, and in my current project I wanted a way to save the current menu position.


LV

4
Inactive Submissions / LV PLANT AND HARVEST (OCR TEST PROGGIE)
« on: May 31, 2012, 04:55:37 PM »
I wrote this quick script yesterday to test some OCR stuff, and ended up taking it farther than planned to a working script that harvests full plants from raised flower beds (seeds and petals), then replants if wanted.  I thought with the raised flower beds it would be a lot less tedious tending plants, however, it was still not enough so this takes care of the rest.

I could add in a secure, and movement and weight checks and I plan to eventually, but this works as is for now.  Let me know of any problems if you use it.

Shows how to use OCR to scan real world coordinates using yourself as a reference as well.

Let me know of any issues.

Code: [Select]
;LV PLANT AND HARVEST (OCR TEST PROGGIE) ****************************************************************
;
;MAY 30, 2012
; I wrote this to test some OCR menu handling ideas for a huge fish quest script i have almost completed.
;
; Wait for gump is a variation of one found on scriptuo.com
;
;REQUIREMENTS :
; A:  USES RAISED FLOWER BEDS ONLY - LARGE 9 TILE ONE
; B:  USES PAMPAS OR POPPIE SEEDS ONLY
; C:  USES OCR SO NOTHING CAN BLOCK THE PLANT TILES - YOURSELF INCLUDED
; D:  USES OCR SO MAKE SURE BRIGTSIGHT OR NIGHTSIGHT IS IN USE
; E:  USES OCR SO MAKE SURE FULL SCREEN (TOP LEFT IS 0,0)
; F:  USES OCR SO THE %mbEmptyPot , %mbHarv, and %mb88 values (OCR CHECK VALUE) MIGHT be different depending on your color mode.
; G:  ANYTHING I FORGOT
; Script will harvest all poppies/pampas seeds and leaves in range (5 tiles) , will put plant to deco mode,
; and will then use clippers on it.
; The doplanting routine shows a way to scan world coord using ocr.
; Let me know if anything is wrong.
;****************************************************************************************************************
set %mbHarv 135924 ;is plant button to go to next screen
set %mb88 213219 ;is 8/8 so ready to harvest
set %mbEmptyPot 68067 , _ , 63962 , _ , 70141 , _ , 68085 , _ , 63962 , _ , 63935 , _ , 68083 , _ , 70132 , _ , 66019 ;each ocr of the plant beds is diff unfortunately
set %tPosAdj 48 ; nomatter what easyuo says, this value seems constant.
set %ClipperTypes JFF
set %DecoPlantTypes YVE ;BACKPK
set %SeedTypes PDF
set %FullPotTypes YVE ;GRND
set %EmptyPotTypes OOCB_APCB_NOCB_MOCB_XOCB_LOCB_SOCB_YOCB_ROCB
set %ReplantSeeds #True
set %WaitForGumpDefaultTimeout 50 ;run forrest, run.
set %WaitForGumpMinimumDelay 100 ;if gumps appear before game will let you click, the waitforgump had issues.  this makes it wait a minimum.
set %debug #FALSE ; set to true to help redo OCR compare values.  brain required.
;****************************************************************************************************************
goto ManageHarvest
halt
;****************************************************************************************************************

Sub ManageHarvest
ManageHarvest:
 
  set %tSkipPlanting #False
  set %ManageHarvestTLoop #True
 
  While %ManageHarvestTLoop #True
  {
    gosub DoHarvest
    If #Result = #False
    {
      set %ManageHarvestTLoop #False
    }
    gosub DoClipping
    if %ReplantSeeds = #True
    {
      gosub DoPlanting
      set %tSkipPlanting #True
    }
  }
  if %ReplantSeeds = #True && %tSkipPlanting = #false
  {
    gosub DoPlanting
  }
  halt
 
Return

;****************************************************************************************************************

Sub DoClipping
 
  set %DoClippingTLoop #True
  While %DoClippingTLoop #True
  {
    finditem %ClipperTypes C_ , #backpackid
   
    if #findcnt < 1
    {
      set %DoClippingTLoop #False
    }
    else
    {
      set %tClipID #findid
     
      finditem %DecoPlantTypes C_ , #backpackid
      if #findcnt < 1
      {
        set %DoClippingTLoop #False
      }
      else
      {
        event property #findid
        if Poppies in #property = #True || Pampas in #property = #True
        {
          set %tPlantID #findid
         
          set #lobjectid %tClipID
          event macro 17 0
          target 2s
         
          set #ltargetid %tPlantID
          event macro 22
          wait 20
        }
        else
        {
          ignoreitem #findid
        }
      }
    }
  }
  ignoreitem reset
 
Return

;****************************************************************************************************************

Sub DoPlanting
 
  set %tSeedID NA
  finditem %SeedTypes C_ , #backpackid
  if #findcnt < 1
  {
    Return
  }
  for %DoPlantingTLoop 1 #findcnt
  {
    if %tSeedID = NA
    {
      set #findindex %DoPlantingTLoop
      event property #findid
      if Poppies in #property = #True || Pampas in #property = #True
      {
        set %tSeedID #findid
      }
    }
  }
  if %tSeedID = NA
  {
    Return
  }
  finditem %EmptyPotTypes G_4
  if #findcnt < 1
  {
    Return
  }
  for %DoPlantingTLoop 1 #findcnt
  {
    set #findindex %DoPlantingTLoop
    set %ModX 0
    set %ModY 0
    if #charposx >= #findx
    {
      set %tMod #charposx  - #findx
      set %ModX %ModX - %tMod
      set %ModY %ModY - %tMod
    }
    else
    {
      set %tMod #findx - #charposx
      set %ModX %ModX + %tMod
      set %ModY %ModY + %tMod
    }
    if #charposy >= #findy
    {
      set %tMod #charposy - #findy
      set %ModX %ModX + %tMod
      set %ModY %ModY - %tMod
    }
    else
    {
      set %tMod #findy - #charposy
      set %ModX %ModX - %tMod
      set %ModY %ModY + %tMod
    }
    set %tStartX ( ( %ModX * 22 ) + 376 + 18 )
    set %tStartY ( ( %ModY * 22 ) + 296 - 26 )
    set %tEndX ( %tStartX + 10 )
    set %tEndY ( %tStartY + 10 )
   
    gosub OCRScanPixelsForCompare %tStartX %tStartY %tEndX %tEndY %mbEmptyPot
    if %debug = #True
    {
      display ok #findx , #spc , #findy , #spc , %tstartx , #spc , %tstarty , #spc , %tScanIDValCUR
    }
    if #Result = #True
    {
      set #lobjectid %tSeedID
      event macro 17 0
      target 4s
     
      set #ltargetid #findid
      wait 20
      event macro 22 0
      wait 20
    }
  }
 
Return

;****************************************************************************************************************

Sub DoHarvest
 
  finditem %FullPotTypes G_4
 
  if #findcnt < 1
  {
    Return #False
  }
 
  set #lobjectid #findid
  event macro 17 0
 
  Gosub WaitForGump contSize = 263_231 60
  if #Result = #False
  {
    display ok Timed out waiting on menu.  Please Restart.
    halt
  }
 
  set %tStartX ( %tPosAdj + #contposx + 25 )
  set %tEndX ( %tStartX + 15 )
  set %tStartY ( %tPosAdj + #contposY + 25 )
  set %tEndY ( %tStartY + 15 )
  gosub OCRScanPixelsForCompare %tStartX %tStartY %tEndX %tEndY %mbHarv
  If #Result = #True
  {
    click %tStartX %tStartY
    Gosub WaitForGump contSize = 255_231 60
    if #Result = #False
    {
      display ok Timed out waiting on menu.  Please Restart.
      halt
    }
  }
  else
  {
    display ok If you are seeing this, make sure night sight active, and nothing is covering the plants or menu gumps.  If not the problem, you might have to redo the check values as per instructions.
    halt
  }
  set %tStartX ( %tPosAdj + #contposx + 150 )
  set %tEndX ( %tStartX + 25 )
  set %tStartY ( %tPosAdj + #contposY + 65 )
  set %tEndY ( %tStartY + 15 )
  gosub OCRScanPixelsForCompare %tStartX %tStartY %tEndX %tEndY %mb88
  If #Result = #False
  {
    ignoreitem #findid
    click %tStartX %tStartY r
    Return #True
  }
  for %i 1 8 ; seeds
  {
    set %tStartX ( %tPosAdj + #contposx + 170 )
    set %tStartY ( %tPosAdj + #contposY + 120 )
    click %tStartX %tStartY
    Gosub WaitForGump contSize = 255_231 60
    if #Result = #False
    {
      display ok Timed out waiting on menu.  Please Restart.
      halt
    }
  }
  for %i 1 8 ; petals
  {
    set %tStartX ( %tPosAdj + #contposx + 100 )
    set %tStartY ( %tPosAdj + #contposY + 120 )
    click %tStartX %tStartY
    Gosub WaitForGump contSize = 255_231 60
    if #Result = #False
    {
      display ok Timed out waiting on menu.  Please Restart.
      halt
    }
  }
  ;go to dec mode screen
  set %tStartX ( %tPosAdj + #contposx + 170 )
  set %tStartY ( %tPosAdj + #contposY + 25 )
  click %tStartX %tStartY
  Gosub WaitForGump contSize = 271_231 60
  if #Result = #False
  {
    display ok Timed out waiting on menu.  Please Restart.
    halt
  }
  ;clicky yes
  set %tStartX ( %tPosAdj + #contposx + 135 )
  set %tStartY ( %tPosAdj + #contposY + 100 )
  click %tStartX %tStartY
  wait 20
 
Return #True

;****************************************************************************************************************

Sub OCRScanPixelsForCompare
 
  set #lpc 10000
 
  set %tStartScanX %1
  set %tStartScanY %2
  set %tEndScanX %3
  set %tEndScanY %4
  if %5 <> DIS
  {
    set %tScanIDValCMP %5
  }
 
  set %tScanIDValCUR 0
  set %tCurScanX %tStartScanX
  set %tCurScanY %tStartScanY
 
  set %tLoop #True
  while %tLoop = #True
  {
    savepix %tCurScanX %tCurScanY 1
    if #PIXCOL > 9999
    {
      str left #PIXCOL 2
      set %tPixHash #StrRes
      str right #PIXCOL 2
      set %tPixHash %tPixHash , #StrRes
    }
    else
    {
      set %tPixHash #PIXCOL
    }
    set %tScanIDValCUR ( %tScanIDValCUR + %tPixHash )
    set %tCurScanX ( %tCurScanX + 3 )
    if %tCurScanX > %tEndScanX
    {
      set %tCurScanX %tStartScanX
      set %tCurScanY ( %tCurScanY + 3 )
    }
    if %tCurScanY > %tEndScanY
    {
      set %tLoop #False
    }
  }
 
  if %tScanIDValCUR in %tScanIDValCMP = #True && %5 <> DIS
  {
    Return #True
  }
 
  if %5 = DIS
  {
    display ok %tScanIDValCUR
  }
 
  set #lpc 10
 
Return #False

;****************************************************************************************************************
sub WaitForGump
 
  if %0 < 4 || %4 = N/A
  {
    set %4 %WaitForGumpDefaultTimeout
  }
  if %0 < 5
  {
    set %5 return
  }
  set %4 #sCnt2 + %4
  set %tWaitForGumpTimer #systime + %WaitForGumpMinimumDelay
  wait 5
  set %tWaitForGump #True
  while %tWaitForGump = #True
  {
    set % . %5 # . %1 %2 %3
    if ! % . %5 && #sCnt2 < %4
    {
      Wait 1
    }
    else
    {
      set %tWaitForGump #False
    }
  }
  while %tWaitForGumpTimer > #systime
  {
    wait 1
  }
 
return

5
New member introductions / Hello All!
« on: March 13, 2012, 02:29:11 PM »
Hello All!

I am LV, and I have only been back to UO for a short time after a 10 year break.  I work with scripts a lot, and now I am getting used to easyuo scripts.  I don't have the time I used to, so if I can use a tool to make life easier, all the better.  I play siege, so for the scripts I have used so far I have modded to include gate travel, and look forward to contributing here.

Pages: [1]