Scripting Help
Scripting Help
I'm new to Mudlet so please excuse me if this question is answered somewhere and I haven't found it yet. I'm looking to build a Move/Kill script for the mud I play and I can't seem to find a function that Mudlet processes for each line returned. Does anybody know a way to fire off a script for an incoming event and by not using the trigger system?
Re: Scripting Help
Why not use the trigger system?
Re: Scripting Help
Maybe I need to be better explain what it is i'm doing. I currently have a text file with all the information about a zone i'm currently running. This file has Mob names, and descriptions for each Mobile in that zone. It also has a Path set in the file. Below is a very short example of what is in my files:
MOBILE Boy
DESC Shteran boy's spirit wanders here.
DESC Shteran boys plead for mercy.
PATH
s
s
s
s
s
s
s
END
When my current scripts I runs, it reads all Mobs in the room, along with how many, then starts to kill. After the room is clear, it then moves on to the next move defined in the array. Being able to process like this is much easier as I can do all string matches within the script it's self, and not involve the trigger system.
I have thought about making triggers to match the Mobs as I enter the rooms, but I have been running into issues with it. I would prefer not to make a single trigger for each type of Mob's as that list can be very long depending on the zone i'm in. I've been trying to use a single trigger for each description and using a script to match with the output using matches[, i being the number from the line i'm trying to match with. Below are some of the strings in the triggers i'm using.
I've tried this: One trigger, line 0 set to "^A clan of \[ (\d) ] Shteran boys plead for mercy.$" and line 1 being set to "A Shteran boy's spirit wanders here." While, I probably can make that work for me, It would just be much easier to work if there was a function in mullet that is ran with every line being returned from the Mud.
I hope the above helps you understand better what it is exactly i'm trying to do.
MOBILE Boy
DESC Shteran boy's spirit wanders here.
DESC Shteran boys plead for mercy.
PATH
s
s
s
s
s
s
s
END
When my current scripts I runs, it reads all Mobs in the room, along with how many, then starts to kill. After the room is clear, it then moves on to the next move defined in the array. Being able to process like this is much easier as I can do all string matches within the script it's self, and not involve the trigger system.
I have thought about making triggers to match the Mobs as I enter the rooms, but I have been running into issues with it. I would prefer not to make a single trigger for each type of Mob's as that list can be very long depending on the zone i'm in. I've been trying to use a single trigger for each description and using a script to match with the output using matches[, i being the number from the line i'm trying to match with. Below are some of the strings in the triggers i'm using.
I've tried this: One trigger, line 0 set to "^A clan of \[ (\d) ] Shteran boys plead for mercy.$" and line 1 being set to "A Shteran boy's spirit wanders here." While, I probably can make that work for me, It would just be much easier to work if there was a function in mullet that is ran with every line being returned from the Mud.
I hope the above helps you understand better what it is exactly i'm trying to do.
Re: Scripting Help
You can use the trigger system not to use the trigger system: just create a trigger for ^ (perl regex type) and it will match on every line - then you can do your own string matching.
Re: Scripting Help
I will give that a shot. Thank you.
While i'm at it. As an experience user of Mudlet, would you consider what i'm doing to be too convoluted? I'm still learning Mudlet so if there is an easier way, please, by all means share. I could use the advice.
While i'm at it. As an experience user of Mudlet, would you consider what i'm doing to be too convoluted? I'm still learning Mudlet so if there is an easier way, please, by all means share. I could use the advice.
Re: Scripting Help
Nope, sounds ok. You could also create temporary triggers and clear them when you enter/leave areas.
Re: Scripting Help
I will keep that in mind. Thank you again for the help
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Scripting Help
Well, yes you could say that Vadim is an experienced user...!Necrite wrote:... As an experience user of Mudlet, would you ...
(And he's has posted nearly twice as many messages here than the next highest, that being Heiko the "name on the wrapper" of Mudlet, both of them core coders, check out the "Members" list!)
Re: Scripting Help
Lol. Thank you for the insight. I didn't even bother to see who was who and just assumed that if they could answer my question, they had a good idea of what they were doing.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Scripting Help
Well the glowing red ey..., er, name means the person is an Administrator, and my green one means I'm a Moderator, able to do things to messages that generally normal members (in blue) cannot.