Important! Please read the announcement at http://myst.dustbird.net/uru-account.htm
Also! Please read the retirement announcement at http://myst.dustbird.net/uru-retirement.htm
Difference between revisions of "UAM/Python"
From UamWiki
Line 2: | Line 2: | ||
=Commands= | =Commands= | ||
+ | ==SetAgeChronicle and GetAgeChronicle== | ||
+ | These are variables that are stored in an Age. They are shared between all players in an Age. If one of them hasn't been set, and you try to get it, you'll get "". | ||
+ | |||
+ | Here's an example of setting the value to "red" if it is currently set to "green": | ||
+ | <source lang="python"> | ||
+ | import uam | ||
+ | puzcolor = uam.GetAgeChronicle("PuzzleColour") | ||
+ | if puzcolor=="green": | ||
+ | puzcolor = "red" | ||
+ | uam.SetAgeChronicle("PuzzleColour",puzcolor) | ||
+ | </source> | ||
+ | |||
==LinkToAge== | ==LinkToAge== | ||
+ | This links the player to an Age immediately. | ||
+ | |||
If you want to link to the Age "EderRiltehInaltahv", just use this command: | If you want to link to the Age "EderRiltehInaltahv", just use this command: | ||
<source lang="python"> | <source lang="python"> |
Revision as of 23:37, 19 October 2010
This page lists some of the many things you can do with the "uam" Python module!
Commands
SetAgeChronicle and GetAgeChronicle
These are variables that are stored in an Age. They are shared between all players in an Age. If one of them hasn't been set, and you try to get it, you'll get "".
Here's an example of setting the value to "red" if it is currently set to "green":
import uam
puzcolor = uam.GetAgeChronicle("PuzzleColour")
if puzcolor=="green":
puzcolor = "red"
uam.SetAgeChronicle("PuzzleColour",puzcolor)
LinkToAge
This links the player to an Age immediately.
If you want to link to the Age "EderRiltehInaltahv", just use this command:
import uam
uam.LinkToAge("EderRiltehInaltahv","LinkInPointDefault")
You could also have specified another spawnpoint, but LinkInPointDefault is the normal starting point in an Age.