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 ➜ Bug reports ➜ World.Tell Crashes MUSHClient

World.Tell Crashes MUSHClient

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


Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Wed 06 Nov 2002 11:12 AM (UTC)
Message
For some obscure reason, this segment crashes MUSHClient

Sub subShowReport (strName, strLine, strWildcards)
Dim intCounter

'World.Notecolourfore = vbGreen
World.Note "----------------------------================= EQHit Report =================----------------------------"
World.Note "| ### | Name | AC | Al | Hts | Ttl | Rpr |"
World.Note "--------------------------------------------------------------------------------------------------------"

'World.Notecolourfore = vbGray
For intCounter = 0 to UBound(strEQTable, 2)
World.Tell "| "
World.Tell fnSpacePad(intCounter, 3, True)
World.Tell " | "
World.Tell fnSpacePad(strEQTable(0, intCounter), 66, False)
World.Tell " | "
World.Tell fnSpacePad(strEQTable(1, intCounter), 2, True)
World.Tell " | "
World.Tell fnSpacePad(strEQTable(2, intCounter), 2, True)
World.Tell " | "
World.Tell fnSpacePad(strEQTable(3, intCounter), 3, True)
World.Tell " | "
World.Tell fnSpacePad(strEQTable(4, intCounter), 3, True)
World.Tell " | "
World.Tell fnSpacePad(strEQTable(5, intCounter), 3, True)
World.Note " |"
Next
World.Note "--------------------------------------------------------------------------------------------------------"
World.Note ""
End Sub

I commented the World.setforecolor out, because it crashed there as well. Please fix this, i am writing a plugin and i really need world.tell :(

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Shadowfyr   USA  (1,792 posts)  Bio
Date Reply #1 on Wed 06 Nov 2002 08:44 PM (UTC)
Message
Hmm.. Ok. Did you consider doing something like -

dim fore, back
fore = vbGreen
back = black
world.colournote fore,back,"...

This would be prefered I would think, since it doesn't permanently change the color, thus avoiding the need to change it again every time you want to use world.note or world.tell.

As for the problem you mention.. If this 'is' in a plugin, then maybe trying to set the colors from inside it is causing the problem.. You may be the first person to try using it. Congradulations. ;) lol
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #2 on Wed 06 Nov 2002 08:47 PM (UTC)
Message
I will, but i need variables for that, and well, it's preferable that you fix the bug instead of me changing my code :) I will try your suggestion too though, thanks :) (although i seem to recall that i tried that too, and still crashed)

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #3 on Wed 06 Nov 2002 08:48 PM (UTC)
Message
Ok, strike that about you fixing the bug, serves me right for not looking at who's posting the message before i reply :) I thought you were Nick :p

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Shadowfyr   USA  (1,792 posts)  Bio
Date Reply #4 on Wed 06 Nov 2002 09:09 PM (UTC)
Message
Lol.. That's OK, Nick does the same thing. ;)

However,if colournote and colourtell are doing it as well, then the problem is definitely odd, since I use both quite a bit in my own plugins and haven't had a problem. Good luck..
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #5 on Wed 06 Nov 2002 11:22 PM (UTC)
Message
As it turns out, colournote works fine, but i need to color many different letters on the same line, and i have to use colournotefore :(

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #6 on Thu 07 Nov 2002 02:41 AM (UTC)
Message
There is no predefined constant vbGray, so you are passing an empty variant down to a script that is expecting an integer. Somewhere this is causing a stack problem.

I suggest using NoteColourName, that lets you do the same thing with colour names (any known MUSHclient colour name from the colour picker). You can set foreground or background or both.

eg.

world.NoteColourName "gray", "" ' set foreground colour to gray

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shadowfyr   USA  (1,792 posts)  Bio
Date Reply #7 on Thu 07 Nov 2002 03:47 AM (UTC)
Message
Also.. There is a 'world.colourtell' command too and you don't have to do them by variables. i.e.

world.colourtell "Red","Black","H"
world.colourtell "Green","Black","i"
world.colournote "Blue",Black","!"

I just suggested the variable sine it lets you replace one thing, instead of every line. ;) In general setting the note color is something you probably should only do to make sure someone elses plugin doesn't change it on you, otherwise the colournote and colourtell commands are generally better imho.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #8 on Thu 07 Nov 2002 04:20 AM (UTC)
Message
I was testing something else (my database plugin) when I noticed that after a colourtell the colours were not necessarily restored for the next world.note.

In fact, a test was backwards, this resulted in the colours not being restored correctly, and even might have caused the crash you have noticed.

- 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.


19,460 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.