[Crossfire-wiki] [Crossfire DokuWiki] page changed: user:gxc:client_side_scripting:cplusplus-howto

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Thu Mar 20 08:28:38 CDT 2008


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2008/03/20 08:28
User        : 
Edit Summary: 

@@ -1,7 +1,7 @@
  ====== Client Scripting Interface - C++ How To ======
  ===== 1. Using Client Commands =====
- To use a command normally entered in the client, use [[http://www.cplusplus.com/reference/clibrary/cstdio/printf.html|printf]]("issue 1 1[output string]") followed by [[http://www.cplusplus.com/reference/clibrary/cstdio/fflush.html|fflush]](stdout). printf writes the output string in stdout, which is read by the client and interpreted. fflush(stdout) flushes or clears stdout((Normally, stdout doesn't need to be cleared this often, but when scripting for Crossfire, it's good practice to flush it after each use)), readying it for more data.
+ To use a command normally entered in the client, use [[http://www.cplusplus.com/reference/clibrary/cstdio/printf.html|printf]]("issue 1 1[output string]") followed by [[http://www.cplusplus.com/reference/clibrary/cstdio/fflush.html|fflush]](stdout). printf writes the output string in stdout, which is read by the client and interpreted. fflush(stdout) flushes or clears stdout((Normally, stdout doesn't need to be cleared this often, but when scripting for Crossfire, it's good practice to flush it after each use. It ends the current output, akin to pushing enter on commands in the client.)), readying it for more data.
  
  An explanation of "issue 1 1 " can be found [[:client_side_scripting:client_scripting_interface-basic_howto|here]], in an introduction to scripting overall. Essentially, the first integer is the number of times to repeat an action. For debugging and information purposes, it's generally a good idea to leave it as 1 and create a loop in C++. The second 1 should always be set as 1.
  
  Example:
@@ -16,9 +16,9 @@
  </code>
  This would make the character pray once.
  
  ===== 2. Writing to the Screen =====
- To write to the screen, use [[http://www.cplusplus.com/reference/clibrary/cstdio/printf.html|printf]]("[output string]") followed by [[http://www.cplusplus.com/reference/clibrary/cstdio/fflush.html|fflush]](stdout). printf writes the output string in stdout, which is read by the client and interpreted. fflush(stdout) flushes or clears stdout((Normally, stdout doesn't need to be cleared this often, but when scripting for Crossfire, it's good practice to flush it after each use)), readying it for more data.
+ To write to the screen, use [[http://www.cplusplus.com/reference/clibrary/cstdio/printf.html|printf]]("[output string]") followed by [[http://www.cplusplus.com/reference/clibrary/cstdio/fflush.html|fflush]](stdout). printf writes the output string in stdout, which is read by the client and interpreted. fflush(stdout) flushes or clears stdout((Normally, stdout doesn't need to be cleared this often, but when scripting for Crossfire, it's good practice to flush it after each use. It ends the current output, akin to pushing enter on commands in the client.)), readying it for more data.
  
  Example:
  <code c++>
  #include <cstdio>


IP-Address  : 76.210.47.58
Old Revision: http://wiki.metalforge.net/doku.php/user:gxc:client_side_scripting:cplusplus-howto?rev=1206019386
New Revision: http://wiki.metalforge.net/doku.php/user:gxc:client_side_scripting:cplusplus-howto

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list