Alrighty, I made it into a plugin. I made an alias to check the variable listing function, that works great. The problem I am having is still that it doesn't store the variables from session to session.
It stores them when it is a script, as the world variables. But once I make it into a plugin it doesn't. Once I close the sessions, they are all lost, etc...
I'll post the things here so you can have a look at it, thanks again! All I really have in there is 2 triggers and a script for each of them. When I query the mud for my skills it gives me them in a descriptive manner, I need to track the actual numbers though.
<triggers>
<trigger
enabled="y"
match="^(.*)\:(\s+)(Unskilled|A Tyro|A Novice|A Beginner|Poor|Not Very Good|Below Average|Average|Above Average|Able|Fair|Proficient|Good|Adroit|Very Good|Excellent|An Expert|Superb|A Master|Eminent|An Adept|Renowned|A High Master|Consummate|A Virtuoso|A Grand Master|Legendary)\.$"
omit_from_output="y"
regexp="y"
script="SkillCheck"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^\* You think your (.*) skill has improved\. \*$"
regexp="y"
script="OnSkillGain"
sequence="100"
>
</trigger>
</triggers>
<script>
<![CDATA[
def OnSkillGain(TriggerName, trig_line, wildcards):
VariableName = ''.join([wildcards[x] for x in range(len(wildcards)-1)])
VariableName = VariableName.replace(' ', '_').replace('\'', '').replace('-', '_').replace('#', '_')
if not world.GetVariable(VariableName):
VariableValue = 1
else:
VariableValue = int(world.GetVariable(VariableName)) + 1
world.SetVariable(VariableName, str(VariableValue))
world.note(VariableName + ': ' + str(VariableValue))
def SkillCheck(TriggerName, trig_line, wildcards):
VariableStringName = wildcards[0]
TempSpace = wildcards[1]
VariableDesc = wildcards[2]
VariableName = VariableStringName.replace(' ', '_').replace('\'', '').replace('-', '_').replace('#', '_')
if not world.GetVariable(VariableName):
VariableValue = 1
else:
VariableValue = int(world.GetVariable(VariableName))
if VariableDesc == "Unskilled":
if VariableValue > 3: world.SetVariable(VariableName, '3')
else: world.SetVariable(VariableName, '1')
elif VariableDesc == "A Tyro":
if VariableValue < 3: world.SetVariable(VariableName, '4')
elif VariableDesc == "A Novice":
if VariableValue < 9: world.SetVariable(VariableName, '10')
elif VariableDesc == "A Beginner":
if VariableValue < 17: world.SetVariable(VariableName, '18')
elif VariableDesc == "Poor":
if VariableValue < 29: world.SetVariable(VariableName, '30')
elif VariableDesc == "Not Very Good":
if VariableValue < 49: world.SetVariable(VariableName, '50')
elif VariableDesc == "Below Average":
if VariableValue < 69: world.SetVariable(VariableName, '70')
elif VariableDesc == "Average":
if VariableValue < 89: world.SetVariable(VariableName, '90')
elif VariableDesc == "Above Average":
if VariableValue < 109: world.SetVariable(VariableName, '110')
elif VariableDesc == "Able":
if VariableValue < 134: world.SetVariable(VariableName, '135')
elif VariableDesc == "Fair":
if VariableValue < 164: world.SetVariable(VariableName, '165')
elif VariableDesc == "Proficient":
if VariableValue < 199: world.SetVariable(VariableName, '200')
elif VariableDesc == "Good":
if VariableValue < 239: world.SetVariable(VariableName, '240')
elif VariableDesc == "Adroit":
if VariableValue < 284: world.SetVariable(VariableName, '285')
elif VariableDesc == "Very Good":
if VariableValue < 334: world.SetVariable(VariableName, '335')
elif VariableDesc == "Excellent":
if VariableValue < 389: world.SetVariable(VariableName, '390')
elif VariableDesc == "An Expert":
if VariableValue < 449: world.SetVariable(VariableName, '450')
elif VariableDesc == "Superb":
if VariableValue < 514: world.SetVariable(VariableName, '515')
elif VariableDesc == "A Master":
if VariableValue < 584: world.SetVariable(VariableName, '585')
elif VariableDesc == "Eminent":
if VariableValue < 659: world.SetVariable(VariableName, '660')
elif VariableDesc == "An Adept":
if VariableValue < 739: world.SetVariable(VariableName, '740')
elif VariableDesc == "Renowned":
if VariableValue < 824: world.SetVariable(VariableName, '825')
elif VariableDesc == "A High Master":
if VariableValue < 919: world.SetVariable(VariableName, '920')
elif VariableDesc == "Consummate":
if VariableValue < 1049: world.SetVariable(VariableName, '1050')
elif VariableDesc == "A Virtuoso":
if VariableValue < 1199: world.SetVariable(VariableName, '1200')
elif VariableDesc == "A Grand Master":
if VariableValue < 1399: world.SetVariable(VariableName, '1400')
elif VariableDesc == "Legendary":
if VariableValue <1700: world.SetVariable(VariableName, '1700')
world.ColourTell ('#CCCCCC', '', VariableStringName + ':' + TempSpace + VariableDesc)
world.ColourTell('#FFFFFF', '', ' [')
world.ColourTell('#FF0000', '', world.GetVariable(VariableName))
world.ColourNote('#FFFFFF', '', ']')
]]>
</script>
|