Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31477/wolfpack
Modified Files:
__init__.py accounts.py consts.py database.py settings.py
sockets.py
Log Message:
New documentation and a long overdue wolfpack.consts cleanup
Index: sockets.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/sockets.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sockets.py 26 May 2004 13:07:27 -0000 1.3
--- sockets.py 2 Jul 2004 13:40:47 -0000 1.4
***************
*** 13,22 ****
import _wolfpack.sockets
! def first():
! return _wolfpack.sockets.first()
!
! def next():
! return _wolfpack.sockets.next()
!
! def count():
! return _wolfpack.sockets.count()
--- 13,17 ----
import _wolfpack.sockets
! first = _wolfpack.sockets.first
! next = _wolfpack.sockets.next
! count = _wolfpack.sockets.count
Index: consts.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/consts.py,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -d -r1.70 -r1.71
*** consts.py 29 Jun 2004 11:36:12 -0000 1.70
--- consts.py 2 Jul 2004 13:40:47 -0000 1.71
***************
*** 120,124 ****
MINING_ORE = [10, 34]
! # Skill Constants
ALCHEMY = 0
ANATOMY = 1
--- 120,127 ----
MINING_ORE = [10, 34]
! """
! \constants wolfpack.consts Skill Constants
! These constants are shortcuts for the ids of every skill.
! """
ALCHEMY = 0
ANATOMY = 1
***************
*** 173,180 ****
FOCUS = 50
CHIVALRY = 51
-
ALLSKILLS = 52 # skills + 1
! skillnames = [ 'alchemy', 'anatomy', 'animallore', 'itemid', 'armslore', 'parrying',
'begging', 'blacksmithing', 'bowcraft', 'peacemaking', 'camping', 'carpentry',
'cartography', 'cooking', 'detectinghidden', 'enticement', 'evaluatingintel',
--- 176,185 ----
FOCUS = 50
CHIVALRY = 51
ALLSKILLS = 52 # skills + 1
+ """
+ \end
+ """
! SKILLNAMES = [ 'alchemy', 'anatomy', 'animallore', 'itemid', 'armslore', 'parrying',
'begging', 'blacksmithing', 'bowcraft', 'peacemaking', 'camping', 'carpentry',
'cartography', 'cooking', 'detectinghidden', 'enticement', 'evaluatingintel',
***************
*** 186,191 ****
'stealth', 'removetraps', 'necromancy', 'focus', 'chivalry' ]
! skillnamesids = \
! {
'alchemy' : ALCHEMY,
'anatomy' : ANATOMY,
--- 191,195 ----
'stealth', 'removetraps', 'necromancy', 'focus', 'chivalry' ]
! skillnamesids = {
'alchemy' : ALCHEMY,
'anatomy' : ANATOMY,
***************
*** 242,291 ****
}
! statnames = [ 'str', 'int', 'dex' ]
!
! #Stats
! MANA = 0
! STAMINA = 1
! HEALTH = 2
! DEXTERITY = 3
! INTELLIGENCE = 4
! STRENGTH = 5
!
! #Requirements
! MANACOST = 0
! REAGENTCONST = 1
! GLB_REQUIREMENT = 2
!
! #Damage by
! SPELL = 0
! COLD = 1
! DISPEL = 2
! ENERGY = 3
! FIRE = 4
! HITCHANCE = 5
! LOWERATTACK = 6
! LOWERDEFENCE = 7
! #... here we need to add every spell also
!
! #Enhancements
! GOLD = 0 #Gold increase
! SWINGSPEED = 1 #Swing speed increase
! POTIONS = 2 #Enhance potions
! SELFREPAIR = 3 #Self repair
! DEFENCECHANCE = 4 #Defence chance
! CASTSPEED = 5 #Faster casting
! CASTRECOVERY = 6 #Faster cast recovery
!
! #Advanced properties ID's
! REGEN = 1
! BONUS = 2
! DAMAGE = 3
! ENH = 4
! HIT = 5
! REQ = 6
! RESIST = 7
! REFLECT = 8
! # Constants for char.sound
SND_STARTATTACK = 0
SND_IDLE = 1
--- 246,257 ----
}
! STATNAMES = [ 'str', 'int', 'dex' ]
! """
! \constants wolfpack.consts Character Sound Constants
! These constants can be used to let a character make
! a body dependant sound. See the sound method for the
! <object id="char">char</object> object.
! """
SND_STARTATTACK = 0
SND_IDLE = 1
***************
*** 293,298 ****
SND_DEFEND = 3
SND_DIE = 4
! # Layer
LAYER_RIGHTHAND = 1
LAYER_LEFTHAND = 2
--- 259,271 ----
SND_DEFEND = 3
SND_DIE = 4
+ """
+ \end
+ """
! """
! \constants wolfpack.consts Layer Constants
! These constants provide fast access to equipment on certain
! layers of a character. See the itemonlayer method for <object id="char">char</object> objects.
! """
LAYER_RIGHTHAND = 1
LAYER_LEFTHAND = 2
***************
*** 326,329 ****
--- 299,305 ----
LAYER_DRAGGING = 30
LAYER_TRADING = 31
+ """
+ \end
+ """
# Layer Names
***************
*** 362,371 ****
}
! # Several Hook Constants
! HOOK_OBJECT = 1
! HOOK_ITEM = 2
! HOOK_CHAR = 3
!
! # Id's for Hooks (not all are hookable though)
EVENT_USE = 0
EVENT_SINGLECLICK = 1
--- 338,347 ----
}
! """
! \constants wolfpack.consts Event Constants
! These constants represent an event in a python script. These
! are used in the callevent, hasevent and registerglobal functions of the
! <module id="wolfpack">wolfpack</module> module.
! """
EVENT_USE = 0
EVENT_SINGLECLICK = 1
***************
*** 412,422 ****
EVENT_CONTEXTCHECKENABLED = 42
EVENT_COUNT = 43
! HOUSE = 0
! BOAT = 1
! CUSTOMHOUSE = 2
!
FALSE = 0
TRUE = 1
# Definitions for Magic (Casting Source)
--- 388,404 ----
EVENT_CONTEXTCHECKENABLED = 42
EVENT_COUNT = 43
+ """
+ \end
+ """
! """
! \constants wolfpack.consts Boolean Constants
! Only two constants for true and false.
! """
FALSE = 0
TRUE = 1
+ """
+ \end
+ """
# Definitions for Magic (Casting Source)
***************
*** 428,438 ****
CAST_TARGET_GROUND = 0x04 # Other
! # Different Type of Damages
DAMAGE_PHYSICAL = 0
DAMAGE_MAGICAL = 1
DAMAGE_GODLY = 2
DAMAGE_HUNGER = 3
# Some nice animation definitions
ANIM_WALKUNARMED = 0x0
ANIM_WALKARMED = 0x1
--- 410,434 ----
CAST_TARGET_GROUND = 0x04 # Other
! """
! \constants wolfpack.consts Damage Constants
! These constants specify a damage type for the
! damage method in the <object id="char">char</object>
! object.
! """
DAMAGE_PHYSICAL = 0
DAMAGE_MAGICAL = 1
DAMAGE_GODLY = 2
DAMAGE_HUNGER = 3
+ """
+ \end
+ """
# Some nice animation definitions
+ """
+ \constants wolfpack.consts Animation Constants
+ These constants are animation ids for the
+ action method in the <object id="char">char</object>
+ object.
+ """
ANIM_WALKUNARMED = 0x0
ANIM_WALKARMED = 0x1
***************
*** 444,466 ****
ANIM_ATTACKREADY1 = 0x7
ANIM_ATTACKREADY2 = 0x8
! ANIM_ATTACK1=0x9
! ANIM_ATTACK2=0xa
! ANIM_ATTACK3=0xb
! ANIM_ATTACK4=0xc
! ANIM_ATTACK5=0xd
! ANIM_ATTACK6=0xe
! ANIM_ATTACKWALK=0xf
! ANIM_CASTDIRECTED=0x10
! ANIM_CASTAREA=0x11
! ANIM_ATTACKBOW=0x12
! ANIM_ATTACKXBOX=0x13
! ANIM_TAKEHIT=0x14
! ANIM_DIE1=0x15
! ANIM_DIE2=0x16
! ANIM_TURN=0x1e
! ANIM_ATTACK7=0x1f
! ANIM_BOW=0x20
! ANIM_SALUTE=0x21
! ANIM_FIDGET3=0x22
# Definitions for the Sextant
--- 440,465 ----
ANIM_ATTACKREADY1 = 0x7
ANIM_ATTACKREADY2 = 0x8
! ANIM_ATTACK1 = 0x9
! ANIM_ATTACK2 = 0xa
! ANIM_ATTACK3 = 0xb
! ANIM_ATTACK4 = 0xc
! ANIM_ATTACK5 = 0xd
! ANIM_ATTACK6 = 0xe
! ANIM_ATTACKWALK = 0xf
! ANIM_CASTDIRECTED = 0x10
! ANIM_CASTAREA = 0x11
! ANIM_ATTACKBOW = 0x12
! ANIM_ATTACKXBOX = 0x13
! ANIM_TAKEHIT = 0x14
! ANIM_DIE1 = 0x15
! ANIM_DIE2 = 0x16
! ANIM_TURN = 0x1e
! ANIM_ATTACK7 = 0x1f
! ANIM_BOW = 0x20
! ANIM_SALUTE = 0x21
! ANIM_FIDGET3 = 0x22
! """
! \end
! """
# Definitions for the Sextant
***************
*** 470,474 ****
SEXTANT_MAP_WIDTH = 4096
! # LogLevels
LOG_MESSAGE = 0
LOG_ERROR = 1
--- 469,477 ----
SEXTANT_MAP_WIDTH = 4096
! """
! \constants wolfpack.consts Log Constants
! These constants represent a loglevel for the console
! and the logfile.
! """
LOG_MESSAGE = 0
LOG_ERROR = 1
***************
*** 478,481 ****
--- 481,487 ----
LOG_TRACE = 5
LOG_DEBUG = 6
+ """
+ \end
+ """
# Colors
***************
*** 494,516 ****
NORMAL = 3
- # Results
- OK = 1
- OOPS = 0
-
- #SKILLS GROW LOCKS
- GROWUP = 0
- GROWDOWN = 1
- GROWLOCK = 2
-
#Stat gain delay = 15 minutes ( 900 seconds )
STATGAINDELAY = 900
! # Constants for wolfpack.queueaction
! RELOAD_SCRIPTS = 0
! RELOAD_PYTHON = 1
! RELOAD_ACCOUNTS = 2
! RELOAD_CONFIGURATION = 3
! SAVE_WORLD = 4
! SAVE_ACCOUNTS = 5
#5 minutes
--- 500,520 ----
NORMAL = 3
#Stat gain delay = 15 minutes ( 900 seconds )
STATGAINDELAY = 900
! """
! \constants wolfpack.consts Action Constants
! These constants can be used to queue an action to be executed in the next mainloop iteration.
! See the queueaction function in the <module id="wolfpack">wolfpack</module> module.
! """
! RELOAD_SCRIPTS = 0 # Reload definitions and python scripts.
! RELOAD_PYTHON = 1 # Reload python scripts.
! RELOAD_ACCOUNTS = 2 # Reload accounts.
! RELOAD_CONFIGURATION = 3 # Reload all of the above.
! SAVE_WORLD = 4 # Save the world.
! SAVE_ACCOUNTS = 5 # Save the accounts.
! """
! \end
! """
#5 minutes
***************
*** 522,526 ****
#
# Notes: 0x4d4 appears to be the final sound ID
!
SOUND_JUNGLE_BIRDS_1 = 0x0
SOUND_JUNGLE_BIRDS_2 = 0x1
--- 526,533 ----
#
# Notes: 0x4d4 appears to be the final sound ID
! """
! \constants wolfpack.consts Sound Constants
! This list of constants describes some commonly used sounds.
! """
SOUND_JUNGLE_BIRDS_1 = 0x0
SOUND_JUNGLE_BIRDS_2 = 0x1
***************
*** 620,624 ****
--- 627,639 ----
SOUND_TAMBER_01 = 0x4b6 # Short tune
SOUND_TAMBER_02 = 0x4b7 # Longer Tune, Battle?
+ """
+ \end
+ """
+ """
+ \constants wolfpack.consts Human Male Sounds
+ Some handy male sound constants.
+ Use the sound method of the <object id="char">char</object> object to play them.
+ """
SOUND_MALE_01 = 0x419 # Ah!
SOUND_MALE_02 = 0x41a # Aha!
***************
*** 671,675 ****
--- 686,698 ----
SOUND_MALE_49 = 0x449 # Yeah!
SOUND_MALE_50 = 0x44a # Hoaghhh!
+ """
+ \end
+ """
+ """
+ \constants wolfpack.consts Human Female Sounds
+ Some handy female sound constants.
+ Use the sound method of the <object id="char">char</object> object to play them.
+ """
SOUND_FEMALE_01 = 0x30a # Ooooh!
SOUND_FEMALE_02 = 0x30b # Aha!
***************
*** 718,723 ****
SOUND_FEMALE_45 = 0x337 # Yeah!
SOUND_FEMALE_46 = 0x338 # Really frustrated
! # Definiton Types
WPDT_ITEM = 0
WPDT_SCRIPT = 1
--- 741,753 ----
SOUND_FEMALE_45 = 0x337 # Yeah!
SOUND_FEMALE_46 = 0x338 # Really frustrated
+ """
+ \end
+ """
! """
! \constants wolfpack.consts Definition Constants
! These constants represent the definition section types as used in
! getdefinition in the <module id="wolfpack">wolfpack</module> module.
! """
WPDT_ITEM = 0
WPDT_SCRIPT = 1
***************
*** 743,744 ****
--- 773,777 ----
WPDT_CONTEXTMENU = 21
WPDT_AI = 22
+ """
+ \end
+ """
Index: database.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/database.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** database.py 14 Jun 2004 17:59:17 -0000 1.3
--- database.py 2 Jul 2004 13:40:47 -0000 1.4
***************
*** 7,12 ****
--- 7,19 ----
import _wolfpack.database
+ """
+ \constants wolfpack.database Database Constants
+ These constants identify one of the databases.
+ """
ACCOUNTS = 1
WORLD = 2
+ """
+ \end
+ """
# Let's make sure these tables are in sync with the current database
Index: accounts.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/accounts.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** accounts.py 12 Apr 2004 10:27:57 -0000 1.6
--- accounts.py 2 Jul 2004 13:40:47 -0000 1.7
***************
*** 7,65 ****
import _wolfpack.accounts
! """
! \function wolfpack.accounts.find
! \param name
! \return Account
! \description Finds an account by its account name.
! """
! def find( name ):
! return _wolfpack.accounts.find( name )
!
! """
! \function wolfpack.accounts.list
! \return List of Accounts
! \description Returns a list of all accounts.
! """
! def list():
! return _wolfpack.accounts.list()
!
! """
! \function wolfpack.accounts.acls
! \return List of ACLs
! \description Returns a list of all account access levels.
! """
! def acls():
! return _wolfpack.accounts.acls()
!
! """
! \function wolfpack.accounts.acl
! \param name
! \return Boolean
! \description Returns true or false if the given ACL name exists.
! """
! def acl( name ):
! return _wolfpack.accounts.acl( name )
!
! """
! \function wolfpack.accounts.add
! \param username
! \param password
! \return Boolean
! \description Creates an account with the given username and password.
! """
! def add( username, password ):
! return _wolfpack.accounts.add( username, password )
!
! """
! \function wolfpack.accounts.save
! \description Saves the accounts.
! """
! def save():
! return _wolfpack.accounts.save()
!
! """
! \function wolfpack.accounts.reload
! \description Reloads the accounts.
! """
! def reload():
! return _wolfpack.accounts.reload()
--- 7,15 ----
import _wolfpack.accounts
! find = _wolfpack.accounts.find
! list = _wolfpack.accounts.list
! acls = _wolfpack.accounts.acls
! acl = _wolfpack.accounts.acl
! add = _wolfpack.accounts.add
! save = _wolfpack.accounts.save
! reload = _wolfpack.accounts.reload
Index: settings.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/settings.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** settings.py 12 Apr 2004 10:27:57 -0000 1.6
--- settings.py 2 Jul 2004 13:40:47 -0000 1.7
***************
*** 14,93 ****
import _wolfpack.settings
- import _wolfpack
-
- """
- \function wolfpack.settings.getBool
- \param section
- \param key
- \param default
- \return Boolean
- \description Returns the boolean value for the key in a given section.
- """
- def getBool( section, key, default ):
- return _wolfpack.settings.getBool()
-
- """
- \function wolfpack.settings.setBool
- \param section
- \param key
- \param default
- \description Sets a boolean value for the key in a given section.
- """
- def setBool( section, key, value ):
- return _wolfpack.settings.setBool( section, key, value )
-
- """
- \function wolfpack.settings.getNumber
- \param section
- \param key
- \param default
- \return Number
- \description Returns the number value for the key in a given section.
- """
- def getNumber( section, key, default ):
- return _wolfpack.settings.getNumber( section, key, default )
-
- """
- \function wolfpack.settings.setNumber
- \param section
- \param key
- \param default
- \description Sets a number value for the key in a given section.
- """
- def setNumber( section, key, value ):
- return _wolfpack.settings.setNumber( section, key, value )
! """
! \function wolfpack.settings.getString
! \param section
! \param key
! \param default
! \return String
! \description Returns the string value for the key in a given section.
! """
! def getString( section, key, default ):
! return _wolfpack.settings.getString( section, key, default )
!
! """
! \function wolfpack.settings.setString
! \param section
! \param key
! \param default
! \description Sets a string value for the key in a given section.
! """
! def setString( section, key, value ):
! return _wolfpack.settings.setString( section, key, value )
!
! """
! \function wolfpack.settings.reload
! \description Reload the settings.
! """
! def reload():
! return _wolfpack.settings.reload()
!
! """
! \function wolfpack.settings.save
! \description Saves the settings.
! """
! def save():
! return _wolfpack.settings.save()
--- 14,24 ----
import _wolfpack.settings
! getbool = _wolfpack.settings.getbool
! setbool = _wolfpack.settings.setbool
! getnumber = _wolfpack.settings.getnumber
! setnumber = _wolfpack.settings.setnumber
! getstring = _wolfpack.settings.getstring
! setstring = _wolfpack.settings.setstring
! reload = _wolfpack.settings.reload
! save = _wolfpack.settings.save
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/__init__.py,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** __init__.py 29 Jun 2004 11:36:12 -0000 1.55
--- __init__.py 2 Jul 2004 13:40:47 -0000 1.56
***************
*** 63,64 ****
--- 63,66 ----
tickcount = _wolfpack.tickcount
packet = _wolfpack.packet
+ getoption = _wolfpack.getoption
+ setoption = _wolfpack.setoption
|