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

Mudlet: Sent to Script

KresslackKresslack Florida, United StatesPosts: 5,789Member @@ - Legendary Achaean
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

  • KeneanungKeneanung Posts: 585Member ✭✭✭✭ - Eminent
    There's an expandAlias function that first tries to trigger aliases before sending stuff to the mud.
  • KresslackKresslack Florida, United StatesPosts: 5,789Member @@ - Legendary Achaean
    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 StatesPosts: 5,789Member @@ - Legendary Achaean
    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 StatesPosts: 5,789Member @@ - Legendary Achaean
    Those suggestions work! Thank you greatly. Was a bit confused since I'm still used to MuschClient for certain things.


  • TaelTael Posts: 1,197Member @ - Epic Achaean
    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.
    Eld
  • KresslackKresslack Florida, United StatesPosts: 5,789Member @@ - Legendary Achaean
    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. 


  • AccipiterAccipiter Posts: 345Member ✭✭✭ - Distinguished
    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 StatesPosts: 5,789Member @@ - Legendary Achaean
    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. 


    Tharvis
Sign In to Comment.