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.
 Entire forum ➜ MUSHclient ➜ Miniwindows ➜ Miniwindows using VBscript.

Miniwindows using VBscript.

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


Pages: 1 2  

Posted by Scarn   (47 posts)  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)
Top

Posted by Nick Gammon   Australia  (23,102 posts)  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
Top

Posted by Scarn   (47 posts)  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?
Top

Posted by Scarn   (47 posts)  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"
Top

Posted by Scarn   (47 posts)  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?
Top

Posted by Fadedparadox   USA  (91 posts)  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

Top

Posted by Scarn   (47 posts)  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*
Top

Posted by Scarn   (47 posts)  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.
Top

Posted by Worstje   Netherlands  (899 posts)  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.
Top

Posted by Scarn   (47 posts)  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.
Top

Posted by Nick Gammon   Australia  (23,102 posts)  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
Top

Posted by Scarn   (47 posts)  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.
Top

Posted by Fadedparadox   USA  (91 posts)  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.
Top

Posted by Scarn   (47 posts)  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!!!
Top

Posted by Scarn   (47 posts)  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.
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.


49,121 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 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.