Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Arawn_V2
Newbie


Joined: 27 Oct 2004
Posts: 2

PostPosted: Wed Oct 27, 2004 8:26 am   

JScript with zMUD v. 7.x
 
ok, I know C++ well enough to be dangerous with it. I use Visual Studio.NET 2003, donated via student bundle pack at school, for all my coding that I don't do for achaea. I also know that JScript is very similar to C++, although not the same. I know that the conditionals are about the same (i.e. if, for, while, do etc.), and that the variable declaring is different.

Now my problem is successfully using a JScript code segment in zMUD. I can get a trigger to code something simple as:

var var1 = 0;

if( var1 == 0 )
{
var1 = 1;
}

This was simply a test code. Does nothing really. Everything 'compiles' fine (as much compiling as zMUD does anyways)

I can't for the life of me figure out how to write to the console (tried print(), Console.Write() and write() functions for JScript; also tried printf() and cout functions for C++).

I would also like to know what the function is to send commands to the console (i.e. something evaluates out to be something, so you send 'outr herb;eat herb' to the console for the MUD to execute it)

All you alternative coders that use zMUD for a bases, please help me. I'm tired of using ZScript (it's screwing with my syntax for coding that I do in C++), and I want to get JScript working.

Also, I know Java and JScript are not the same Very Happy. No need for education in that area.

Someone see this and give me some good info please.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Oct 27, 2004 5:50 pm   
 
To communicate with zMUD via either JScript or VBScript you have to use the COM object interface for zMUD. This is documented in the "zMUD as a COM Server" article in the Support Library.

Rather than looking at examples from Java or C you would be better off reading about the Microsoft Scripting Host. Using JScript or VBScript in zMUD is very similar to using JScript or VBScript in the Microsoft Scripting Host where you are completely dependant upon external COM objects. Also very similar to using VBA in Office.

The zMUD.application, application.currentsession, and currentsession.map (if using zMapper) COM variables are predefined. So you can call any method or access any property of these objects from your script.

You will probably find that it's not nearly as easy to use as you'd like, which is why zscript exists in the first place.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net