I have also found it helpful to use (?:blah) in my patterns to avoid putting in wildcards that I really don't care about or need. That would be another possible solution to this particular problem. Save only the herb name in your list of wildcards and ignore everything else.
Yep, that's it. My guess is that the problem is with how the wildcard table is formed when calling a script. Namely with some wildcards optionally missing, and more exactly - the last wildcard. I am just randomly pointing a finger here though. But changing the match expression to avoid having any missing wildcards seems to solve the problem:
It's only crashing MC when I eat kelp. So far I've been solving this by eating something else when I login. After that, it seems as if can accept kelp again. These are the messages:
You quickly eat a maidenhair leaf.
You quickly eat a piece of kelp.
Edit: The "cureBLostHerb"-function is never called when it crashes. Tried to put a Note and even an AppendToNotepad in the very beginning of it. Nothing..
I can't reproduce the problem, but what I might suggest is that you change debugNote to AppendToNotepad rather than Note. It is possible that doing a Note is somehow making it crash, although it is hard to say why.
You have to love debugging. To figure out what causes the crash you need to take it step by step. First add the trigger back, but make it echo something instead of calling a script. That'll tell you whether the trigger is responsible in some weird way. Then make it call a function, but make that just echo something. Then start bringing the function closer to what it originally was - echo the current state of variables you use in the cureBLostHerb(), then try performing some actions that it used to perform. In short - just keep adding stuff one piece at a time, until you either figure out what crashes, or get it working right.
Put a Note everywhere in the cureBLostHerb function, but none was echoed out. So I removed the trigger which called it, and now it's running! Now I just have to find what was wrong with that function (or trigger?), because I really need it/them.. Any ideas on this?
It looks very much like you are right and the crash occurs somewhere in the cureBLostHerb() function. Try using a Note to see how far into the function you can go before the crash occurs. First put the Note on the first line inside the function, if it shows and then crashes - move it to after the if check, and so on, until you pin down the exact line where it crashes.
That's the curePrompt function (called from the prompt) telling me that canEat returns 0. It does that because doHerb is set to kelp. The more think about it, the more I think there's something wrong with the eating-message, which calls cureBLostHerb. That function works on it's own, and I can't really see what could be wrong with it. But I'm pretty certain MC crashes around when it's called.
RAR -> http://www.crox.org/mc_sys.rar
ZIP -> http://www.crox.org/mc_sys.zip
Added a log of what happens when the system crashes. Also, I suspect that the crash isn't caused by the curePrompt function, as I tried to cure i manual (when sitting, and therefor keeping the curePromt from firing) and it still crashes. Perhaps the error is in the addDel function?
It's all in those archives, but I'll paste it here for faster access:
<trigger
enabled="y"
group="cxCuring"
keep_evaluating="y"
match="^You feel coordinated once more\.$"
regexp="y"
send_to="12"
sequence="100"
>
function affDel (name)
if curing ~= nil then
aff[name] = nil
debugNote ("Removed affliction: " .. name)
else
debugNote ("Illusion catched, no cured detected")
end
end
Thanks alot for trying to help me out, thought you'd given up by now. ;)
Here's the URL: http://www.crox.org/mc_sys.rar
Contains -everything- I use for MUSHclient (3 files). Got some other ideas on how I could work around this, but first I want to know what's causing this..
Post ALL (well, all of the ones in the stripped down version you just made that still crashed) the triggers exactly as they appear (and the script file) in your world file and the output from the server that causes the crash (and current state of variables). Since that'll be the only way we track this down.
This is probably going to be too much for one post, so you might want to zip and post a URL (if you have somewhere to host), if not just post it in pieces.
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.