[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Plugin to show an experience bar

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Plugin to show an experience bar
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  3  

Posted by Butlerreuben   (1 post)  [Biography] bio
Date Sat 27 Apr 2013 11:51 PM (UTC)  quote  ]
Message
Im trying to configure this addon for 3kingdoms.

I do not have xp on the bar it comes from typing XP and then I get this:

You have 14,725,973 total xp.
You need 49,027 experience to achieve your next level.
You have 1,975,973 to spend.

XP Gain for the last 30 minutes: 61,605
At this rate you will level in 23 minutes

I seem to be having tons of issues in regards to adapting plugins to this MUD.

I even tried adapting the autohealer and failed.
[Go to top] top

Posted by Renox Dashin   (17 posts)  [Biography] bio
Date Wed 01 Jun 2011 10:28 PM (UTC)  quote  ]
Message
I really appreciate your help Nick. Its like getting help from a MUD celebrity lol. The creator of Mushclient :P
[Go to top] top

Posted by Renox Dashin   (17 posts)  [Biography] bio
Date Wed 01 Jun 2011 10:28 PM (UTC)  quote  ]
Message
theres no way to convert it to a % as the number gets lower, the bar gets higher? We don't have the max exp shown on our MUD it only shows how much you have to go till the next lvl :(
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 01 Jun 2011 10:22 PM (UTC)  quote  ]
Message
Well we still need to know the maximum right? Because it has to be 5678 out of <something>. Once you know that it is easy.

Let's say the maximum is 10000. If you have 5678 to next level, then you have done 4322. So normally I would supply 4322 (that is, the maximum minus the current), and 10000, so the bar shows you as 43.22 percent done.

But you could just not subtract, so it would show 5678/10000 and then get lower and lower.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Renox Dashin   (17 posts)  [Biography] bio
Date Wed 01 Jun 2011 05:31 PM (UTC)  quote  ]
Message
okay so here goes :P
if it is a number that goes downward. such as on my prompt, it was 5678 tnl and i killed something and it goes down. Can I set up the reverse? where its full and as the number gets smaller so does the bar?
[Go to top] top

Posted by Aurion   (6 posts)  [Biography] bio
Date Sat 12 Feb 2011 08:36 PM (UTC)  quote  ]
Message
Ok, I believe that would work but your Health Bar plugin and this plugin do not have the same default prompt. How could I change the prompt for the XP plugin to be "<%h/%H hp %m/%M m %v/%V mv %x/%X xp>" ?
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 10 Feb 2011 08:04 PM (UTC)  quote  ]
Message
So %X is xp_to_level?

And if you were at level 2, and levelled at 10000 XP, and had 9000 XP, then it would show:


9000/1000


Because you have 1000 to go?

It seems to me then that max_xp = 5000, because we are always trying to get to 5000. And current_xp is 5000 minus the wildcard (eg. 5000 - 1000 = 4000). Thus we now get:

4000/5000



function do_prompt (name, line, wildcards, styles)

  current_xp = 5000 - tonumber ((string.gsub (wildcards [5], ",", "")))
  max_xp = 5000
  
  draw_bar ()
  
end -- do_prompt


If that doesn't work throw in a print statement or two to see what the figures are.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Aurion   (6 posts)  [Biography] bio
Date Thu 10 Feb 2011 02:54 PM (UTC)  quote  ]
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?
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Mon 11 May 2009 03:35 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Keith   (21 posts)  [Biography] bio
Date Mon 11 May 2009 07:31 AM (UTC)  quote  ]
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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 05 Mar 2009 12:07 AM (UTC)  quote  ]

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
[Go to top] top

Posted by Trayn318   (5 posts)  [Biography] bio
Date Wed 04 Mar 2009 11:59 PM (UTC)  quote  ]
Message
still won't work. I'm just about to just give up on this and mushclient.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 04 Mar 2009 04:37 AM (UTC)  quote  ]

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
[Go to top] top

Posted by Trayn318   (5 posts)  [Biography] bio
Date Wed 04 Mar 2009 02:03 AM (UTC)  quote  ]

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>
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Tue 03 Mar 2009 08:29 PM (UTC)  quote  ]

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
[Go to top] 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.


19,611 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]