Mudlet: Sent to Script

KresslackKresslack Florida, United States
I tried finding something about this in the Mudlet manual, and I know it's possible to do in Mush (what I used as a client before Mudlet), but all the commands in the Mudlet manual seem to revolve around sending commands directly to the MUD. I'd like to send certain things to scripts, for example if I'm using the mapper to get somewhere and there's no longer a warp there, I'd like to send the command automatically to the mapper script to 'SPE CLEAR' so I don't get spammed with "There is no wormhole here" messages.


Best Answers

Answers

  • There's an expandAlias function that first tries to trigger aliases before sending stuff to the mud.
  • KresslackKresslack Florida, United States
    Keneanung said:
    There's an expandAlias function that first tries to trigger aliases before sending stuff to the mud.
    But even with Aliases is there any way to have an option to Send to script instead of defaulting to world?


  • KresslackKresslack Florida, United States
    edited November 2014
    Mannimar said:
    basically trigger "There is no wormhole here" to do expandAlias("spe clear") and you're set for what you're asking, but I don't think that will stop the spam as you need to stop auto walking first
    So the expand alias part actually sends it to the script, and not as a world command? The mapper bit was just the only example I could think of. It would be helpful for a lot of other things involving scripts.


  • KresslackKresslack Florida, United States
    Those suggestions work! Thank you greatly. Was a bit confused since I'm still used to MuschClient for certain things.


  • edited November 2014
    To clarify: there is no such thing as "sending to script" - "script" isn't a thing it makes sense to send something too.

    You can send to the trigger/alias engine. expandAlias() is how you do that.

    Assuming you're not dealing with compiled code (which, unless things have changed with the mapper script since I stopped using Mudlet, you aren't), you might also cut out the middle man by just looking at the mapper's "spe clear" alias and figuring out what function it calls. Once you know that, you can just have your trigger make the same function call.
  • KresslackKresslack Florida, United States
    Aye, the expandAlias bit is working. On Mushclient you do Send to Script to do the same thing, and it sends commands via alias and trigger as if you were directly inputting them. 


  • Ideally you should really find the function that the mapper uses to clear the exit which seems to be clearSpecialExits() and use that, but the mapper script isn't really designed to be integrated into other scripts by the look of it, so expandAlias() would probably be fine to use in this case.
  • KresslackKresslack Florida, United States
    expandAlias works fine. I used that as an example because ideally, if I come across a wormhole that's been canceled, I want it to clear it and move on to the next available route. 


Sign In or Register to comment.