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 ➜ Jscript ➜ js,miniwindows Drawing text syntax error

js,miniwindows Drawing text syntax error

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


Posted by Dengli   (2 posts)  Bio
Date Sat 09 Mar 2013 10:35 AM (UTC)
Message
function ok(){
Note ("Loading constants.js is ok");
eval( Include("D:/Game/Mud/myDoc3-8/plugins/constants.js") );

var win ="test_"+ GetPluginID ()

WindowCreate (win, 0, 0, 180, 80,6,0, ColourNameToRGB("lightblue")) //475,line
WindowRectOp (win, 5, 0, 0, 55, 25, 6,15 + 0x0800)

WindowFont (win, "f", "Trebuchet MS", 28, true, false, false, false)

width = WindowTextWidth (win, "f", "Lazy dog yawns")
height = WindowFontInfo (win, "f", 1)
ascent = WindowFontInfo (win, "f", 2)
descent = WindowFontInfo (win, "f", 3)
leading = WindowFontInfo (win, "f", 4)

WindowText (win, "f",
"Lazy dog yawns",
5, 20, 0, 0,
ColourNameToRGB ("darkgreen"),
false)

WindowShow (win, true)
}


Script Error
The game: Peking knight line MUSHClient4.43 Green Edition
The implementation of 475 rows and 2 columns
Immediate execution
Parameter is Required


Please advise which is why??
Top

Posted by Nick Gammon   Australia  (23,166 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 09 Mar 2013 08:37 PM (UTC)
Message
Copying your shown code on its own I find that the error is in line 3:


 eval( Include("D:/Game/Mud/myDoc3-8/plugins/constants.js") );


I'm not familiar with what that does, but I suggest you look it up. If these are the MUSHclient constants you can probably live without them.

Commenting that out, I then get an error (Argument not optional) on this line:


WindowFont (win, "f", "Trebuchet MS", 28, true, false, false, false)


Template:function=WindowFont WindowFont

The documentation for the WindowFont script function is available online. It is also in the MUSHclient help file.




long WindowFont(BSTR WindowName, BSTR FontId, BSTR FontName, double Size, BOOL Bold, BOOL Italic, BOOL Underline, BOOL Strikeout, short Charset, short PitchAndFamily);


You need two more arguments (Charset and PitchAndFamily).

This is basic stuff. When you get an error message, find the line number, look at what is on that line, and work out what is wrong with it.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,166 posts)  Bio   Forum Administrator
Date Reply #2 on Sat 09 Mar 2013 08:38 PM (UTC)
Message
The examples on the Miniwindows documentation use Lua, which allows default arguments, so copying and pasting may not always work. It might be easier to use Lua, unless you really like JScript.

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