From no-reply_wiki at cross-fire.org Mon Nov 9 22:47:34 2015 From: no-reply_wiki at cross-fire.org (no-reply_wiki at cross-fire.org) Date: Mon, 09 Nov 2015 22:47:34 -0600 Subject: [Crossfire-wiki] [Crossfire Wiki] page added: guides:store_guide Message-ID: A page in your DokuWiki was added or changed. Here are the details: Date : 2015/11/09 22:47 User : dogbertius Edit Summary: created While most towns and cities in the world of Crossfire sport simple specialty shops sporting items such as weapons, armor, spellbooks, food, etc, there are certain rare shops with massive stores of hard-to-find items. Such shops typically require an entrance fee to be paid, even if you just want to browse. ---- ===== Scorn Sale Shop ===== ==== Location - Northwest Scorn ==== === Specialty: Everything === One of the few "permanent floor" shops to be found (another smaller one exists in Santo Dominion). Items sold on the "sales floor" in the lower level eventually disappear with map resets (reset times can be view with the ''maps'' command in your client), while items sold in the upper levels remain there indefinitely. Be prepared to pay 100 platinum coins to enter the upstairs area. Also, the buying and selling prices at this store are more favourable towards players than at other shops. Players planning on selling off excess artifacts and spellbooks are encouraged to sell items here, as it: * Gives other players with some spare cash a chance to purchase hard-to-find items with greater ease. * Serves as a communal "showcase" of all the cool, rare items other players have not only found, but are skilled enough to be able to sell it off for spare change. * Gives a better buy/sell price than other shops. * Lets other players see what they're missing, and entices them to begin hunting down that gear themselves. ---- ===== Lord of the Rings ===== ==== Location - Santo Dominion ==== === Specialty: Rings === Rings, rings everywhere! 250 platinum coins gains you entrace, so be prepared to drop several thousand more. In addition to a massive collection of random stat/resistance rings, various "silver" rings (ie: Halvor, Acid, Fire, Yordan, etc) can be found here. Occasionally, you may even spot a precious (and expensive) ring, such as a ring of War, the Saint, the Demon Priest, etc. Higher level rare rings, such as the ring of Elrond or the One Ring (ie: Ring of Ruling) cannot be found in this shop. Other event rings such as the Necromancer's Ring (gives any class death attack-type for melee, claws, unarmed attacks and bows, very useful), the Ring of Elements, etc, can not be found here either. ---- ===== Mosley's Magic Book Store ===== ==== Location - Northwest Scorn ==== === Specialty: Spell books === A small, light-blue building, just west of the Scorn Permanent Apartments building (you should be buying one ASAP, it's only 200 platinum coins), they stock a lot of spellbooks for all spell types (summoning, sorcery, evocation, pyromancy, and praying), but at greatly reduced prices, meaning even a brand new player can buy a book of burning hands or ice storm for just a few PP. ---- ===== Guild of Sages ===== ==== Location - Darcap ==== === Specialty: Spell books === Hidden away in the mountains, in world map x:116 y:104 (you can use the ''mapinfo'' command to determine your current coordinates), a hefty deposit of 200 PP will gain you access to a massive collection of books. Very useful when trying to track down some of the most important spells in the game, including: * Word of Recall (teleport to the last bed you slept in, extremely useful). * Dimension Door (lets you teleport through certain walls, over large gaps or bodies of water, or through enemies when they block your exit or you must traverse booby-trapped areas). * Restoration (heals you to 100%, cures poison, cures all diseases, fills your belly with food, cures blindness). * Town Portal (when going through a 100 level dungeon like the Church of Valriel of the Pits of Gorokh, it's nice to be able to create a portal marker, use Word of Recall to teleport back home, identify and sell off your spoils for cash, then create the other end of the portal to return to the fray). ---- ===== Moldy Oldie's Jewelry Shop ===== ==== Location - Lake Country ==== === Specialty: Crowns === For the right price, usually some rare quest items, you can find a crown to fit your needs. They don't offer much in terms of armor (ie: raw damage protection), but offer massive elemental defense benefits, stat boosts, etc. IP-Address : 24.207.75.125 Hostname : 24-207-75-125.eastlink.ca Old Revision: --- New Revision: http://wiki.metalforge.net/dokuwiki/doku.php/guides:store_guide -- This mail was generated by DokuWiki at http://wiki.metalforge.net/dokuwiki/ From no-reply_wiki at cross-fire.org Mon Nov 9 22:52:00 2015 From: no-reply_wiki at cross-fire.org (no-reply_wiki at cross-fire.org) Date: Mon, 09 Nov 2015 22:52:00 -0600 Subject: [Crossfire-wiki] [Crossfire Wiki] page changed: store_guide In-Reply-To: Message-ID: A page in your DokuWiki was added or changed. Here are the details: Date : 2015/11/09 22:52 User : dogbertius Edit Summary: @@ -1,11 +1 @@ - ====== Store Guide ====== - This section will list where to find the best stores for buying and selling items in the CrossFire world. Pricing information assumes the buyer/seller has +30 charisma (Ch). Percentages of value shown are based on player characters "guess" as to the value of the items with bargaining skill. Obviously higher bargaining skill will affect these values.\\ - \\ - Try to follow the outline below when adding stores. Also, stores from the same location should be grouped together. - - ^Store Location ^ Alchemy Items ^ Armour ^ Rings ^ Rods/Staves/Wands ^ Scrolls ^ Weapons ^ - |Brest| --- | --- | --- | --- | --- | Store name: Brest Weapons\\ Selling to store: very good prices\\ Accepted: above average weapons\\ Buying from store: expensive | - |Nurnberg| --- | Store name: White Dragon Scale\\ Selling to store: fair prices\\ (about 50% value)\\ Accepted: ANY armour\\ Buying from store: expensive | --- | --- | --- | Store name: Muramasa!\\ Selling to store: EXCELLENT prices\\ (near 100% value)\\ Accepted: ANY weapons\\ Buying from store: expensive | - |Santo Dominion| --- | --- | Store name: Lord of the Rings\\ Selling to store: very good prices\\ Accepted: rings\\ Buying from store: expensive | --- | --- | --- | - - Please feel free expand on this chart. + [[guides:store_guide|The updated page can be found here.]] IP-Address : 24.207.75.125 Hostname : 24-207-75-125.eastlink.ca Old Revision: http://wiki.metalforge.net/dokuwiki/doku.php/store_guide?rev=1158256920 New Revision: http://wiki.metalforge.net/dokuwiki/doku.php/store_guide -- This mail was generated by DokuWiki at http://wiki.metalforge.net/dokuwiki/ From no-reply_wiki at cross-fire.org Sun Nov 15 13:23:25 2015 From: no-reply_wiki at cross-fire.org (no-reply_wiki at cross-fire.org) Date: Sun, 15 Nov 2015 13:23:25 -0600 Subject: [Crossfire-wiki] [Crossfire Wiki] page changed: diseases In-Reply-To: Message-ID: A page in your DokuWiki was added or changed. Here are the details: Date : 2015/11/15 13:23 User : dogbertius Edit Summary: @@ -4,9 +4,9 @@ Some diseases have a lifespan, and, if the monster or character that caught it survives naturally, they are immune to that disease forever, provided subsequent instances of the disease are equal or of a lower level than the source of the immunity. For example, you get a case of the flu cast by yourself at level 15. When you get over it, you're immune to any flu of level less than 16. When you become level 16 and cast the flu again, you are NOT immune. Spells such as "cure disease" or "restoration" will remove a disease, but will not grant immunity. A diseases damage caused each round varies between 0 and the maximum listed resulting in the possibility of creating a MILD case of ebola, which would NOT kill a monster, or a severe one capable of killing it. Some diseases get weaker over time. - [[:characters:Undead]] are NEVER affected by any disease. + [[:characters:Undead]] are NEVER affected by any disease, with **one major exception**: The //Cause White Death// disease (ie: Pneumonic Plague or Tuberculosis/TB), which is noted as "not currently available in the game" is actually available, but only to specific high level monsters, and never to players. No players, regardless of race, even if they are a follower of [[gods:devourers|Devourers ]] or are a [[races:wraiths|wraith]], are immune to its effects, and cannot ever develop an immunity from surviving it without using //cure disease// or //restoration//. The "Cause White Death" prayer is often used as a "template" spell when designing maps. For example, as a level/map designer, you may want a disease-like spell for your level 110 boss monster to use on any possible player: a matter-dissolving bacteria, for example, that periodically displays a message like "Mystic germs from another dimension start teleporting away pieces of your flesh". For some neat examples of such a disease (**spoiler**), consider looking in to map-specific monsters, such as the //Blood Golem// or //Advocate of Gorokh//. Any [[:classes:priests|priest]] [[:characters|player]] who is not [[:characters:attunement|PATH_DENIED_WOUNDING]] may learn and [[:spells|cast]]: cold, flu, typhoid, anthrax, leprosy ===== Properties of Diseases ===== IP-Address : 24.207.75.125 Hostname : 24-207-75-125.eastlink.ca Old Revision: http://wiki.metalforge.net/dokuwiki/doku.php/diseases?rev=1415265152 New Revision: http://wiki.metalforge.net/dokuwiki/doku.php/diseases -- This mail was generated by DokuWiki at http://wiki.metalforge.net/dokuwiki/ From no-reply_wiki at cross-fire.org Sun Nov 15 13:24:45 2015 From: no-reply_wiki at cross-fire.org (no-reply_wiki at cross-fire.org) Date: Sun, 15 Nov 2015 13:24:45 -0600 Subject: [Crossfire-wiki] [Crossfire Wiki] page changed: diseases In-Reply-To: Message-ID: A page in your DokuWiki was added or changed. Here are the details: Date : 2015/11/15 13:24 User : dogbertius Edit Summary: [Diseases] @@ -4,9 +4,11 @@ Some diseases have a lifespan, and, if the monster or character that caught it survives naturally, they are immune to that disease forever, provided subsequent instances of the disease are equal or of a lower level than the source of the immunity. For example, you get a case of the flu cast by yourself at level 15. When you get over it, you're immune to any flu of level less than 16. When you become level 16 and cast the flu again, you are NOT immune. Spells such as "cure disease" or "restoration" will remove a disease, but will not grant immunity. A diseases damage caused each round varies between 0 and the maximum listed resulting in the possibility of creating a MILD case of ebola, which would NOT kill a monster, or a severe one capable of killing it. Some diseases get weaker over time. - [[:characters:Undead]] are NEVER affected by any disease, with **one major exception**: The //Cause White Death// disease (ie: Pneumonic Plague or Tuberculosis/TB), which is noted as "not currently available in the game" is actually available, but only to specific high level monsters, and never to players. No players, regardless of race, even if they are a follower of [[gods:devourers|Devourers ]] or are a [[races:wraiths|wraith]], are immune to its effects, and cannot ever develop an immunity from surviving it without using //cure disease// or //restoration//. The "Cause White Death" prayer is often used as a "template" spell when designing maps. For example, as a level/map designer, you may want a disease-like spell for your level 110 boss monster to use on any possible player: a matter-dissolving bacteria, for example, that periodically displays a message like "Mystic germs from another dimension start teleporting away pieces of your flesh". For some neat examples of such a disease (**spoiler**), consider looking in to map-specific monsters, such as the //Blood Golem// or //Advocate of Gorokh//. + [[:characters:Undead]] are NEVER affected by any disease, with **one major exception**: The //Cause White Death// disease (ie: Pneumonic Plague or Tuberculosis/TB), which is noted as "not currently available in the game" is actually available, but only to specific high level monsters, and never to players. No players, regardless of race, even if they are a follower of [[gods:devourers|Devourers ]] or are a [[races:wraiths|wraith]], are immune to its effects, and cannot ever develop an immunity from surviving it without using //cure disease// or //restoration//. + + The "Cause White Death" prayer is often used as a "template" spell when designing maps. For example, as a level/map designer, you may want a disease-like spell for your level 110 boss monster to use on any possible player: a matter-dissolving bacteria, for example, that periodically displays a message like "Mystic germs from another dimension start teleporting away pieces of your flesh". For some neat examples of such a disease (**spoiler**), consider looking in to map-specific monsters, such as the //Blood Golem// or //Advocate of Gorokh//. So, best to always keep a keybinding to //invoke restoration// or //apply rod of restoration; use_skill use magic item; apply rod of restoration;// handy. Any [[:classes:priests|priest]] [[:characters|player]] who is not [[:characters:attunement|PATH_DENIED_WOUNDING]] may learn and [[:spells|cast]]: cold, flu, typhoid, anthrax, leprosy ===== Properties of Diseases ===== IP-Address : 24.207.75.125 Hostname : 24-207-75-125.eastlink.ca Old Revision: http://wiki.metalforge.net/dokuwiki/doku.php/diseases?rev=1447615405 New Revision: http://wiki.metalforge.net/dokuwiki/doku.php/diseases -- This mail was generated by DokuWiki at http://wiki.metalforge.net/dokuwiki/ From no-reply_wiki at cross-fire.org Sun Nov 15 13:26:28 2015 From: no-reply_wiki at cross-fire.org (no-reply_wiki at cross-fire.org) Date: Sun, 15 Nov 2015 13:26:28 -0600 Subject: [Crossfire-wiki] [Crossfire Wiki] page changed: races:wraiths In-Reply-To: Message-ID: A page in your DokuWiki was added or changed. Here are the details: Date : 2015/11/15 13:26 User : dogbertius Edit Summary: @@ -1,9 +1,10 @@ ====== Wraiths ====== {{:images:wraithp.base.151.png }} A Wraith is the spirit of a person who has made an evil bargain in order to persist after natural death, or has been forced involuntarily into its current undead state. This transformation frees them of the limits of a natural lifespan, and grants them immunity to [[:diseases]], [[attack_types:poison]], and loss of lifeforce. Wraiths also need feel little fear of [[attack_types:cold]], and they can [[characters:can_see_in_dark|see well in the dark]]. A Wraith's corporeal form has terrible vulnerabilities: [[attack_types:fire]] and most [[attack_types:god_power|god power]] are dangerous to Wraiths. Their tenuous form makes them quick and somewhat hard to hit, but also weaker and less hardy. - Wraiths have a strong affinity to magic, especially cold spells, and are very strong spellcasters. However, they cannot use fire spells for fear of self-destruction. + Wraiths have a strong affinity to magic, especially cold spells, and are very strong spellcasters. However, they cannot use fire spells for fear of self-destruction. Players wishing to use fire spells later in the game may prefer to select another race such as elf or human, and become a follower of [[gods:devourers|Devourers]], if they can live without the race-specific perks. + ===== Player Race ===== The wraith is selectable by players as their [[.|race]]. It has the following modifications: IP-Address : 24.207.75.125 Hostname : 24-207-75-125.eastlink.ca Old Revision: http://wiki.metalforge.net/dokuwiki/doku.php/races:wraiths?rev=1382968207 New Revision: http://wiki.metalforge.net/dokuwiki/doku.php/races:wraiths -- This mail was generated by DokuWiki at http://wiki.metalforge.net/dokuwiki/ From no-reply_wiki at cross-fire.org Tue Nov 17 20:52:26 2015 From: no-reply_wiki at cross-fire.org (no-reply_wiki at cross-fire.org) Date: Tue, 17 Nov 2015 20:52:26 -0600 Subject: [Crossfire-wiki] [Crossfire Wiki] page changed: guides:store_guide In-Reply-To: Message-ID: A page in your DokuWiki was added or changed. Here are the details: Date : 2015/11/17 20:52 User : dogbertius Edit Summary: Found a ring of ruling here for the first time in 10 years. Correcting content. @@ -22,9 +22,9 @@ ==== Location - Santo Dominion ==== === Specialty: Rings === - Rings, rings everywhere! 250 platinum coins gains you entrace, so be prepared to drop several thousand more. In addition to a massive collection of random stat/resistance rings, various "silver" rings (ie: Halvor, Acid, Fire, Yordan, etc) can be found here. Occasionally, you may even spot a precious (and expensive) ring, such as a ring of War, the Saint, the Demon Priest, etc. Higher level rare rings, such as the ring of Elrond or the One Ring (ie: Ring of Ruling) cannot be found in this shop. Other event rings such as the Necromancer's Ring (gives any class death attack-type for melee, claws, unarmed attacks and bows, very useful), the Ring of Elements, etc, can not be found here either. + Rings, rings everywhere! 250 platinum coins gains you entrace, so be prepared to drop several thousand more. In addition to a massive collection of random stat/resistance rings, various "silver" rings (ie: Halvor, Acid, Fire, Yordan, etc) can be found here. Occasionally, you may even spot a precious (and expensive) ring, such as a ring of War, the Saint, the Demon Priest, Ring of Ruling (Yes Mr. Frodo). Other event rings such as the Necromancer's Ring (gives any class death attack-type for melee, claws, unarmed attacks and bows, very useful), the Ring of Elements, etc, can not be found here either. ---- ===== Mosley's Magic Book Store ===== IP-Address : 24.207.75.125 Hostname : 24-207-75-125.eastlink.ca Old Revision: http://wiki.metalforge.net/dokuwiki/doku.php/guides:store_guide?rev=1447130854 New Revision: http://wiki.metalforge.net/dokuwiki/doku.php/guides:store_guide -- This mail was generated by DokuWiki at http://wiki.metalforge.net/dokuwiki/ From no-reply_wiki at cross-fire.org Tue Nov 17 20:52:41 2015 From: no-reply_wiki at cross-fire.org (no-reply_wiki at cross-fire.org) Date: Tue, 17 Nov 2015 20:52:41 -0600 Subject: [Crossfire-wiki] [Crossfire Wiki] page changed: guides:store_guide In-Reply-To: Message-ID: A page in your DokuWiki was added or changed. Here are the details: Date : 2015/11/17 20:52 User : dogbertius Edit Summary: @@ -22,9 +22,9 @@ ==== Location - Santo Dominion ==== === Specialty: Rings === - Rings, rings everywhere! 250 platinum coins gains you entrace, so be prepared to drop several thousand more. In addition to a massive collection of random stat/resistance rings, various "silver" rings (ie: Halvor, Acid, Fire, Yordan, etc) can be found here. Occasionally, you may even spot a precious (and expensive) ring, such as a ring of War, the Saint, the Demon Priest, Ring of Ruling (Yes Mr. Frodo). Other event rings such as the Necromancer's Ring (gives any class death attack-type for melee, claws, unarmed attacks and bows, very useful), the Ring of Elements, etc, can not be found here either. + Rings, rings everywhere! 100 platinum coins gains you entrance, so be prepared to drop several thousand more. In addition to a massive collection of random stat/resistance rings, various "silver" rings (ie: Halvor, Acid, Fire, Yordan, etc) can be found here. Occasionally, you may even spot a precious (and expensive) ring, such as a ring of War, the Saint, the Demon Priest, Ring of Ruling (Yes Mr. Frodo). Other event rings such as the Necromancer's Ring (gives any class death attack-type for melee, claws, unarmed attacks and bows, very useful), the Ring of Elements, etc, can not be found here either. ---- ===== Mosley's Magic Book Store ===== IP-Address : 24.207.75.125 Hostname : 24-207-75-125.eastlink.ca Old Revision: http://wiki.metalforge.net/dokuwiki/doku.php/guides:store_guide?rev=1447815146 New Revision: http://wiki.metalforge.net/dokuwiki/doku.php/guides:store_guide -- This mail was generated by DokuWiki at http://wiki.metalforge.net/dokuwiki/ From no-reply_wiki at cross-fire.org Mon Nov 30 00:57:54 2015 From: no-reply_wiki at cross-fire.org (no-reply_wiki at cross-fire.org) Date: Mon, 30 Nov 2015 00:57:54 -0600 Subject: [Crossfire-wiki] [Crossfire Wiki] page changed: client_side_scripting:client_scripting_interface-basic_howto In-Reply-To: Message-ID: A page in your DokuWiki was added or changed. Here are the details: Date : 2015/11/30 00:57 User : partmedia Edit Summary: Update overview @@ -1,11 +1,9 @@ - ====== Client Scripting Interface - Basic howto ====== + ====== Client Scripting Interface ====== - ===== Purpose of this manual ===== - This Howto covers the scripting interface present in gtk and x11 client under linux and Windows (see notes at end). + The **client scripting interface** can be used to control a Crossfire client using an external program //(script)//. This interface can be used to extend the client or automate repetitive tasks (see [[client_side_scripting:scripts|sample scripts]]). - ===== 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. + The script is started from the client and communicates by reading information from standard input and writing commands to standard output. A full list of commands can be found below. ===== How do I run my script ===== ==== C/++, Perl, Python, Bash, and others ==== IP-Address : 169.229.74.131 Hostname : fre-74-131.ResHall.Berkeley.EDU Old Revision: http://wiki.metalforge.net/dokuwiki/doku.php/client_side_scripting:client_scripting_interface-basic_howto?rev=1377304874 New Revision: http://wiki.metalforge.net/dokuwiki/doku.php/client_side_scripting:client_scripting_interface-basic_howto -- This mail was generated by DokuWiki at http://wiki.metalforge.net/dokuwiki/ From no-reply_wiki at cross-fire.org Mon Nov 30 01:51:53 2015 From: no-reply_wiki at cross-fire.org (no-reply_wiki at cross-fire.org) Date: Mon, 30 Nov 2015 01:51:53 -0600 Subject: [Crossfire-wiki] [Crossfire Wiki] page changed: client_side_scripting:client_scripting_interface-basic_howto In-Reply-To: Message-ID: A page in your DokuWiki was added or changed. Here are the details: Date : 2015/11/30 01:51 User : partmedia Edit Summary: Reduce unnecessary verbosity @@ -1,43 +1,16 @@ ====== Client Scripting Interface ====== - The **client scripting interface** can be used to control a Crossfire client using an external program //(script)//. This interface can be used to extend the client or automate repetitive tasks (see [[client_side_scripting:scripts|sample scripts]]). + The **client scripting interface** can be used to control a Crossfire client using an external program (//script//). This interface can be used to extend the client or automate repetitive tasks (see [[client_side_scripting:scripts|sample scripts]]). The script is started from the client and communicates by reading information from standard input and writing commands to standard output. A full list of commands can be found below. - ===== How do I run my script ===== - ==== C/++, Perl, Python, Bash, and others ==== + ===== Getting Started ===== - Remember to ** chmod +x ** the script so that its executable. - In the client type ** script ** + To run a script in the client, use the //script// command, which takes a path to the script to run. The script must be executable (//chmod +x// with an appropriate shebang). For some languages, it may be necessary to write a wrapper script to execute the actual program. - The script should start. - - - see also: [[#Windows-specific notes]] - - ==== Java ==== - If you write you script in Java it gets a bit more tricky but no worries its not that hard. - We are going to create a shell script that will run our scripts in Java for us. - - #!/bin/bash - cd /dir/to/java.class - java $* - - Remember to chmod +x this 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.) - - The script is a program which is external to the client. It can be written in a wide range of languages. This can be C, Java, Perl, Python, Bash script, php, anything you can think about. How can this be possible? Let's take a look at what happens when you type "echo hello world" on a shell prompt. Sure it writes on your terminal "hello world". And if you are in a graphical shell prompt? It appears in the graphical console! Some process changed your request of writing to screen to a complex process of //get some system font// and //render the line in the specified window at the specified position//. All this because when you ask to "write hello world to screen" you ask, really, to "write hello world to the standard output device". This standard output device is called stdout. There is also the stdin, which most of the time is your keyboard and stderr, the standard error device being most of the time the same as stdout.\\ - \\ - Ok, and now? Now what we use is exactly the same trick as the graphical console. when the client runs a script, it changes the script's stdin and replace the keyboard input with it's own orders (using a pipe). And it changes the stdout so instead of writing to screen, the script sends data to the client (using another pipe). And this is how any language can be used. Because every language can write to the screen and read from the keyboard! - - ===== First Script ===== - - Learn to say hello + ==== Hello World ==== Here we go for the first script. We will do quite simple things. We will ask our character to say "hello world" around. The script will be written in C because we simply need to choose a language. The script is quite simple: #include IP-Address : 169.229.74.131 Hostname : fre-74-131.ResHall.Berkeley.EDU Old Revision: http://wiki.metalforge.net/dokuwiki/doku.php/client_side_scripting:client_scripting_interface-basic_howto?rev=1448866673 New Revision: http://wiki.metalforge.net/dokuwiki/doku.php/client_side_scripting:client_scripting_interface-basic_howto -- This mail was generated by DokuWiki at http://wiki.metalforge.net/dokuwiki/ From no-reply_wiki at cross-fire.org Mon Nov 30 12:57:12 2015 From: no-reply_wiki at cross-fire.org (no-reply_wiki at cross-fire.org) Date: Mon, 30 Nov 2015 12:57:12 -0600 Subject: [Crossfire-wiki] [Crossfire Wiki] page changed: client_side_scripting:client_scripting_interface-basic_howto In-Reply-To: Message-ID: A page in your DokuWiki was added or changed. Here are the details: Date : 2015/11/30 12:57 User : partmedia Edit Summary: Update first example @@ -6,50 +6,23 @@ ===== Getting Started ===== - To run a script in the client, use the //script// command, which takes a path to the script to run. The script must be executable (//chmod +x// with an appropriate shebang). For some languages, it may be necessary to write a wrapper script to execute the actual program. + The ''script'' command starts a script at the given path. The script must be executable (''chmod +x'' with an appropriate shebang). For some languages, it may be necessary to write a wrapper script to execute the actual program. + + The ''scripts'' command lists running scripts with a numeric identifier. Scripts can be stopped using the ''scriptkill'' command. The ''scripttell'' command can be used to send arbitrary commands to a script. ==== Hello World ==== - Here we go for the first script. We will do quite simple things. We will ask our character to say "hello world" around. The script will be written in C because we simply need to choose a language. The script is quite simple: + Save the following script in a file, mark it executable, and run it in the client using the ''script'' command: - #include - - int main() { - puts("issue 1 1 say Hello world!\n"); - } - - - Name it first.c, compile it and launch it in your command shell: - - tchize at Urd:~$ /home/tchize/script/first - issue 1 1 say hello world - - No surprise in the output (notice the \n at the end in source file). Now we are going to run it in the client. Start the client and log in your prefered server. When it's done, type in the following command: - - scripts - - Client will say you have no running scripts. That's good. Now type: - - script - - where path_to_my_first_script is the location of your first script. For example I typed: - - script /home/tchize/script/first - - and you character says hello to the world. Nice, isn't it? Now try this yourself with the following script: - - int main(){ - printf("issue 1 1 shout hello world!\n"); - printf("issue 1 1 shout I use scripts!\n"); - } + #!/usr/bin/env python + print("issue 1 1 say Hello, world!") - Do you get the idea? every printf you make is a command to the client scripting interface. So now let's look at this command. It begins with issue followed by 2 integers. The command __issue__ is part of the interacting of the Client Scripting Interface. It allows a script to send any command the player could send. There are lots of them i won't explain here. Just issue the command 'help commands' to get the list. What are those 2 integers? The first one is repeat. It typically is used for dropping items, but can be used in other cases. The second integer, 1 or 0, is must send. If it is //one//, the command must be sent, if it is //zero//, command may be lost in the client-server process. Most user will set this to 1. + The ''issue'' interface command runs a given command as if a user typed it into the command window. It takes 3 arguments: //repeat//, the number of times to repeat the command (typically used for dropping items); //must_send//, an integer either zero or one; and //command//, the command to execute. - ===== Second Script ===== - Spy Kids + ==== Monitoring ==== What to do next? As you can see, our script doesn't wait very long after issuing commands. And it doesn't get information from the client at all. In fact it just //hopes// it is really speaking to the client. We are going to write a simple script which will __issue__ a command to the client and then gets the result. We are going to spy!\\ \\ Use the following script and run it in client. Ensure you ran the client in a console or you won't see any result! @@ -145,9 +118,11 @@ watch stats food 395 Wow! This mean we know when food is low and we can ask our script to invoke restoration (remember the __issue__ command?) when our character's food gets below 50! No starvation anymore. - ===== What's next? ===== + + ===== Reference ===== + There are two things you can still do with Script. The first is to request a bit of informations. The client then tells the script what it wants to know. The second thing is triggering an action of the script from client interface. The command scripttell allows player to say something to a script. The script will get the exact command typed by player. See below for command list. ==== Commands to client ==== @@ -246,12 +221,14 @@ issue 0 0 lookat 2 3 FIXME add a complete set of commands that work with and another of those that work without it. - ===== Windows-specific notes ===== + + ===== Platform-Specific Notes ===== + Scripting works thanks to a patch from archaios. Known issues are: * If you want to run a Perl script for instance, you need to issue 'perl , even if .pl is correctly seen as perl script. * If script doesn't output anything, try turning off buffering (in perl $| = 1) or flush your pipe, or add a sleep at end of program. It seems Windows closes pipes at script termination before client gets time to grab output. IP-Address : 136.152.142.33 Hostname : airbears2-136-152-142-33.airbears2.berkeley.edu Old Revision: http://wiki.metalforge.net/dokuwiki/doku.php/client_side_scripting:client_scripting_interface-basic_howto?rev=1448869913 New Revision: http://wiki.metalforge.net/dokuwiki/doku.php/client_side_scripting:client_scripting_interface-basic_howto -- This mail was generated by DokuWiki at http://wiki.metalforge.net/dokuwiki/