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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Jscript
. . -> [Subject]  js,miniwindows Drawing text syntax error
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

js,miniwindows Drawing text syntax error

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


Posted by Dengli   (2 posts)  [Biography] 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??
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[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.


3,888 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 FutureQuest]