Page 1 of 1

Is this even possible? Script Idea

Posted: Wed Aug 09, 2023 12:57 pm
by Angrymudman
Hello All,

I'm new to Mudlet and also Lua coding. I've recently started playing a very very old MUD that has its own style, but has a lot of characteristics of common MUDS. It has standard room types with Label, Description, Exits, etc. and its own set of Mobs.

I'm not looking to Auto-Map it as the developers put in a ton of tricky exits, like rooms that teleport you, and other rooms you don't want to enter because you die instantly.

What I am looking for is to create an Autowalking script that will allow me to enter an string array of directions to use. Loop through that Array, and in each room, pause, check what Mob(s) are in the room and attack. I would also need it to monitor my health and spell points and cast healing spells and buffs if they run out, and rest if I run out of spell points. Lastly it would need to run in reverse a designated number of rooms if things get too dicey and rest until spell points and health are back to normal, and then resume the path.

Is this even possible with the capabilities of Mudlet? Can anyone point me in the right direction?


Re: Is this even possible? Script Idea

Posted: Wed Aug 09, 2023 2:56 pm
by demonnic
We connected on discord, but for anyone coming behind the short answer is yes, it's absolutely possible. The long answer is there's several moving parts to it, and the order I recommend tackling them is

1. track vitals
2. setup vitals recovery (drink potions, etc)
3. track mobs in the room
4. kill mobs in the room
5. path walker
6. autoflee

Re: Is this even possible? Script Idea

Posted: Mon Jan 29, 2024 12:50 am
by dlyaverablyamit
Yes, it is definitely possible to create an autowalking script with Mudlet that includes the functionality you described. Mudlet is a powerful MUD client that supports scripting using the Lua programming language.
To achieve what you're looking for, you would need to write a custom script using Lua that interacts with the MUD's game world and automates certain tasks based on your specified logic.
Here are the general steps you can follow to create such a script:

1. Set up triggers: Use Mudlet's trigger system to capture important events in the game, such as entering a new room or receiving prompts for health and spell points. Triggers allow you to execute Lua code when specific text patterns are detected in the game output.

2. Create an array of directions: Define an array or table that contains the sequence of directions you want to follow. You can use Lua's table data structure to store this information.

3. Implement autowalking logic: Write code that iterates through the direction array and sends the corresponding commands to the MUD to move in the desired direction. You can use Mudlet's "send" function to send commands to the game.

4. Check for mobs and attack: Once you enter a new room, use triggers to identify the presence of mobs in the room. If mobs are detected, execute the necessary attack commands to engage them in combat.

5. Monitor health and spell points: Use triggers to capture prompts for health and spell points. Extract the relevant information from the game output and implement logic to cast healing spells or rest when necessary. You can use Lua's if statements and variables to keep track of your current health and spell points.

6. Implement reverse movement and resting: If things get too difficult, you can add logic to reverse your path by navigating back through the rooms you've visited. You can also include code to rest until your health and spell points are back to normal before resuming the original path.