Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ Question about gagging repeated lines

Question about gagging repeated lines

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


Posted by Zuurstof   (13 posts)  Bio
Date Fri 05 Dec 2003 06:50 PM (UTC)
Message
Heya, a while back I asked a similar question but since then i've lost all my scripts and I can't get something to work anymore.

I have a script that catches my hp and shows it to the screen with a fancy color, this is nice and I got that to work and all, but I still have the following problem.

When I quickly move through rooms I get something like
The Lamedon Road(s, w, n and e)
(HP: 230 EP:230)
The Lamedon Road(s, w, n and e)
(HP: 230 EP:230)
The Lamedon Road(s, w, n, e and se)
(HP: 230 EP:230)
The Plains(s, w, n and e)
(HP: 230 EP:230)
The Plains(s, w, n and e)
(HP: 230 EP:230)
Tarlang's Neck(s, w, n and e)
(HP: 230 EP:230)

Now the (HP: 230 EP:230) I send with my script using
a world.ColourTell

It actually looks like [hp: 230 ep:230] but I omit that output with a trigger that calls the function that colors my statusbar so I never get to see it. But now I'm getting rather spammed as you can see in the example with my statusbar. I want to create a script that gag that hp status of mine if it was already shown in the last 2 lines.... for instance...

(HP: 230 EP:230)
The Lamedon Road(s, w, n and e)
(HP: 230 EP:230) ( <-- this would be gone then since it was shown 2 lines ago )
The Lamedon Road(s, w, n, e and se)
(HP: 230 EP:230) ( <-- this too )
The Plains(s, w, n and e)
(HP: 230 EP:230) ( <-- this too )
The Plains(s, w, n and e)
(HP: 230 EP:230) ( <-- this too )
Tarlang's Neck(s, w, n and e)
(HP: 230 EP:230) ( <-- this too )
A faint glow appears in the east.
The sky is dark blue and a yellow glow comes from the east.
The sky is brilliantly clear.
The only obvious exits are south, west, north and east.
(HP: 230 EP:230) ( <-- it should appear here again since I haven't seen the hp bar in the last 2 lines)

I already thought up something but it doesn't work anymore

I tried to use a * trigger that evaluates every line and then it puts line3 = line2 and line2=line1 and line=thewildcards(0) line3,line2,line1 are global vars. So in my other functions where I output my hp status i tried the following but it woudn't work.

if instr(1,Line3,"[") <> 0 and instr(1,Line2,"[") <> 0 then
world.ColourTell "Red", "", "("
world.ColourTell clrHP, "", "HP: " & thewildcards(1)
world.ColourTell clrEP, "", " EP:" & thewildcards(2)
world.ColourNote "Red", "", ")"
End If

I dunno why it doesn't work cuz it looks quite logical to me but still it doesn't work.

Example:

The Plains(s, w, n and e)
[HP: 230 EP: 230]

1: Now the * trigger fills the global vars as following
line 2 = The Plains(s, w, n and e)
line 1 = [HP: 230 EP: 230]

2: Then at the 2nd line my other function should trigger that changes the color etc of the hp status like this:
(HP: 230 EP:230)

so I get to see
The Plains(s, w, n and e)
(HP: 230 EP: 230)

and since line1 is filled with '[HP: 230 EP: 230]' now it should show this when I walk into another room

The Plains(s, w, n and e)

and not this

The Plains(s, w, n and e)
[HP: 230 EP: 230]


Well ok, this is kinda my question, if anybody has a better way to do this i'll be happy to use it. Hope anybody can understand what i'm talking about, but i'll see soon enough:-D

Greetings Zuurstof,


Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 08 Dec 2003 06:28 AM (UTC)
Message
You can use GetLineInfo to get recent lines, however I think a simpler solution would be to, when you get a HP line, save the values (HP, EP) in a couple of variables, and also the line number. Then next time, if the values are the same and the line number is no more than the previous line plus (say) 10, then don't display it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


10,694 views.

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

Go to topic:           Search the forum


[Go to top] top

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