Post Reply Home » Forums » Vanguard » VGExtreme General Discussion

WScript Object, please help : VGExtreme General Discussion

Posted: April 8th, 2007
kryologik
I'm trying to use WScript.ConnectObject (need to handle some events) and it's saying "Object required: 'WScript'.

I wrote all the code in a .vbs and now I'm trying to port it into my Paladin Bot. What do I need to do to be able to use wscript?
Posted: April 8th, 2007
kryologik
.. or is there some other way I can go about connecting the object to the program so that I can handle object events?
Posted: April 10th, 2007
xaraph
Maybe try using the COM.CreateCOMObject() as described in the Wiki documentation for exhume:

http://www.xunleashed.com/wiki/index.ph ... eCOMObject

I'm pretty sure that duplicates the wscript.ConnectObject functionality.
Posted: April 10th, 2007
kryologik
Doesn't enable the handling of events though =( I'm in desperate need of getting this to work =( I have all the code from my remote webserver / remote control daemon written and working in regular vbs, just need it to work in exhume now =(.


When I wrote this tcp daemon in regular .vbs, I used:

Code: Select all

Set myBot = CreateObject("<winsock>")
WScript.ConnectObject myBot, "myBot_" 


Which worked just fine.. Now in Exhume I'm trying:

Code: Select all

Dim myBot
Set myBot = CreateObject("<winsock>", "myBot_")
And it's telling me "The remote server machine does not exist or is unavailable." When trying to use CreateObject with a prefix in regular .vbs, it produces the same results, which is why I was using ConnectObject. Please, someone help!
Posted: April 10th, 2007
gheezer
Unfortunately, unless someone knows otherwise, I don't think VGE exposes the currently running WSH process(which is what WScript is) :(

Without that it's damn near impossible to implement COM events. I say 'damn near' cause someone smarter than me could prolly do it with clever API calls or subclassing.

I was able to use a custom COM .dll to get my remote working, but decided to wait on C# so I wouldn't have to distribute a custom .dll with the radar.
Posted: April 13th, 2007
wilburr
I'm by no means a VB expert, so take this for what it's worth...

The root wsh object is not available from within vb, only the wsh shell and the wsh network objects are.

I don't know what you are trying to do with wsh, but the MS Script Control has some limited script engine support (would require modifying the base vb code of vge though). I have used it before to add some jscript to a vb project, but I'm not sure what all of its capabilities\limitations are.
Posted: April 13th, 2007
User avatar
Premium
Total Posts:6718 Joined:2004
I think admin will have to add that ConnectObject to the COM command list api.

http://www.xunleashed.com/wiki/index.ph ... eCOMObject

_________________
Use Search first, ask questions later!
Posted: April 14th, 2007
kryologik
I would be eternally greatful for that =)
Ready to join the community? Click here and see all of the benefits!
blue large dotWho is online
Users browsing this forum: No registered users and 18 guests
Post Reply