Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Plugins
➜ Plugin to show an experience bar
Plugin to show an experience bar
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2 3
Posted by
| Doomfyre
(12 posts) Bio
|
Date
| Reply #15 on Thu 26 Feb 2009 03:12 PM (UTC) |
Message
| Alrighty, it works now with the upgrade. I apologize for all the hassle. Now to pretty up the bar some :)
Thanks for both of your time. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #16 on Sat 28 Feb 2009 05:09 PM (UTC) |
Message
| Trying to put this on a slightly different prompt. I changed the trigger to this:
<trigger
enabled="y"
name="XPprompt"
match="\<Health:[([\d,]+)\/([\d,]+)] (Jakai|Chi):[([\d,]+)\/([\d,]+)] Stamina:[([\d,]+)\/([\d,]+)]\> [\d,]+\/[\d,]+xp(.*?)$"
script="do_prompt"
regexp="y"
sequence="100"
>
Which matches the prompt correctly.
Then I am using wildcards[8] and wildcards[9], but it appears they are both nil values for some reason. wildcards[7] is the last Stamina num, so 8 and 9 should be the XP. Not sure why it's nil. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #17 on Sat 28 Feb 2009 07:17 PM (UTC) |
Message
|
\<Health:\[([\d,]+)\/([\d,]+)\] (Jakai|Chi):\[([\d,]+)\/([\d,]+)\] Stamina:\[([\d,]+)\/([\d,]+)\]\> [\d,]+\/[\d,]+xp(.*?)$
1 2 3 4 5 6 7 8
I only count 8 wildcards, including the rest of the line, see above. Did you forget the brackets? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Trayn318
(5 posts) Bio
|
Date
| Reply #18 on Mon 02 Mar 2009 02:00 AM (UTC) |
Message
| I can't get the bar to appear, is there some tab I should have open or anything? | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #19 on Mon 02 Mar 2009 05:10 AM (UTC) |
Message
| The bar appears when the trigger matches the prompt line. If it doesn't appear, it hasn't matched.
As I indicated on the first page of this thread, you need to change your prompt in Smaug to show experience. If you haven't done that, try that. Otherwise if it is a different MUD, please show what a prompt line looks like, and what you have changed the trigger to, if anything. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Trayn318
(5 posts) Bio
|
Date
| Reply #20 on Tue 03 Mar 2009 08:15 PM (UTC) Amended on Tue 03 Mar 2009 08:17 PM (UTC) by Trayn318
|
Message
| I did everthing you said in your post nick and it's still not poping up.
here's the prompt lines.
<1,099/1,099 hp 585,302/585,302 m 100/100 mv>
| Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #21 on Tue 03 Mar 2009 08:17 PM (UTC) |
Message
| Turn on Game->Trace and see if the trigger is being matched. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #22 on Tue 03 Mar 2009 08:29 PM (UTC) Amended on Tue 03 Mar 2009 08:30 PM (UTC) by Nick Gammon
|
Message
| The original plugin matched this prompt:
<28hp 100m 102mv 2875/6325xp>
(The numbers may differ).
Yours doesn't look anything like that. For one thing, you aren't showing experience at all.
How can it draw an experience bar, if the prompt doesn't have xp figures in it? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Trayn318
(5 posts) Bio
|
Date
| Reply #23 on Wed 04 Mar 2009 02:03 AM (UTC) Amended on Wed 04 Mar 2009 02:06 AM (UTC) by Trayn318
|
Message
| ok here's what it says now and it still now working.
<1,099hp 585,302m 100mv 3,986,839,823,207/3,986,839,823,207xp>
and i got this error
[string "Plugin"]:97: attempt to perform arithmetic on a nil value
stack traceback:
[string "Plugin"]:97: in function <[string "Plugin"]:93> | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #24 on Wed 04 Mar 2009 04:37 AM (UTC) Amended on Wed 04 Mar 2009 04:46 AM (UTC) by Nick Gammon
|
Message
| It hasn't alllowed for commas in the numbers. Inside the plugin, change lines 135 and 136 from:
current_xp = tonumber (wildcards [4])
max_xp = tonumber (wildcards [5]) + current_xp
to:
current_xp = tonumber ((string.gsub (wildcards [4], ",", "")))
max_xp = tonumber ((string.gsub (wildcards [5], ",", ""))) + current_xp
Make sure you reinstall the plugin afterwards (hit the Reinstall button).
That worked for me on your prompt. However I note that both numbers in your example are the same (3,986,839,823,207). As currently written that displays a half-way through experience bar, as it thinks you have 3,986,839,823,207 xp to go.
It seems a bit strange that you are exactly half-way through the level (or completely through, if it is xp/total xp). You may need to remove the "+ current_xp" from the second line. Are you sure you are displaying current xp / maximum xp? Otherwise the bar will always be either half-full or completely full. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Trayn318
(5 posts) Bio
|
Date
| Reply #25 on Wed 04 Mar 2009 11:59 PM (UTC) |
Message
| still won't work. I'm just about to just give up on this and mushclient. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #26 on Thu 05 Mar 2009 12:07 AM (UTC) Amended on Thu 05 Mar 2009 12:09 AM (UTC) by Nick Gammon
|
Message
| You got the trigger to match before, because it caused an error message on the commas. In what way does it "still won't work"?
Do you still get the error message? Or does it simply not display the experience bar? You have to give a bit more information than "it doesn't work" if you want any help.
If you get an error message please post it.
If you are still getting the error message make sure you changed the two lines I said, and reinstalled the plugin. If you didn't reinstall the plugin it is still using the old code.
Most MUDs are different in the way they display prompt lines. You can't expect the plugin to just display information it doesn't actually have, or in a format it doesn't understand. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Keith
(21 posts) Bio
|
Date
| Reply #27 on Mon 11 May 2009 07:31 AM (UTC) |
Message
| Is there anyway to do this plugin for CircleMUD? im new to all of this and i was just wondering how i would do it. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #28 on Mon 11 May 2009 03:35 PM (UTC) |
Message
| Read the first post.
Quote: If you have a different prompt, or find your experience out in a different way, you would need to change the trigger. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Aurion
(6 posts) Bio
|
Date
| Reply #29 on Thu 10 Feb 2011 02:54 PM (UTC) |
Message
| Ok, the MUD I play on runs off of a 5000 xp per level system where it's ALWAYS 5000 xp to level and the script runs off of the assumption that your prompt will output the xp you need to get in order to level when you type %X into the prompt. In the MUD I'm using, %x gives your current xp and %X gives 5000-current xp. How could I change the xp bar so that it's full at 5000, not at %X? | Top |
|
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.
130,185 views.
This is page 2, subject is 3 pages long:
1
2 3
It is now over 60 days since the last post. This thread is closed.
Refresh page
top