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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Info Bar script

Info Bar script

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by David B   USA  (80 posts)  [Biography] bio
Date Mon 25 Aug 2003 02:36 PM (UTC)
Message
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.

My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 26 Aug 2003 07:12 AM (UTC)
Message
I'm not sure either, as I don't know what your prompt looks like.

- Nick Gammon

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

Posted by David B   USA  (80 posts)  [Biography] bio
Date Reply #2 on Tue 26 Aug 2003 02:54 PM (UTC)
Message
<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.

My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
[Go to top] top

Posted by David B   USA  (80 posts)  [Biography] bio
Date Reply #3 on Wed 27 Aug 2003 04:58 PM (UTC)

Amended on Wed 27 Aug 2003 09:21 PM (UTC) by David B

Message
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%


My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
[Go to top] top

Posted by David B   USA  (80 posts)  [Biography] bio
Date Reply #4 on Wed 27 Aug 2003 09:53 PM (UTC)
Message
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.


My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
[Go to top] top

Posted by David B   USA  (80 posts)  [Biography] bio
Date Reply #5 on Wed 27 Aug 2003 11:37 PM (UTC)

Amended on Thu 28 Aug 2003 03:29 AM (UTC) by David B

Message
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

My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Thu 28 Aug 2003 06:49 AM (UTC)
Message
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.

- Nick Gammon

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

Posted by David B   USA  (80 posts)  [Biography] bio
Date Reply #7 on Thu 28 Aug 2003 03:16 PM (UTC)
Message
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.

My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
[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.


16,570 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]