Results 1 to 3 of 3

Thread: Need just a tiny bit of help

  1. Question Need just a tiny bit of help

    I'm working on understanding GameObj stuff, and I'm struggling with GameObj.loot a little.

    An example would be this:

    kitten = ["snow white kitten", "midnight black kitten"]

    If GameObj.loot includes one of those kittens, I want to pick it up. That's all. I just want to pick it up. There may be times when both are present; in that case, the one I want to pick up would be based on character. If Char.name == 'Light' pick up snow white kitten, if Char.name == 'Dark' pick up midnight black kitten.

    Can someone give me a little nudge?

    Thanks!

  2. Default

    Code:
    if Char.name == 'Light'
    	kitten = (GameObj.loot.find { |o| o.name == "snow white kitten" } || GameObj.loot.find { |o| o.name == "midnight black kitten" })
    else
    	kitten = (GameObj.loot.find { |o| o.name == "midnight black kitten" } || GameObj.loot.find { |o| o.name == "snow white kitten" })
    end
    if kitten
    	fput "get ##{kitten.id}"
    	fput "throw ##{kitten.id}"
    end
    Get Lich - Vote for Gemstone (topmudsites.com)

  3. Default

    You made me bash it's head in. Jerk.

    (Thanks, just what I needed! I get it more now!)

Similar Threads

  1. Replies: 7
    Last Post: 03-30-2019, 02:54 PM
  2. Tiny Script
    By Wheelerm in forum The Lich Project
    Replies: 5
    Last Post: 12-20-2017, 04:46 PM
  3. Replies: 0
    Last Post: 02-17-2015, 11:10 PM
  4. Anyone help me with a tiny script, please?
    By Sihaya in forum Miscellaneous Scripts
    Replies: 19
    Last Post: 07-13-2011, 08:33 PM
  5. Gnomes are tiny....right?
    By Kurili in forum Mechanics Complaints
    Replies: 23
    Last Post: 11-28-2003, 07:42 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
  •