Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

[Mudlet Challenge] Easy stocker

TahquilTahquil Member Posts: 4,374 @@ - Legendary Achaean
Hi, I have huge issues when it comes to stocking and setting prices in my shop.  So I thought I would make a script request as I suck at scripting and all my efforts so far have failed.

How it will work: 
Toggle on/off
Clicking the nameid on IH retrieves the #.
Being able to set the price and bin of the selected item
Outputs : PRICE <i#> <price> BIN <bin>

Comments

  • VeldrinVeldrin ✭✭✭✭ - Eminent DenmarkMember Posts: 432 ✭✭✭✭ - Eminent
    edited January 2013
    Something like...

    Stockprices {
    shirts = {
    a = {name = "a green shirt", price = 250, bin = 1},
    b = {name = "a blue shirt", price = 520000, bin = 1}
    },
    trousers = {
    a = {name = "a pair of green trousers", price = 1000, bin = 2},
    b = {name = "a pair of blue trousers", price = 10000000, bin = 2}
    },
    cravat = {
    a = {name = "the Corso cravat", price = 999999999, bin = 3}
         }
     }

    regex
    ^(\w+)(\d+)\s+(.*)$
    priceset(matches[2], matches[4], matches[3])

    function priceset(type, name, id)

        for k,v in ipairs(Stockprices[type]) do

    if v.name == name then 

    send("price "..id.." "..v.price.." bin "..v.bin)

    end--if

    end--for

    end --function

    ?

    Haven't actually checked if it works though
    for the clicking on IH to get numbers et all, I think I saw someone post something like it a while back.. @Iocun or @Sena perhaps?
    image
  • TahquilTahquil Member Posts: 4,374 @@ - Legendary Achaean
    I can't read code. :(
  • VeldrinVeldrin ✭✭✭✭ - Eminent DenmarkMember Posts: 432 ✭✭✭✭ - Eminent
    edited January 2013

    Hrm that'd make it harder to add to the thing I thought up and I'm not really good enough to work with loading/saving tables yet, so I work mostly hardcode. But this will auto set prices on everything that's defined in a table (check the script) and in a specific room (based on the room id which you can get off gmcp)

    image
  • KeneanungKeneanung ✭✭✭✭ - Eminent Member Posts: 616 ✭✭✭✭ - Eminent
    Doh! Is this still a thing? The link seems dead.
Sign In to Comment.