Info Bar script

Posted by David B on Mon 25 Aug 2003 02:36 PM — 8 posts, 26,241 views.

USA #0
I downloaded the pluggin, Not sure what the trigger needs to be to make it work.

However, what I'd really like for it to do is just show my Experience to level as the bar.
Australia Forum Administrator #1
I'm not sure either, as I don't know what your prompt looks like.
USA #2
<100%HP|86%Mana|100%Move> <F>
<91%XTL>(STL: Light footed)(Night)


I can modify that of course to whatever I want.

Looking at the other post about infobar information has given me a few idea's as to how to do it, I'd use a regular expression trigger for the XTL(eXperience To Level)

I figure I could simple use a base variable, and compare the XTL trigger to that in the script instead of having to add a /100 to my prompt.

Not sure what to do from here.
USA #3
All right... I got most of this worked out now...

I'm doing it a little different that a normal script would do it because I know that the max its ever going to be is 100, which suits my needs perfectly.

 world.note ""
world.infoclear
world.InfoFont "FixedSys", 12, 0
world.setvariable "EXPTOLEVEL", "%1"
dim EXPTICK
EXPTICK = "|"
dim count
 for count = 1 to world.getvariable ("EXPTOLEVEL")
  <this is the part I'm having trouble with right here>
next
world.note "Experience to Level " & EXPTICK & world.getvariable ("EXPTOLEVEL") & "%"


This if course in in my trigger being sent to script..

I don't know how to get the little "|" part to repeat inside the internal variable EXPTICK

I got Invalid use of NULL error, which is fine, I didn't expect it to work anyways, I did a bit of research, and found out that the Error was due to invalid data

The problem I'm having is figuring out how to ADD a | to EXPTICK, once I get that I'll have it all figured out.

Also, I'd like to use something other than little | more of a bar would be really neat, I can change the color and everything once I get it working the way I want.

In the end what I think I'll end up doing is just
world.info EXPTICK
That should ultimately put whatever I end up using as a character right up dere on my info bar.

Thanks for the help
What I'd like the Info Bar too look like is this:

Experience to Level ||||||||||||||||||||||||||||||||||||||||||42%
Experience to Level |||||||||||||||||||||||||||||||||||||||||||43%
Experience to Level |1%
Experience to Level ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||98%

Amended on Wed 27 Aug 2003 09:21 PM by David B
USA #4
world.note ""
world.infoclear
world.InfoFont "FixedSys", 12, 0
world.setvariable "EXPTOLEVEL", "%1"
dim EXPTICK
dim TICKER
TICKER = "|"
EXPTICK = ""
dim count
 for count = 1 to world.getvariable ("EXPTOLEVEL")
  EXPTICK = (EXPTICK + TICKER)
next
world.info "Experience to Level " & EXPTICK & world.getvariable ("EXPTOLEVEL") & "%"


That is the Final Code, I figured it out without help!

That of course is set to a regexp trigger that's omited from the output Hence the world.note ""

I'm lucky in that I don't have to worry about Too many numbers with HP/Mana/Move or EXP per level. Its all in % form.

USA #5
Regarding my post above....

Is there anyway to add another aspect to it?

I'd like for it also to display any difference in exp between prompts.

If I have 50%XTL and it changes to 49%XTL I'd like it to show off to the right: You gained 1%

But I don't want it to show 0% gain every time I get a prompt, Only when my EXPTOLEVEL variable actually changes... I'm at a total loss as to how to do this.

I was thinking along the lines of something like this:

dim XPOLD, XPNEW, XPDIFF
XPOLD = world.getvariable ("XPOLD")
XPNEW = %1
XPDIFF = (XPNEW - XPOLD)
world.setvariable ("XPOLD"), XPNEW


But that for some reason always shows a 0% when it gets sent to a world.note
Amended on Thu 28 Aug 2003 03:29 AM by David B
Australia Forum Administrator #6
Try this change:

XPOLD = CInt (world.getvariable ("XPOLD"))

That makes the variable an integer, otherwise it might think you are subtracting a number from a string.
USA #7
I figured out my problem, that CInt works well, Thanks for the tip

Final scrip:

dim XPOLD, XPNEW, XPDIFF
world.setvariable "XPNEW", "%1"
XPOLD = CInt(world.getvariable ("XPOLD"))
XPNEW = CInt(world.getvariable ("XPNEW"))
XPDIFF = (XPOLD - XPNEW)
world.setvariable ("XPOLD"), XPNEW
world.setvariable "XPDIFF", XPDIFF
world.note world.getvariable ("XPDIFF")
world.enabletrigger "XP", FALSE



It disables itself when it's run, its turned on when a mob dies. That was it only checks when potential exp is gained. Otherwise it would say 0 all the time, and when I did gain exp it would only be there till the next prompt.

I just call the variable XPDIFF in my other trigger to put it into the info bar along with everything else.