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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Miniwindows
. . -> [Subject]  Miniwindows using VBscript.

Miniwindows using VBscript.

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


Pages: 1 2  

Posted by Scarn   (47 posts)  [Biography] bio
Date Mon 25 Aug 2008 08:40 AM (UTC)
Message
I've tried multiple ways of making miniwindows, however they never seem to work. I've never really learnt advanced VBscript so im not sure how to use other types of script in plugins/triggers etc...

I have 3 years of customised client, I don't want to have to convert that all in Lua, but at the same time I'd love someone to paste a trigger that would load a miniwindow. Once I have the starting frame I can build off it.

Thanks,

Scarn (T2T MUD)
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 25 Aug 2008 09:32 AM (UTC)
Message
Right, can you please post what you have attempted? It is hard to debug problems when you don't give any examples.

- Nick Gammon

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

Posted by Scarn   (47 posts)  [Biography] bio
Date Reply #2 on Mon 25 Aug 2008 09:33 AM (UTC)
Message
They are so messy its pointless. To be honest I don't fully understand how it works. Would a trigger run off my prompt to update the window?
[Go to top] top

Posted by Scarn   (47 posts)  [Biography] bio
Date Reply #3 on Mon 25 Aug 2008 12:53 PM (UTC)
Message
I figured it out, im just figuring out how to apply text into the window now. Having problems with "WindowFont"
[Go to top] top

Posted by Scarn   (47 posts)  [Biography] bio
Date Reply #4 on Mon 25 Aug 2008 01:00 PM (UTC)
Message
status = WindowFont (win, "heading", "Trebuchet MS", 28, true, false, false, false)


Error number: -2146827839
Event: Execution of line 1 column 1
Description: Argument not optional: 'WindowFont'


Called by: Immediate execution



-----


I cannot see why WindowFont shouldn't work? Any ideas anyone?
[Go to top] top

Posted by Fadedparadox   USA  (91 posts)  [Biography] bio
Date Reply #5 on Mon 25 Aug 2008 01:25 PM (UTC)

Amended on Mon 25 Aug 2008 01:27 PM (UTC) by Fadedparadox

Message
For WindowFont you shouldn't need 'a =', just call the function. Also, in testing, it seems the last two arguments (short Charset, short PitchAndFamily) aren't optional in VBscript. Try:

WindowFont win, "heading", "Trebuchet MS", 28, TRUE, FALSE, FALSE, FALSE, 0, 0

[Go to top] top

Posted by Scarn   (47 posts)  [Biography] bio
Date Reply #6 on Mon 25 Aug 2008 01:30 PM (UTC)
Message
Same detail :( Its as if WindowFont isn't a recognised command on my version. I have MUSHclient 4.35... hmmm.

Im having the same problem with WindowDraw as well.

Apart from that im making some great coloured boxed *laughs*
[Go to top] top

Posted by Scarn   (47 posts)  [Biography] bio
Date Reply #7 on Mon 25 Aug 2008 01:35 PM (UTC)
Message
I did some more tweaking and for some reason it works now *cheers* All I need to figure out now is why its working, *laughs*
Great feature btw Nick.
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #8 on Mon 25 Aug 2008 01:47 PM (UTC)
Message
Make sure you put 'world.' in front of the commands in languages other than Lua. To my knowledge, omitting the world object is only supported in Lua and no other languages.
[Go to top] top

Posted by Scarn   (47 posts)  [Biography] bio
Date Reply #9 on Mon 25 Aug 2008 02:27 PM (UTC)
Message
Im having the same problem with displaying an image...


status = WindowDrawImage (6, "im1", 2, 2, 0, 0, 1)


Error number: -2146827839
Event: Execution of line 20 column 1
Description: Argument not optional: 'WindowDrawImage'


Called by: Immediate execution




I played around but couldn't get anywhere.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #10 on Mon 25 Aug 2008 10:11 PM (UTC)
Message
See:

http://www.gammon.com.au/scripts/doc.php?function=WindowDrawImage

WindowDrawImage has the following arguments:


WindowDrawImage (BSTR Name, BSTR ImageId, long Left, long Top, long Right, long Bottom, short Mode, long SrcLeft, long SrcTop, long SrcRight, long SrcBottom);


You haven't supplied them all, which is what the error message is about. (Add 0,0,0,0 to the end). In Lua the last four are optional which is why the examples didn't have them.

- Nick Gammon

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

Posted by Scarn   (47 posts)  [Biography] bio
Date Reply #11 on Wed 27 Aug 2008 06:27 PM (UTC)
Message
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="^HP\:(\d+)\/(\d+) EP\:(\d+)\/(\d+) REG\:* \&gt;$"
name="InfoBar"
regexp="y"
script="DoPrompt"
send_to="12"
sequence="100"
>
<send>setvariable "Health", "%1"
setvariable "Energy", "%3"
setvariable "Region", "%5"

status = WindowCreate ("6", 45,45, 290, 670, 6, 0, ColourNameToRGB (""))

status = WindowLoadImage (6, "im1", "C:/Users/Mark/Pictures/planks.bmp")
status = WindowDrawImage (6, "im1", 2, 2, 0, 0, 1, 0, 0, 0, 0)

status = WindowText (6, "heading", " Bank: @Bank",5, 245, 0, 0,ColourNameToRGB ("white"),false)
status = WindowText (6, "heading", " NPCTarget:",5, 275, 0, 0,ColourNameToRGB ("white"),false)
status = WindowText (6, "heading", " @KillMonster",20, 300, 0, 0,ColourNameToRGB ("white"),false)






status = WindowShow (6, true)







</send>
</trigger>
</triggers>






This trigger fires with no error messages popping up, I can also change the colour of the window however even though loaded - the image fails to appear.
[Go to top] top

Posted by Fadedparadox   USA  (91 posts)  [Biography] bio
Date Reply #12 on Wed 27 Aug 2008 07:56 PM (UTC)
Message
I tried your script with an image in that directory and it worked perfectly for me. Try this with a note after each line, like:


status = WindowCreate ("6", 45, 45, 290, 670, 6, 0, ColourNameToRGB ("white"))

Note status

status = WindowLoadImage (6, "im1", "C:/Users/Mark/Pictures/planks.bmp")

Note status

status = WindowDrawImage (6, "im1", 45, 45, 0, 0, 1, 0, 0, 0, 0)

Note status

status = WindowShow (6, true)

Note status


And see if any lines give you an error? All should return 0 (eOK). You won't actually get an error message normally if it doesn't work, even if it returns an error code to status, you have to look at the variable manually.
[Go to top] top

Posted by Scarn   (47 posts)  [Biography] bio
Date Reply #13 on Wed 27 Aug 2008 08:12 PM (UTC)
Message
I placed a "Note status" in and it works fine, thank you!!!
[Go to top] top

Posted by Scarn   (47 posts)  [Biography] bio
Date Reply #14 on Wed 27 Aug 2008 08:46 PM (UTC)

Amended on Wed 27 Aug 2008 09:14 PM (UTC) by Scarn

Message
Here is how my client is coming along, thanks for all the help!

http://www.freewebs.com/bethagan/Untitled.jpg


The blank space in the bottom right hand corner; my infobar doesn't stretch across the whole length of the screen. Any way I can fix that?
My next step is to make a miniwindow above the command prompt, containing my Health/Energy etc.. and get away with the INFOBAR all together.

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


44,164 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]