[Crossfire-wiki] [Crossfire DokuWiki] page changed: client_side_scripting:client_scripting_interface-basic_howto
no-reply_wiki at metalforge.org
no-reply_wiki at metalforge.org
Thu Dec 20 19:16:05 CST 2007
A page in your DokuWiki was added or changed. Here are the details:
Date : 2007/12/20 19:16
User : buzzsaw
Edit Summary:
@@ -6,9 +6,18 @@
=== What is the Client Scripting Interface? ===
Basically, the Client Scripting Interface is a way to have an external program (the script) interact client-side with your in-game behaviour. The script can have a copy of messages sent from the server to your client (there is a wide variety of such messages), can have a copy of messages sent from your client to the server (there are also lots of them), may request information (on a item, a map square ...) and finally can issue commands to the server. Lets call those actions, respectively, server-client spying, client-server spying, examining and interacting.
=== How do I run my script ===
- Most of the time it is basically straight forward. The command script <pathname> would be entered to start the script. How ever that only works if you write your script in a shell script or C/++. If you write you script in Java it get a bit more tricky but no worries its not that hard. After you write your program and compile you must create a shell script to run the program from the client. As long as you have your shell script in the same directory as your .class file a simple "java <blah>" will do. Don't forget to chmod +x your shell script :-)
+ Most of the time it is basically straight forward. The command script <pathname> would be entered to start the script. How ever that only works if you write your script in a shell script or C/++. If you write you script in Java it get a bit more tricky but no worries its not that hard.
+
+ We are going to create a shell script that will run out scripts in Java for us.
+
+ #!/bin/bash
+ cd /dir/to/java.class
+ java $1
+
+ Remember to chmod +x the script so that its executable.
+ Now to run your script this is all you have to do is "script /path/to/bashScript blah" blah being your .class file - .class and /path/to/bashScript being the executable bash script.
=== Pipes, stdout, stdin ===
(If this section causes you to consider puking by the second line, jump to the next section.)
IP-Address : 207.225.37.112
Old Revision: http://wiki.metalforge.net/doku.php/client_side_scripting:client_scripting_interface-basic_howto?rev=1198113342
New Revision: http://wiki.metalforge.net/doku.php/client_side_scripting:client_scripting_interface-basic_howto
--
This mail was generated by DokuWiki at
http://wiki.metalforge.net/
More information about the crossfire-wiki
mailing list