Logging Status (HP) Variables
Posted: Thu Aug 30, 2018 2:34 pm
Hi all, I am new to Mudlet, I used to use cMud and I am Hong Konger, so bare with me for some Chinese character
I am starting to build my own trigger set, but I am struck with the first trigger.
I use to log my status , i.e hp or mp, as variables and it is kind of core to my trigger set
And in my mud the HP status look something like this. (some chinese characters ahead)
in cMud I can set up pattern sth like that:
and it will log my current hp (8500), max hp (8500), current mp (15000) & max mp (15000)
I couldn't do that in Mudlet tho, I have already read the wiki and manual. From there I learnt I can use Perl Regex to log variables
So I convert my trigger pattern like this:
it fired, but I couldn't log the variable that i wanted, i check by display(matches), it shows below:
I tried perl regex but it really getting me nowhere, that is the only pattern i can get the trigger fired...
How should I log my status properly?
Many thanks.
I am starting to build my own trigger set, but I am struck with the first trigger.
I use to log my status , i.e hp or mp, as variables and it is kind of core to my trigger set
And in my mud the HP status look something like this. (some chinese characters ahead)
Code: Select all
氣 : 8540/ 8540 (100%) 內力: 15000 / 15000 (+0)
**you can consider 氣 as hp, 內力 as mp
Code: Select all
氣%s:%s(%d)%s/%s(%d)%s~((%d)~%~)%s內力%s:%s(%d)%s/%s(%d)%s~(~+(%d)~)
I couldn't do that in Mudlet tho, I have already read the wiki and manual. From there I learnt I can use Perl Regex to log variables
So I convert my trigger pattern like this:
Code: Select all
氣(.*):(.*)(\d+)(.*)/(.*)(\d+)(.*)((\d+)%)(.*)內力(.*):(.*)(\d+)(.*)/(.*)(\d+)(.*)([+](\d+)(.*))
Code: Select all
"氣 : 8540/ 8540 (100%) 內力: 15000 / 15000 (+0)",
" ",
" 854",
"0",
"",
" 8540 (1",
"0",
"",
"0%",
"0",
") ",
"",
" 1500",
"0",
" ",
" 1500",
"0",
" (",
"+0)",
"0",
")"
How should I log my status properly?
Many thanks.