Verbs with implied indirect objects

I’ve been combing the verbs sections of the guides about this but can’t find the answer:

I’d like to create verbs which have a direct object and an implied indirect object. This already happens with some in-built verbs:

[code]> unlock door
(with the brass key) <---- this inference that they want to use the only key they’re holding

The brass key fits and unlocks the door.[/code]
In my case I have a verb to “ScrapeWith” as in “scrape hinges with screwdriver”. If the player types “scrape hinges”, and has no tool, I want to throw the response “You have nothing to scrape them with”, and if they do, execute as for “scrape hinges with tool” or similar.

I could define this both as “Scrape” and “ScrapeWith” and then have dobjFor sections for both verbs, with check() for the tool to basically fake a “With”, but this seems like the wrong approach. The verb always requires a direct AND indirect object. I was looking for a way to basically say, “if no indirect object is specified, but one (and only one) compatible indirect object is available to the player, infer that they mean to use it”.

There is an example in Getting started in Tads3. Search for “askForIobj”. You call this macro in the action method of the single (direct) object verb form on the direct object, with a parameter of the two object verb form,

modify Thing //(You would use modify to add a new verb - Dig and DigWith are already in Thing.)
    dobjFor(Dig)
    {
        preCond = [touchObj]
        verify() { }
        action() { askForIobj(DigWith); }
    }
;

and provide suitable verify() and check() methods in each object which can be used with the verb.

spade : Thing 'sturdy spade' 'spade' @insideCave
  "It's a sturdy spade with a broad steel blade and a firm wooden handle. "
  iobjFor(DigWith)
  {
    verify() {}
    check() {}
  }     
;

Thank you! :slight_smile: