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
hpacez
Newbie


Joined: 08 Mar 2006
Posts: 6

PostPosted: Wed Mar 08, 2006 7:54 am   

Basic script
 
Am I correct in assuming the aliases section is where a script is made?
I don't see a 'script' editor or any loader, so I'm kind of confused on how to create and use one for zMUD... At first I created a new alias called test. I used VBScript as my scripting language and tried a simple script from the help file:


#VAR X 2
#MSS {x=@X:msgbox x}

However, I recieved an error when I typed test to try the alias in the game:

Error executing #VAR X 2
#MSS {x=@X:msgbox x}
Expected statement (error 1024) on line 1, column 1

Why is the #MSS required anyhow?
I thought it would be straight scripting e.g.

Response.Write("Hello World!")

or

print("Hello World!") in JavaScript.

Any help appreciated!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Mar 08, 2006 10:38 am   
 
The #MSS and related commands are for mixing another scripting language with zScript. So the example in the help file is showing you have to mix them. By changing the type on the alias to VB you are sending all the zScript commands to VB as well. So if you set the type to VB just write VBscript and do not use any zScript commands or functions.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
hpacez
Newbie


Joined: 08 Mar 2006
Posts: 6

PostPosted: Thu Mar 09, 2006 1:41 am   
 
I see, thanks for the clarification on that... I'm still getting troubles with a simple response.write("hello world") though... Could you write the most simple verified hello world in VBScript that I could test in zMUD? Thanks again!
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Thu Mar 09, 2006 1:58 pm   
 
msgbox "Hello World!"

<edit>
for sake of simplicity just copy and paste the following into the command line and press return
Code:
#ALIAS hello {#SS "VBScript" msgbox "Hello World!"}
hello
</edit>
_________________
Taz :)
Reply with quote
hpacez
Newbie


Joined: 08 Mar 2006
Posts: 6

PostPosted: Thu Mar 09, 2006 10:06 pm   
 
Thank you Taz,
Now I have confidence that's its me screwing up (Cause it worked, of course)!
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Mar 10, 2006 2:32 pm   
 
You're welcome.

I once wrote a bigger script that worked perfectly under WSH but that I couldn't get to work in zMUD so it's difficult to know at times what is going wrong.
_________________
Taz :)
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