World.Tell Crashes MUSHClient

Posted by Poromenos on Wed 06 Nov 2002 11:12 AM — 9 posts, 20,585 views.

Greece #0
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 :(
USA #1
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
Greece #2
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)
Greece #3
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
USA #4
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..
Greece #5
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 :(
Australia Forum Administrator #6
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
USA #7
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.
Australia Forum Administrator #8
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.