I play a MUD that requires you to wear level eq in order to gain certain stats when you level, and i was wondering if there was a way to set a trigger to automatically wear my level eq when i reach a certain amount of exp.
This is what my prompt looks like:
<100% 100% 100% 3(0) 89%% ESWU>
The number with the 2 %% after it is my EXP and i would like to know how i would get it to set off after i hit about 98%%? is there a way to do it?
And send it to a script that checks to see if the experience is >= 98%. Have a boolean variable LevelEQ. If that variable is also false have the script wear whatever it is. If the variable is true, do nothing.
Also trigger your level message. Whenever you level reset the variable, and wear your normal equipment.
but all my other numbers aren't always at 100% when i level they are always at different numbers, thats why i cant seem to get it to work because my hp could be at 80% or my mana could be low to.
You will want to trigger something like this...
^\<(\d+)\% (\d+)\% (\d+)\% (\d+)\((\d+)\) (\d+)\%\% ESWU\> $
\d means its capturing a digit
+ means your going to capture 1 or more of the previous type
\ is the escape character meaning those strange characters shouldn't be read as regular expression symbols, etc...
Then you'll want to script in some language
check to see if you already changed equipment.
if not, check to see if the 6th wildcard is greater than or equal to 98, remove your current equipment. Wear the other equipment. Store whether or not this has been done in a variable.
then you'll want a similar trigger for whatever the leveling line is... to just remove your leveling equipment and put the other equipment back on. and change the variable that showing what set of equipment you have on to its pre 98% state.
I think i got the trigger down now, but is there a way to only get it to fire once so i dont keep getting spammed when i reach 98%% exp because it just keeps firing once everytime it comes up.
if the exits are always displayed as letters you can do what you mentioned or use ([A-Z]*) or ([A-Z]+) if a room must have at least one exit.
Beyond that...
The trigger conditions will be recognized every time. Which is why I suggested using an if statement in some scripting language. Along with a variable to tell you if the trigger has already fired or not. That is, the trigger still catches the statement and fires, its just that the effects of it firing are different: only if it hasn't already changed your equipment will it send those commands to the mud.
Maybe there is another way, but that is how I would do it.
download activestate python, get me the text that says you leveled, and when I get a few minutes free I'll see if I can't write you a quick plugin to do the trick.
You gained some hit points.
All of a sudden, you hear trumpets and before you know it, there is a feast
honoring you for your accomplishments! You learn that you have risen a level!
You are now level 80! Congratulations!
replace the text contained in the lists with your items. If this is not suitable, look at the world.Send function when modifying this code, and you can have it send whatever text you want to the game.
When you level it will do the reverse, removing the leveling stuff, and wearing the normal stuff. (Being defined by the lists.)
Copy your level and prompt lines exactly, and use the game>test trigger function to identify to convince yourself it works. If your prompt appears to be identical but has a space after it, this will need some tweaking, etc... (that is common)
If it were me, I'd make sure it works for one level. Or tweak it, and test it on the next level. But, I'm a bit anal, if I didn't get an extra hp for one level, I might just delete my character and recreate.
\0AYou are now level 80! Congratulations!
<100% 100% 100% 3(0) 98%% ESWU>
You are now level 80! Congratulations!
<100% 100% 100% 3(0) 89%% ESWU>\0A
Paste that into the testing of triggers. For the first two lines, it should send the world remove ... and wear ...
for the second it should do nothing visible
Your prompt doesn't have <> or do you mean the trigger is just using the lt and gt codes for it?
You can try replacing them with <>, but it works fine for me. The plugin wizard automatically converted it to those it seems. I would test and make sure your prompt is actually sending a new line at the end. Or if it isn't that it doesn't look more like this:
"<100% 100% 100% 3(0) 98%% ESWU> "
which, as I said is pretty common.
But yeah, if the triggers aren't catching, you'll need to do some tweaking... And most likely with the newline/end of line or some whitespace character.
Someone else can probably help you a bit better there. I still don't know what I'm doing where the packet debugger is concerned.
You would be altering these lines to do what you want.
for i in range(0, len(LevelingEquipment)):
world.Send('remove ' + str(LevelingEquipment[i]))
for i in range(0, len(NormalEquipment)):
world.Send('wear ' + str(NormalEquipment[i]))
i.e maybe you want to put the old set in a pack and take the new set out to accomplish the exchange.
for i in range(0, len(LevelingEquipment)):
world.Send('remove ' + str(LevelingEquipment[i]))
world.Send('put ' + str(LevelingEquipment[i]) + ' in pack')
for i in range(0, len(NormalEquipment)):
world.Send('get ' + str(NormalEquipment[i]) + ' from pack')
world.Send('wear ' + str(NormalEquipment[i]))
The script uses a variable so it won't fire more than once per level. This way it doesn't remove and wear equipment every time you change by 1%. But if you should skip from 97% to 99% lets say, it should work just fine. That being said, if you earn enough xp to level from 97% to 100% before you get a prompt somewhere in between, the script obviously won't change your eq. Should you stop playing, change eq, and log off at 98+ % the script won't change your eq when you log back on. Etc... If you want, the addition isn't hard to have it do so, and it would probably be a good learning experience to try and figure out.