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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Windows form element?

Windows form element?

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


Pages: 1 2  

Posted by Ashass   (50 posts)  [Biography] bio
Date Sun 28 Nov 2010 03:53 AM (UTC)
Message
Is it possible to create any windows that pop up, similar to an MS Access form? Doesn't have to be exactly that of course. Pondering things like launching a web page [local] that has custom asp scripting, that's good for some stuff, but really I'd like to just have a simple form that I can track status effects, draw a mini map of the area I'm in, or push directional arrows to move that direction (think numpad movement, but gui format.)

This could eventually lead into more complex actions, such as clicking somewhere on a displayed map, and issuing a speedwalk trigger to move to said room.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sun 28 Nov 2010 04:00 AM (UTC)
Message
Not forms that you fill in, but miniwindows do a lot of that:

Template:post=10346 Please see the forum thread: http://gammon.com.au/forum/?id=10346.


If you want to ask questions and get responses, switch to Lua and then you get various utilities that let you pop up dialog boxes (although VBscript has some of those too).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Ashass   (50 posts)  [Biography] bio
Date Reply #2 on Sun 28 Nov 2010 06:29 AM (UTC)
Message
This is pretty much what I've been trying to find, thanks Nick. I'll look into the syntax more in the morning, gotten some basic windows shown / text etc.

Are the instances of windows automatically deleted when you close the client - but save the world details? Or do you have to manually destroy each window created?
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #3 on Sun 28 Nov 2010 06:45 AM (UTC)
Message
The "windows" are really drawn directly onto MUSHclient's output window; they're not OS-provided or -owned. When MUSHclient closes, the miniwindows disappear, and the client starts again without any miniwindows. (This isn't a problem, because plugins just create their miniwindows when they're loaded.)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Ashass   (50 posts)  [Biography] bio
Date Reply #4 on Sun 28 Nov 2010 07:06 AM (UTC)

Amended on Sun 28 Nov 2010 07:29 AM (UTC) by Ashass

Message
Trying to actually write text, and every time I do, I get errors. lots and lots-

This causes an issue

15*:   WindowText win, "Status", "test", 5, 5, 0, 0, "blue"


and this


  15 :   WindowText win, "f", "Quest Log", 0
  16*:             5, 10, 0, 0,
  17 :             ColourNameToRGB ("blue"), 
  18 :             false


and this



WindowText win, "Status", "test", 5, 5, 0, 0


Oddly, this doesn't error [but it also doesn't do anything I can see]


WindowText win, "Status", "test", 0,0,0,0,0,0



[EDIT]

Here's the context:

sub createstatus (strAliasName, strOutput, arrWildCards)
  world.WindowCreate "Status", 0, 0, 400, 800, 6, 0, world.ColourNameToRGB("white")
  WindowFont win, "Status", "Trebuchet MS", 12, TRUE, FALSE, FALSE, FALSE, 0, 0
end sub

sub showstatus (strAliasName, strOutput, arrWildCards)
  WindowShow "Status", true
end sub

sub hidestatus (strAliasName, strOutput, arrWildCards)
  WindowShow "Status", false
end sub

sub writetext (strAliasName, strOutput, arrWildCards)
   WindowText win, "Status", "test", 0,0,0,0,0,0          
end sub
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #5 on Sun 28 Nov 2010 07:10 AM (UTC)

Amended on Sun 28 Nov 2010 07:11 AM (UTC) by Twisol

Message
What errors?

[EDIT]: Oh, and you're missing a comma in your second example.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Ashass   (50 posts)  [Biography] bio
Date Reply #6 on Sun 28 Nov 2010 07:22 AM (UTC)
Message
Script error
World: DSL
Execution of line 15 column 39
Immediate execution
Syntax error
Line in error: 
  WindowText win, "f", "Quest Log", 0,
Error context in script:
  11 :   WindowShow "Status", false
  12 : end sub
  13 : 
  14 : sub writetext (strAliasName, strOutput, arrWildCards)
  15*:   WindowText win, "f", "Quest Log", 0,
  16 :              5, 10, 0, 0,
  17 :              ColourNameToRGB ("blue"), 
  18 :              false
  19 : end sub
[Go to top] top

Posted by Ashass   (50 posts)  [Biography] bio
Date Reply #7 on Sun 28 Nov 2010 07:24 AM (UTC)
Message
Changing it all to one line (instead of multiline like the sample) results in this:

Script error
World: DSL
Execution of line 15 column 3
Function/Sub: writetext called by alias
Reason: processing alias "writetext"
Wrong number of arguments or invalid property assignment: 'WindowText'
Error context in script:
  11 :   WindowShow "Status", false
  12 : end sub
  13 : 
  14 : sub writetext (strAliasName, strOutput, arrWildCards)
  15*:   WindowText win, "Status", "Quest Log", 0, 5, 10, 0, 0,ColourNameToRGB ("blue"), false
  16 : end sub
  17 : 
  18 : sub mssqlconn (strAliasName, strOutput, arrWildCards)
  19 :   Dim UserDB
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #8 on Sun 28 Nov 2010 07:25 AM (UTC)
Message
I'm not too familiar with VBscript, but there are two things you might want to try.

1) Put it on a single line. A recent issue had to do with formatting, so it can't hurt to try.

2) Put parentheses around the arguments. I know VBscript has a weird sub/function distinction, but it can't hurt to try either.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Ashass   (50 posts)  [Biography] bio
Date Reply #9 on Sun 28 Nov 2010 07:30 AM (UTC)

Amended on Sun 28 Nov 2010 07:33 AM (UTC) by Ashass

Message
WindowText win, "Status", "Quest Log", 0, 5, 10, 0, 0,ColourNameToRGB ("blue"), false


is now

WindowText win, "Status", "Quest Log", 5, 10, 0, 0,ColourNameToRGB ("blue"), false


No error, but no text actually shows.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #10 on Sun 28 Nov 2010 07:32 AM (UTC)

Amended on Sun 28 Nov 2010 07:34 AM (UTC) by Twisol

Message
Add a WindowShow win, true call right after that. MUSHclient doesn't redraw the output window until text comes in or Redraw, WindowShow, or one other I forget is called.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Ashass   (50 posts)  [Biography] bio
Date Reply #11 on Sun 28 Nov 2010 07:34 AM (UTC)
Message
Yeah... that did nothing =P

The window is already shown, so i have a white palette, but no text appears on that palette.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Sun 28 Nov 2010 07:46 AM (UTC)
Message

WindowFont win, "Status", "Trebuchet MS", 12, TRUE, FALSE, FALSE, FALSE, 0, 0


Is "Status" the font or the window? You really need a font name (eg. "f") and a window name.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #13 on Sun 28 Nov 2010 07:48 AM (UTC)
Message
I know it's already shown, the point was to refresh the view. Which apparently didn't work.

Try Note'ing the return value from WindowText (and WindowFont). If anything's not 0, go to the errors list [1] and find what it means.

[1] http://www.gammon.com.au/scripts/function.php?action=errors

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Ashass   (50 posts)  [Biography] bio
Date Reply #14 on Sun 28 Nov 2010 07:48 AM (UTC)
Message
Status is the window, 'f' is the font.

world.WindowCreate "Status", 0, 0, 400, 800, 6, 0, world.ColourNameToRGB("white")
  WindowFont win, "f", "Trebuchet MS", 12, TRUE, FALSE, FALSE, FALSE, 0, 0


So how does that translate into windowtext?
[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.


63,851 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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 HostDash]