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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Jscript
. . -> [Subject]  No idea on how to script.. and wanting to learn.. few questions
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

No idea on how to script.. and wanting to learn.. few questions

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Scorne   (3 posts)  [Biography] bio
Date Sat 08 May 2004 07:13 PM (UTC)  quote  ]

Amended on Sat 08 May 2004 07:15 PM (UTC) by Scorne

Message
OK.. Ive got no idea where to start..
Do i start with that examplescript.js?
Do I even need to use that thing?

Does "Help files for scripting version 5.6 " file thing give examples on how to start off early with scripts so people can learn the basics...

I can write a script to act as a bot right?
Is there a main script that most people use.. so if i see a part of a script they post.. i would know which one to use it with?

Thanks :)

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4156 <-- my post..

I think that post has to do with scripts.. so i wanna learn :) Unless it can be done without.. eithe way a heads up would be nice.

***I can edit scripts with EditPlus or Textpad right?.. Both editing programs***
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #1 on Sun 09 May 2004 09:55 AM (UTC)  quote  ]
Message
You could read Microsoft's Scripting documentation, it has example for the functions you could learn from, and you could look at plugins at the plugins page to see how people write them. Yes, you can write scripts for MUclient to do anything, and you can edit scripts with any text editor that writes plaintext (notepad, textpad, whatever). Do you know any programming languages, or are you entirely new to this?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (19,497 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Mon 10 May 2004 09:35 PM (UTC)  quote  ]
Message
Quote:

Do i start with that examplescript.js?
Do I even need to use that thing?


Not necessarily. That has examples of setting up triggers, processing wildcards, and has the constants in it for various operations, such as the meanings of certain error codes like this:


var eTimerAlreadyExists = 30018; // Attempt to add a timer that already exists


Also it illustrates how to convert a VB array to a JScript arrray:


wildcards = VBArray(wildcardsVB).toArray();


Quote:

Does "Help files for scripting version 5.6 " file thing give examples on how to start off early with scripts so people can learn the basics...


Not really - that explains the JScript function calls but is really a reference rather than a tutuorial.

Quote:

I can write a script to act as a bot right?


Sure, you can do practically anything, providing the data you want comes from the MUD (or you) somehow.

Quote:

Is there a main script that most people use.. so if i see a part of a script they post.. i would know which one to use it with?


Not really - you might use the constants if you use a lot of the inbuilt function calls (eg. world.AddTrigger). I would scan the scripts in this part of the forum, read the example script file, try to do something, and if you have difficulties post a more specific question.

- Nick Gammon

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

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #3 on Mon 10 May 2004 10:43 PM (UTC)  quote  ]

Amended on Mon 10 May 2004 10:45 PM (UTC) by Flannel

Message
If youre going to try and tackle a bot, theres a few things you need to figure out before you start.

How are you going to get the information (and keep it updated) are there prompts? that you can set? will you have to keep typing something to get the information?
Second, What triggers what you want? Are you going to be killing something, then moving on a preset route? or more freeform roaming? What exactly are you going to be doing?

The second bit leads itself to pseudocode, which is a step up from flowcharting. For a beginner, you might want to figure out the second stuff, the first stuff should be pretty cut and dry. Figure out the second bit, whether its drawing it on paper, or whatever, but youll probably want it to be modular, have an "explore" routine, a "battle" routine, and whatnot.

However, you cant script MC like you would other programs, since you need to allow for the client to accept other input, and things like that. There are ways around this, such as having a "mode" variable. It does complicate things, but figuring stuff out like that comes after you actually figure out how youre going to make the bot behave.

Edit:

Also, if youre completely new to scripting, you might not want to use javascript, unless you already know JS. More people in these forums know VBScript, so youll be able to get more help in VBscript. Of course, if you have some sort of reason youre using JS, then that might influence your decision.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Ian Kirker   (30 posts)  [Biography] bio
Date Reply #4 on Sun 23 May 2004 04:35 PM (UTC)  quote  ]
Message
It's also a good idea to check what your MUD does and does not allow before you start making complex bots and trigger systems. :P
[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.


3,255 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [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.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]