[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?

Plugin to show an experience bar

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


Pages: 1  2 

Posted by Doomfyre   (12 posts)  [Biography] bio
Date Thu 26 Feb 2009 03:12 PM (UTC)  quote  ]
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.
[Go to top] top

Posted by Zeno   USA  (2,776 posts)  [Biography] bio
Date Sat 28 Feb 2009 05:09 PM (UTC)  quote  ]
Message
Trying to put this on a slightly different prompt. I changed the trigger to this:
  <trigger
   enabled="y"
   name="XPprompt"
   match="\&lt;Health:[([\d,]+)\/([\d,]+)] (Jakai|Chi):[([\d,]+)\/([\d,]+)] Stamina:[([\d,]+)\/([\d,]+)]\&gt; [\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
[Go to top] top

Posted by Nick Gammon   Australia  (15,726 posts)  [Biography] bio
Date Sat 28 Feb 2009 07:17 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Trayn318   (5 posts)  [Biography] bio
Date Mon 02 Mar 2009 02:00 AM (UTC)  quote  ]
Message
I can't get the bar to appear, is there some tab I should have open or anything?
[Go to top] top

Posted by Nick Gammon   Australia  (15,726 posts)  [Biography] bio
Date Mon 02 Mar 2009 05:10 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Trayn318   (5 posts)  [Biography] bio
Date Tue 03 Mar 2009 08:15 PM (UTC)  quote  ]

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

Posted by Zeno   USA  (2,776 posts)  [Biography] bio
Date Tue 03 Mar 2009 08:17 PM (UTC)  quote  ]
Message
Turn on Game->Trace and see if the trigger is being matched.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (15,726 posts)  [Biography] bio
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

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  (15,726 posts)  [Biography] bio
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 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  (15,726 posts)  [Biography] bio
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 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 Zeno   USA  (2,776 posts)  [Biography] bio
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

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.


7,621 views.

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

[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]