Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Shopping Script

  1. #1

    Default Shopping Script

    Now that I'm moderately dangerous after Tgo01's hunting script lesson from earlier ...

    I'd really like to automate the shopping experience so that it does not require so much typing. EG is coming. Even the small fest in Ta'Vaalor had my wrists hurting from all the

    LOOK ON something - GET item ON something
    LOOK item on something - INSPECT item on something
    just to find out what it costs, looks like, and is.

    But this is way beyond me.

    Is there a script for it? Is it an easy script?

    ~L (whose wrists are just wrecked already)
    Luxie's adventures (because I must write) plus some guests from the past at my blog:
    http://www.thebardess.com

  2. #2

    Default

    Code:
    GameObj.loot.each{ |i|
    	if i.name !~ /disk|coffin/
    		fput "look on ##{i.id}"
    		i.contents.each{ |item|
    			fput "get ##{item.id}"
    			sleep 0.3
    			fput "look ##{item.id}"
    			sleep 0.3
    			fput "inspect ##{item.id}"
    			sleep 0.3
    		}
    	end
    }
    This would look on every object in the current room (that doesn't have the word disk or coffin in the name, to avoid messing with people's disks) and attempt to get, look, and inspect each item on said object.

    The sleep command basically tells the script to pause for that many seconds, I put a sleep command of 0.3 seconds between each command but you can make these as low as 0.1 or as high as you want, or get rid of them altogether. You should have at least 1 sleep 0.1 command somewhere in there though otherwise the script will perform actions as fast as possible and probably crash your client or even your computer.
    Last edited by Tgo01; 10-14-2015 at 06:45 PM.

  3. #3

    Default

    And when I need to look IN something? (because it happens...)
    Luxie's adventures (because I must write) plus some guests from the past at my blog:
    http://www.thebardess.com

  4. #4

    Default

    Quote Originally Posted by Luxelle View Post
    And when I need to look IN something? (because it happens...)
    You can add it to the script.

    Code:
    GameObj.loot.each{ |i|
    	if i.name !~ /disk|coffin/
    		fput "look on ##{i.id}"
    		fput "look in ##{i.id}"
    		i.contents.each{ |item|
    			fput "get ##{item.id}"
    			sleep 0.3
    			fput "look ##{item.id}"
    			sleep 0.3
    			fput "inspect ##{item.id}"
    			sleep 0.3
    		}
    	end
    }
    I'm pretty sure the way lich is set up with the contents feature that it will still go through all contents of the object, whether they are in or on said object. Just make sure the script looks both in and on it first so the contents will be populated.

  5. #5

    Default

    Thank you so much! It works perfect in the pawnshop. I'll go give this a try in a player shop!

    Really, my wrists thank you. And I'll bet people helping archive and collect info for the festival will love it, too!

    ~L
    Luxie's adventures (because I must write) plus some guests from the past at my blog:
    http://www.thebardess.com

  6. #6

    Default

    I just remembered that some displays aren't actual "loot" items but rather they are part of the room description and thus this won't work for said display items.

    There is a very simple way to get this to work for such room description items as well but I'm on my phone at the moment and don't remember the exact syntax.

    If someone doesn't already provide the code before I get home then I'll post it then.

  7. #7

    Default

    Coding from your phone. Wow, now I feel really pampered. Thanks.

    Look back when you get home

    It works terrif in the pawnshop, but fails in a player shop. That must be why?
    Luxie's adventures (because I must write) plus some guests from the past at my blog:
    http://www.thebardess.com

  8. #8

    Default

    Quote Originally Posted by Luxelle View Post
    Coding from your phone. Wow, now I feel really pampered. Thanks.

    Look back when you get home

    It works terrif in the pawnshop, but fails in a player shop. That must be why?
    Probably. Are the display items after the "you also see" bit or are they part of the room description?
    Last edited by Tgo01; 10-14-2015 at 08:00 PM.

  9. #9

    Default

    They're in the room description in a player shop, so ... feeling moderately dangerous, I added the same function you wrote to run through the GameObj.room_desc array.

    So no matter which kind of shop you are in, it will see it!

    I feel like you have granted me a new SUPER POWER!

    And yeah ... to use this in public, those sleep commands better be tweaked back or people with me are going to be irked.

    I'm going to play some more now. Since you are on the phone and busy somewhere and all...

    ~L.
    Luxie's adventures (because I must write) plus some guests from the past at my blog:
    http://www.thebardess.com

  10. #10

    Default

    I had a script on the repo called "shopsearch" at one point for searching playershops for items. It was when I was selling gem jars so you could do something like ;shopsearch uncut diamond and it would try to find the item and would ask for a confirmation before attempting to buy it. It was pretty crude and was just for player-run shops but maybe you can get some ideas of what (not?) to do. It had some hard-coded container names because of all of the shop decorations.

    Also, for the sake of EG, some of the merchant inventory containers are little container clusters so you'll have something like "bins" in the room description and if you do "look bin" you'll see "a green bin, a blue bin, and a red bin" or something of that nature. It's kind of annoying so you'd have to deal with that. I'm not sure whether the containers method for GameObj can be of use here. I think the dyer's tent in Icemule has some of these container clusters if you'd like to test it out. Perhaps the other dyer's tents have this sort of thing as well.

    The rabbit hole scales with how bulletproof and seamless you want the script to operate. Good luck, would be handy.

Similar Threads

  1. CCF Week 4 - Shopping
    By Omrii in forum Wanted
    Replies: 1
    Last Post: 05-26-2009, 12:10 PM
  2. Car shopping
    By Numbers in forum Off-Topic
    Replies: 16
    Last Post: 09-07-2008, 08:55 PM
  3. Shopping List
    By Savageheart in forum Wanted
    Replies: 0
    Last Post: 01-07-2008, 01:02 PM
  4. Dhu Shopping Help
    By Skirmisher in forum General Gemstone
    Replies: 10
    Last Post: 08-07-2004, 08:16 PM
  5. Yet another shopping list
    By fallenSaint in forum GSIV Merchant's Market
    Replies: 10
    Last Post: 06-25-2004, 03:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •