[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]  Health and Experience and Bars, oh my!

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Health and Experience and Bars, oh my!

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


Pages: 1  2  3  4 

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #45 on Tue 01 Mar 2011 06:44 AM (UTC)  quote  ]
Message
Caelen said:
I'm not sure what you're asking for... what I pasted above included the command (hp and hpp respectively), the output from the game (the line with HP quantity and HP %), and then what was printed by the debugg scripts.

Oh, heh. I must be more tired than I thought.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Caelen   (81 posts)  [Biography] bio
Date Reply #46 on Tue 01 Mar 2011 06:50 AM (UTC)  quote  ]
Message
Twisol said:

Oh, heh. I must be more tired than I thought.

I broke it down for ya in an edit :x
[Go to top] top

Posted by Caelen   (81 posts)  [Biography] bio
Date Reply #47 on Tue 01 Mar 2011 07:04 AM (UTC)  quote  ]
Message
hp
HP:246/306  SP:33/238  EP:113/155
> 
hpp
HP:80%  SP:13%  EP:72%
HP:244/306%80 -- printed
SP:30/238%13 -- printed
EP:20/155%72 -- printed
> 


printing all from the do_prompt_percent...

the HP one looks right, and the SP one too...

but the EP? O_o
[Go to top] top

Posted by Caelen   (81 posts)  [Biography] bio
Date Reply #48 on Tue 01 Mar 2011 07:06 AM (UTC)  quote  ]
Message
Caelen said:

function do_prompt_percent (name, line, wildcards)

  hpp = tonumber (wildcards [1])
  spp = tonumber (wildcards [2])
  epp = tonumber (wildcards [3])
  hp = max_hp * ( hpp / 100 )
  sp = max_sp * ( spp / 100 )
  ep = max_ep * ( spp / 100 )
  print ("HP:" .. hp .. "/" .. max_hp .. "%" .. hpp)
  print ("SP:" .. sp .. "/" .. max_sp .. "%" .. spp)
  print ("EP:" .. ep .. "/" .. max_ep .. "%" .. epp)

  draw_the_bars ()
      
end -- do_prompt_percent



...

I found the problem XD

ep = max_ep * ( spp / 100 )

spp, not epp... fixed!
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Reply #49 on Tue 01 Mar 2011 07:34 AM (UTC)  quote  ]
Message
So the debugging prints helped, huh?

That's what usually happens to me. I'm not trying to be smart, I make lots of mistakes. But debugging techniques help find them.

- Nick Gammon

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

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #50 on Tue 01 Mar 2011 07:39 AM (UTC)  quote  ]
Message
D'oh! :D

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Caelen   (81 posts)  [Biography] bio
Date Reply #51 on Tue 01 Mar 2011 09:27 AM (UTC)  quote  ]
Message
Definitely helped. Also took a bit more testing to find the problem... I was only testing the EP, which was the problem!

Now... to work on my other project! http://www.gammon.com.au/forum/?id=10962
[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.


8,159 views.

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

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