Gccg-script Function Reference

List of All Functions

- A - InitializeInputSystem
ProductLookup
abs
InitializeLocationTables
push
AcceptableResult
InitializeLocationTables
Put.Active
AcceptResult
InitializeLocationTables
Put.DeckBottom
Action
InitializeLocationTables
Put.DeckTop
Action
InitializePanelSystem
Put.Hand
ActiveSetMenu
InitializeScoreSystem
Put.OutOfPlay
AddCard
InitializeWatcher
Put.Table
AddCard
InitialScore
PutActive
AddCards
InitialScore
PutCardInGroup
AddCards
InitialScore
PutDeck
AddGameResult
InitialScore
PutDeckBottom
AddHistory
InitServer
PutDeckHook
AddInputHook
InitServerHook
PutHand
AddMarker
InitServerHook
PutTable
AddMarker
InitServerHook
PutTableHook
AddMinuteTimer
InitTables
PutTableHook
AddRoomPlayer
inline_images
PutTableHook
AddRoomTable
inplay
put_cardbox
AddSideboardFwCards
Input
put_cardbox_recenter
AddTickets
InputHook
put_deck_bottom
AddTimer
InputHook
put_deck_top
AddToDeck
InputKeyBackspace
put_hand
add_marker
InputKeyDelete
put_inplay
add_text
InputKeyEnd
- Q -
add_to_collection
InputKeyHome
Quit
AdjustScore
InputKeyLeft
quit
age
InputKeyRight
- R -
age
InputNewline
Raise
Alert
InputSplit
raise
AlertOff
InputSplit
Raise
AllDecksLoaded
intersect
random
apply
InverseSelectByAttr
RandomCardSet
ApplyImportDeck
invert
randomize
ApplyImportDeckBack
IsAway
RandomNearPoint
array
isdict
rarities
ASCIIFormatParser
isfunction
read_file
ASCIIFormatSuffix
IsLoop
RecalculateScores
AssignPlayer
IsObject
Receive
Attach
isreal
ReceiveClose
attach
IsRestricted
ReceiveData
attach
IsServer
ReceiveData
Attach
IsStayTapped
ReceiveOpen
Attachments
IsTableBanned
RecognizeCard
Attr
IsUserDisplay
RecognizeDeckFormat
attributes
isvar
redraw
attrs
IsVeryNear
RefineFilter
AvailableForSale
IsVolatile
refresh
AvailableForTrade
is_object
Refresh
AvatarFloorPos
is_user
RefreshBook
AvatarPos
- J - RefreshBookForDeck
AvatarRecalcTable
join
RefreshChatRoom
- B - JoinTable
RefreshCurrentDeck
beep
JoinTable
RegisterDeck
Bid
joker_match
RegisterGameResult
BidHook
JudgeChatCommandTime
RegisterPlayer
BookChangeForsale
- K - RegisterPlayer
BookFullRefresh
KeyAltKey1
RegisterServer
BookGoBack
KeyAltKey2
RegisterSubmenu
BookSetPrice
KeyAltKey3
RemoveAvatar
book_cards
KeyAltKey4
RemoveObsoletePrices
book_entry
KeyAltKey5
remove_obsolete_prices
book_last_page
KeyAltKey6
repeat
book_page
KeyBackspace
replace
book_pageof
KeyControlKey0
ReplaceTable
book_set_deck
KeyControlKey1
ReplaceTableHook
book_set_entry
KeyControlKey2
replace_cardbox_recenter
book_set_index
KeyControlKey3
Reply
book_set_page
KeyControlKey4
Reply
book_set_slot
KeyControlKey5
ReRegisterPlayer
book_set_slot
KeyControlKeyB
RestoreDeck
book_titles
KeyControlKeyC
RestoreMenuContext
Buy
KeyControlKeyH
ResultAccepted
Buy
KeyControlKeyM
return
BuyCard
KeyControlKeyP
Reveal
- C - KeyControlKeyPageDown
reverse
cache_parameters
KeyControlKeyPageUp
right
call
KeyControlKeyR
Roll
canonical_name
KeyControlKeyReturn
Roll
card
KeyDelete
RootObject
cardbox
KeyDown
root_object
CardMenu
KeyEnd
rot
cards
KeyEnter
Rotate
CardSelectBoxMenu
KeyEscape
Rotate
CardsOfSetWithRarity
KeyEscapeHook
round
card_attr
KeyF10
RuleAgentMindTotal
card_back
KeyF11
RuleBothHeroAndMinionUnique
card_data
KeyF12
RuleCanonicalCardLimitSingle
Category
KeyF1
RuleCardLimitAny
CategoryMatch
KeyHome
RuleCardLimitGeneral
center_of
KeyLeft
RuleCardLimitSingle
change_card
KeyModifierDown
RuleCardSet
ChatCommandAway
KeyModifierUp
RuleCardSetReprint
ChatCommandBuy
KeyPageDown
RuleCheckExpression
ChatCommandCopydeck
KeyPageUp
RuleCheckWizards
ChatCommandDefault
KeyReturn
RuleCountBiggestPopulation
ChatCommandGive
KeyRight
RuleCountColors
ChatCommandGo
keys
RuleCountCreatures
ChatCommandJoin
KeyShiftAltKeyB
RuleDeckMaximum
ChatCommandNewdeck
KeyShiftAltKeyD
RuleDeckMinimum
ChatCommandRd
KeyShiftAltKeyF
RuleDeckSizes
ChatCommandRenamedeck
KeyShiftAltKeyH
RuleHazardResourceBalance
ChatCommandSave
KeyShiftAltKeyR
RuleLimitByExpression
ChatCommandSealed
KeyShiftAltKeyS
RuleLimitEachByExpression
ChatCommandSu
KeyShiftControlKey0
RuleNonUniqueStageCards
ChatKeyControlKeyD
KeyShiftControlKeyB
RuleOptions
ChatKeyControlKeyE
KeyShiftControlKeyB
RulePass
ChatKeyControlKeyI
KeyShiftControlKeyC
rules
ChatKeyControlKeyS
KeyShiftControlKeyC
RuleSpecific
ChatKeyControlKeyW
KeyShiftControlKeyC
RuleStagepoints
ChatKeyControlKeyX
KeyShiftControlKeyD
RuleViolation
ChatMapMenu
KeyShiftControlKeyF
- S -
CheckFilterVersion
KeyShiftControlKeyF
save
CheckForCard
KeyShiftControlKeyG
SaveAll
CheckFunctionsOrQuit
KeyShiftControlKeyG
SaveAll
CheckInitialVariables
KeyShiftControlKeyL
SaveBookState
CheckInitialVariablesOrQuit
KeyShiftControlKeyP
SaveFilename
CheckLegalitySubmenu
KeyShiftControlKeyR
SavegameHook
CheckPrice
KeyShiftControlKeyR
SaveMenuContext
CheckSealedCharacter
KeyShiftControlKeyS
SavePath
check_card
KeyShiftControlKeyT
Say
ChooseDeckMenu
KeyShiftControlKeyU
Say
ClearCardBook
KeyShiftControlKeyW
Say
ClearEmptyGroups
KeyShiftControlKeyW
scale_image
ClearGame
KeyShiftControlKeyW
Score
ClearScores
KeyShiftControlKeyX
Score
ClearSearchbox
KeyShiftControlKeyY
ScoreAdjustment
Command
KeyTab
ScoreToText
Command
KeyUp
ScoreToText
CommandAddproduct
- L - ScoreToText
CommandBan
L
screen2table
CommandBans
languages
scripts
CommandBid
last
ScrollHistory
CommandBind
lc
Sealed
CommandBindk
LeaveChatMode
SealedEnd
CommandDebug
LeavePlayMode
SealedEndHook
CommandDelgame
LeaveTable
SealedEndHook
CommandDelproduct
LeaveTable
SealedOff
CommandDisplay
LeaveWatchMode
SealedOn
CommandEval
left
SealedStart
CommandFaq
LegalityCheck
SealedStartHook
CommandFaqclear
LegalityCheckDeck
SealedStartHook
CommandFind
LegalityCheckRule
SearchDeck
CommandGiveticket
LegalityCheckRules
SearchDeck
CommandGrant
LegalityCheckRuleset
SearchStartingCards
CommandHave
length
SectionSubmenu
CommandHelp
LineSplitFirstSpace
select
CommandKick
listbox_clear
SelectByAttr
CommandKicktable
listbox_entry
SelectCard
CommandLoadgame
listbox_scroll
SelectDeck
CommandLoadimages
listbox_set_deck
SelectDeckPart
CommandLog
listbox_set_entry
SelectMenuChooseADeck
CommandMe
listbox_sort_rows
Send
CommandNewuser
listjoin
Send
CommandPayall
load
Send
CommandProducts
LoadAllRules
SendAll
CommandQuit
LoadAllScripts
SendAll
CommandReboot
LoadAvatar
SendAllNP
CommandRefresh
LoadBookState
SendFullGameStatus
CommandRegister
LoadgameHook
SendFullGameStatusHook
CommandReload
LoadMenu
SendMeta
CommandReload
load_deck
SendOther
CommandRemoveuser
load_image
SendOther
CommandReproduce
LocationList
seq
CommandRestrict
Log
Set
CommandRo
Log
SetActive
CommandRtfm
Log
SetAvatar
CommandRtfm
Lower
SetAwayOff
CommandSave
lower
SetAwayOn
CommandSavegame
Lower
SetBookIndex
CommandSelect
LowerAttachments
SetBookPage
CommandSet
- M - SetCardbook
CommandSort
MainLoop
SetDeck
CommandTables
MakeLegalityCheck
SetForsale
CommandUnban
MakeLegalityCheck
SetHand
CommandUnbind
mana
SetHandSize
CommandUnrestrict
ManualTarget
SetJoinGame
CommandUnset
MapCon2Plr
SetMe
CommandUsers
max
SetMode
CommandWant
Menu
SetMoney
CommandWho
MenuByContext
SetMyName
CommandWhois
MenuClick
SetOfCard
CommandYell
MergeDeck
SetOption
CompanySize
MergeDeckSubmenu
SetPassword
Con2Plr
Message
SetPrice
Con
message
SetPrice
ConnectServer
MessageHook
SetProducts
ConstructMenu
min
sets
CoordinateMapping
min_price
SetScore
CoordToPlr
Mode
SetStayTapped
CoordToSvr
Mode
SetUpPlayer
copy
mouse
SetUpPlayer
count
MouseControlLeftClick
SetUpPlayer
CountCanonicalNamePairs
MouseControlLeftDragBegin
SetUpPlayer
CountCards
MouseControlLeftDragEnd
set_attr
CounterSubmenu
MouseControlMiddleClick
set_bgcolor
CountNamePairs
MouseControlMiddleClickMap
set_cardsize
count_cards
MouseLeftClick
set_data
CreateActive
MouseLeftClickActiveSet
set_error_trigger
CreateAvatar
MouseLeftClickActiveSet
set_fgcolor
CreateDeck
MouseLeftClickActiveSet
set_forsale
CreateDeck
MouseLeftClickCard
set_lang
CreateDeckHook
MouseLeftClickCardSelectBox
set_name
CreateDeckHook
MouseLeftClickCurrentDeck
set_of
CreateFilter
MouseLeftClickDeck
set_price
CreateHand
MouseLeftClickDeckSearchBox
set_textalign
CreateIndex
MouseLeftClickDiscardPile
set_textcolor
CreatePanel
MouseLeftClickDiscardPileSearchBoxHook
set_textfont
CreatePlayerIcon
MouseLeftClickHand
set_textmargin
CreatePlayerObjects
MouseLeftClickMap
set_textsize
CreateScreen
MouseLeftClickMyCollection
set_textvalign
CreateTypeLegalTable
MouseLeftClickOpenBooster
set_title
create_book
MouseLeftClickOpponentHand
ShowGameSpecificHelp
create_cardbox
MouseLeftClickPool
ShowGameSpecificHelp
create_deck
MouseLeftClickPoolSearchBoxHook
ShowHelp
create_hand
MouseLeftClickPrizes
ShowPanel
create_image
MouseLeftClickSideboard
ShowPlaymat
create_listbox
MouseLeftClickSideboard
ShowScreen
create_menu
MouseLeftClickSideboardSearchBoxHook
shuffle
create_msgbox
MouseLeftClickSiteCard
ShuffleDeck
CurrentDeckAddHavens
MouseLeftClickSites
SideboardSearchBoxMenuHook
CurrentDeckAddSites
MouseLeftClickSites
SingleCardMenu
CurrentDeckMenu
MouseLeftClickSitesSearchBoxHook
SingleCardMenuHook
CurrentDeckRemoveSites
MouseLeftClickSitesSearchBoxHook
SingleCardMenuHook
CurrentDeckRemoveUnownedSites
MouseLeftClickTable
SitesOfRegion
CurrentFilter
MouseLeftClickTwilightPool
SlashCommand
CurrentSorting
MouseLeftDragBegin
SlashComments
current_time
MouseLeftDragEnd
sleep
- D - MouseMiddleClick
sort
DataPath
MouseMiddleClickCard
SortSites
date
MouseMiddleClickCard
sort_by
deck
MouseMiddleClickCurrentDeck
sort_fn
DeckCheck
MouseMiddleClickDeckSearchBox
sort_fn
DeckMenu
MouseMiddleClickHand
Special
DeckName
MouseMiddleClickMap
Special
DeckName
MouseMiddleClickMyCollection
SpecialEventAdjustScore
decks
MouseMiddleClickOpenBooster
SpecialHook
DeckSearchBoxMenu
MouseMiddleClickPoolSearchBoxHook
split
DeclareResult
MouseMiddleClickSites
SplitToWords
Default
MouseMiddleClickTable
StacksByGroup
DefaultInitialPrice
MouseMiddleClickTwilightPool
stacktrace
del
MouseMiddleDragBegin
StartChatMode
DelActive
MouseMiddleDragEnd
StartGame
DelCard
MouseMoveObject
StartGame
DelCardInGroup
MouseWheel
StartGame
DelCards
MouseWheelChatMsg
StartGame
DelCursor
MouseWheelCurrentDeck
StartGame
DelDeck
MouseWheelMenu
StartGame
DelDeckHook
MouseWheelMyCollection
StartPlayMode
DelDeckTop
MoveAvatar
StartWatchMode
DeleteDeck
MoveObject
str2filter_atom
DelHand
MoveObject
str2filter_exp
DelMarker
MovePanel
str2filter_join
DelMarker
move_object
str2filter_rel
DelMenu
Msg
str2filter_split
DelRoomPlayer
msgbox_scroll
str2filter_sum
DelRoomTable
MsgCards
str2filter_term
delsaved
MsgChat
str2filter_typeconvert
DelTable
MsgOrdinal
str2filter_typetoint
DelTableHook
MsgTransfer
str2filter_typetostring
del_all_texts
MsgVerbObject
str2sorting
del_cardbox
MsgVerbObjectObject
String2Filter
del_cardbox_all_recenter
MyCollectionMenu
String2Sorting
del_cardbox_recenter
MyDeck
strreplace
del_deck
MyFrodo
strreplace
del_deck_top
MyPath
SubjectName
del_entry
- N - Submenu
del_hand
name
subobjects
del_marker
net_client_ip
substr
del_object
net_client_name
sum
del_prices
net_close
- T -
del_text
net_connect
table2screen
DestroyUserDisplay
net_create_server
Table
Detach
net_get
TableCoord
detach
net_isopen
TableMenu
Detach
net_send
TableNumber
diff_time
net_server_close
TableObject
DiscardPileMenu
net_server_get
tail
DisconnectPlayer
net_server_isopen
Take.Active
DisconnectServer
net_server_send
Take.Deck
DisplaySubmenu
net_server_send_all
Take.DeckTop
dist
NewDeck
Take.Hand
dump
NewDeck
Take.OutOfPlay
- E - NewDeck
Take.SearchDeck
EditAdd
NewDeck
Take.Table
EditAddSideboard
NewUser
tap
EditAddSideboard
NextFreeAttachPos
tapped
EditCardname
NextSiteNumber
tapped_left
EditCardNumber
NextTarget
tap_left
EditCountCards
None
TargetCard
EditCreateDeck
Null
TargetingOptions
EditDel
Null
TargetName
EditNearestPartname
Null
text
EditPartname
Number
text_height
EditRemoveSideboard
- O - text_width
EditRemoveSideboard
ObjectAt
Tickets
EndGame
ObjectName
TicketsList
EndGame
objects
TicketsOf
EndGame
object_data
time
EndGameHook
object_name
Timer15Seconds
EndGameHook
object_type
Timer5Seconds
EndOfTurnHook
ObjH
Timer
EnsurePriceUpdate
ObjW
TimerMinute
execute
OpenBoosterMenu
title
ExportASCIIDeck
OpponentActiveSetMenu
tofilename
ExportCards
OpponentDeckMenu
tofnc
ExportDeckMenu
OpponentDiscardPileMenu
ToggleJoinGame
ExportGccgDeck
OpponentHandMenu
TogglePanel
ExportToFile
OpponentPrizesMenu
toint
- F - OriToPlr
TokenSubmenu
filter_mana
OriToSvr
toreal
find
OtherDeckFormats
tostr
FindCardGroupIndices
Owner
Touch
FindCards
Owner
toval
FindOtherCard
- P - tr
FindSpace
PanelVisible
tr
first
ParentObject
Transfer
FixedSet
Play.Card.Stage1
TransferMoney
Flash
Play.Card.Stage2
TribalLegal
flatten
Play
trigger
Flip
PlayCard
trim
forall
PlayCommandDraw
TrimSpaces
format
PlayCommandInplay
TryTransferHook
FreeTablePos
PlayCommandLegal
TryTransferHook
fuzzy
PlayCommandLose
TryTransferTo
fuzzy_images
PlayCommandOk
TwilightPool
- G - PlayCommandUndecided
TwilightTokens
GameSetup
PlayCommandWin
TypeLegal
game_data
PlayerName
typeof
game_option
PlayerNumber
TypeRestricted
GccgFormatParser
PlayerOrder
- U -
GccgFormatSuffix
PlayEvent
uc
GeneratePassword
PlayFromSelectionHook
ucfirst
GetByPrimaryCategory
PlayInstant
unique
GetGroups
PlayInterrupt
UnsetStayTapped
get_attr
PlayKeyControlKeyA
untap
get_card_data
PlayKeyControlKeyA
UntapHook
get_lang
PlayKeyControlKeyD
UntapHook
get_texts
PlayKeyControlKeyD
untapped
Give
PlayKeyControlKeyDelete
UpdateCard
GiveCard
PlayKeyControlKeyDelete
UpdatePanel
GiveCardSubmenu
PlayKeyControlKeyE
UpdateProductsPanel
GiveMoney
PlayKeyControlKeyF
UploadDeck
Group
PlayKeyControlKeyHome
User
GroupNumbers
PlayKeyControlKeyI
UserWithoutMode
- H - PlayKeyControlKeyL
user_has_cards
h
PlayKeyControlKeyMinus
- V -
hand
PlayKeyControlKeyP
ValidCardNumber
HandleMetaServer
PlayKeyControlKeyPlus
ValidMode
HandlePriceInput
PlayKeyControlKeyS
ValidUsername
HandMenu
PlayKeyControlKeyT
valueof
HandPos
PlayKeyControlKeyU
values
HashComments
PlayKeyControlKeyU
vardump
has_entry
PlayKeyDelete
Verb
has_text
PlayKeyEnd
VersionCompare
HaveList
PlayKeyEnter
- W -
have_list
PlayKeyHome
w
having_rarity
PlayKeyInsert
WaitMetaEvents
head
PlayMapMenu
WantList
HidePanel
PlayPoolMenu
want_list
HidePlaymat
PlaySideboardMenu
WatchActiveSetMenu
- I - PlaySideboardMenu
WatchCardMenu
Image
PlaySite
WatchCommandInplay
images
PlaySiteFromSelection
WatchCommandNewdeck
image_height
PlaySitesMenu
WatchCommandRd
image_pixel
PlaySitesMenu
WatchDeckMenu
image_width
PlaySorcery
WatchDeckSearchBoxMenu
ImportAdd
PlayTrainer
WatchDiscardPileMenu
ImportASCIIDeck
PlayTwilightPoolMenu
WatcherSay
ImportDeck
Plr2Con
WatchHandMenu
ImportDeckFormat
PoolSearchBoxMenuHook
WatchKeyControlKeyD
ImportDeckMenu
pop
WatchKeyControlKeyE
ImportDeckMenuEntry
Positions
WatchKeyControlKeyI
ImportErrorAdd
PressKey
WatchKeyControlKeyS
ImportGccgDeck
PriceDelta
WatchKeyControlKeyW
ImportReaderLineByLine
price_list
WatchKeyControlKeyX
index
print
WatchOpponentDeckMenu
InitDistributions
println
WatchOpponentDiscardPileMenu
InitDistributions
PrizeForDraw
WatchOpponentHandMenu
InitDistributions
PrizeForLoss
WeStartedGame
InitDistributions
PrizeForWin
wr
Initialize
PrizesMenu
write_file
Initialize
Produce
- _ -
InitializeConnection
ProduceBE_Booster
_EndGame
InitializeGame
ProduceBE_Starter
_InitializeGame
InitializeGame
ProduceBooster
_StartGame
InitializeGame
ProduceLE_Starter
(1138 functions)
InitializeGame
ProduceTW_Starter
 

Common client and server functions

def abs(x)
Category: Common client and server functions
File: common.include
Return absolute value of x.

def age(set)
Category: Common client and server functions
File: common.include
Workaround for binaries not having age().

def book_set_slot(set)
Category: Common client and server functions
File: common.include
Workaround for binaries not having booksetslot().

def CountCards(list of card numbers)
Category: Common client and server functions
File: common.include
Return list of pairs (card number,nmb.of card).

def DataPath(section)
Category: Common client and server functions
File: common.include
Return directory containing Gccg data for section.

def del(e, L)
Category: Common client and server functions
File: common.include
Remove one instance of element e from the list L and return remaining list.

def dist((x1, y1), (x2, y2))
Category: Common client and server functions
File: common.include
Compute the square of the distance between (x1,y1) and (x2,y2).

def GeneratePassword()
Category: Common client and server functions
File: common.include
Return randomly generated string.

def isreal(d)
Category: Common client and server functions
File: common.include
Return 1 if string d represents a real number.

def LegalityCheckDeck(deck)
Category: Common client and server functions
File: common.include
Return the list of rulesets to which deck mathces.

def LegalityCheckRule((rule name, parameters), deck part, list of cards)
Category: Common client and server functions
File: common.include
Evaluate one rule for the given deck part.

def LegalityCheckRules(rules, part name, list of cards)
Category: Common client and server functions
File: common.include
Apply all rules in the rules list to the list of cards. Return 1 if the list of cards is valid, 0 otherwise.

def LegalityCheckRuleset(ruleset name, deck)
Category: Common client and server functions
File: common.include
Return 1 if a deck matches the given ruleset. If the ruleset name is "" collect all deckparts together before check, otherwise just single part is checked.

def listjoin(L, e)
Category: Common client and server functions
File: common.include
Join elements of the list L to the new list by inserting an element e between each member of the list L.

def MyPath()
Category: Common client and server functions
File: common.include
Return my personal Gccg directory for the current game.

def round(n, d)
Category: Common client and server functions
File: common.include
Round a number to d decimals.

def RuleCanonicalCardLimitSingle((card name, limit), list of cards)
Category: Common client and server functions
File: common.include
Check limit and remove cards by canonical name.

def RuleCardLimitAny(card name, list of cards)
Category: Common client and server functions
File: common.include
Remove all cards by name.

def RuleCardLimitGeneral(limit, list of cards)
Category: Common client and server functions
File: common.include
Check the limit and remove cards with the given name and report errors.

def RuleCardLimitSingle((card name, limit), list of cards)
Category: Common client and server functions
File: common.include
Check limit and remove cards by name.

def RuleCardSet((set abbrev, limit), list of cards)
Category: Common client and server functions
File: common.include
Check the number of cards belonging to the set.

def RuleCardSetReprint((set abbrev, limit), list of cards)
Category: Common client and server functions
File: common.include
Check the number of cards belonging to the set including cards with the same name.

def RuleCheckExpression((description, expression), list of cards)
Category: Common client and server functions
File: common.include
Evaluate expression by subtituting card list to # and report description if failed.

def RuleDeckMaximum(max, list of cards)
Category: Common client and server functions
File: common.include
Return card list, but report error if more than maximum.

def RuleDeckMinimum(min, list of cards)
Category: Common client and server functions
File: common.include
Return card list, but report error if less than minimum.

def RuleDeckSizes(list of allowed sizes, list of cards)
Category: Common client and server functions
File: common.include
Return card list, but report error if size is not in the list of allowed sizes.

def RuleLimitByExpression((limit, expression), list of cards)
Category: Common client and server functions
File: common.include
Limit total number of card satisfying the expression and remove them.

def RuleLimitEachByExpression((limit, expression), list of cards)
Category: Common client and server functions
File: common.include
Limit each card satisfying the expression and remove them.

def RulePass()
Category: Common client and server functions
File: common.include
Catch all rule, return empty list.

def RuleViolation(reason)
Category: Common client and server functions
File: common.include
Store deck rule violation message.

def SavePath()
Category: Common client and server functions
File: common.include
Return directory for (server) saves.

def sort_fn(set)
Category: Common client and server functions
File: common.include
Workaround for binaries not having sortfn().

def strreplace(s, a, b)
Category: Common client and server functions
File: common.include
Replace all instances of a in string s with b. Also in C++.

def sum(e1, ..., en)
Category: Common client and server functions
File: common.include
Return sum of arguments.

def tofilename(text)
Category: Common client and server functions
File: common.include
Convert a text to valid filename.

def tofnc(text)
Category: Common client and server functions
File: common.include
Convert a text to valid function name.

def tr(s, a, b)
Category: Common client and server functions
File: common.include
Replace every character in string a found from string s with b. Also in C++.

def ValidCardNumber(number)
Category: Common client and server functions
File: common.include
Return 1 if the number is valid cardnumber and presents real card.

def ValidMode(mode)
Category: Common client and server functions
File: common.include
Return 1 if mode is valid.

def ValidUsername(name)
Category: Common client and server functions
File: common.include
Return 1 if name is valid as a username.

def VersionCompare(ver1, ver2)
Category: Common client and server functions
File: common.include
Return 1 if version ver1 is older than ver2.

def wr(e)
Category: Common client and server functions
File: common.include
Write expression literally to stdout.

Core functions (C++)

def apply(f, L)
Category: Core functions (C++)
File: parser.h
Call a function f once for each argument in the list L. Return list of return values of each call.

def array(d1, ..., dn)
Category: Core functions (C++)
File: parser_lib.cpp
This function creates list of lists structure which is suitable for array like indexing. Dimension of the array is n and each di denotes the size of the ith dimension of the array. Initial values of the list are NULL.

def attach(v, t)
Category: Core functions (C++)
File: parser.h
Attach a variable 'v' to the disk database. If the database does not exist yet, then current value of the variable 'v' is taken as initial content for the database having type t. Supportet types are now "DBSingleFile" and "DBStringKeys". After that, each change in the value of variable 'v' is stored to the disk automatically. If the database exist already, then old value of the variable 'v' is ignored and the database is used instead.

def cache_parameters(var, (p1, p2, p3))
Category: Core functions (C++)
File: parser.h
If only a variable name is given, return the list containing current cache parameters for that database variable. If a list of parameters is also given, set parameters and return earlier settings. Parameters are p1 - cache refresh rate in seconds, p2 - mininmum age before disk write in seconds, p3 - maximum number of entries to write at one update. A negative value can be given in order to leave a parameter unchanged.

def call(f, e)
Category: Core functions (C++)
File: parser.h
Call function f given as a string with arguments e.

def copy(e, n)
Category: Core functions (C++)
File: parser_lib.cpp
Create a list with element e repeated n times. If n<= 0, return empty list. Return NULL, if arguments are invalid.

def count(e, L)
Category: Core functions (C++)
File: parser_lib.cpp
Count number of elements e in list L.

def current_time()
Category: Core functions (C++)
File: parser_lib.cpp
Return the time in seconds since the Epoch as real number.

def date()
Category: Core functions (C++)
File: parser_lib.cpp
Return current day in %d.%m.%y format.

def delsaved(s)
Category: Core functions (C++)
File: parser.h
Remove a file where variable 's' is saved. Return 1 if file exist and is succesfully removed.

def del_entry(e, L)
Category: Core functions (C++)
File: parser.h
If L is a list of pairs (i.e.dictionary), delete all elements whose first component is e. If L is a string delete entry from directly from parser the variable and return 1 if successful.

def diff_time(t1, t2)
Category: Core functions (C++)
File: parser_lib.cpp
Return the time difference from the moment t2 to the moment t1 given as seconds (since the Epoch). The return value is a quadruple (d,h,m,s), where d is the number of days, h is the number of hours, m is the number of minutes and s is the number of seconds. All return values are negative if the moment t2 is after the moment t1.

def execute(f)
Category: Core functions (C++)
File: parser.h
Run script at a file f and return 1, if the file exists. Throw fatal exception, if the security manager is enabled and the file is not declared as a safe in the program binary.

def find(e, L)
Category: Core functions (C++)
File: parser_lib.cpp
Return index of the first instance of element e in a list L or NULL if not found. Alternatively find the starting position of the first instance of substring e in a string L.

def first(L)
Category: Core functions (C++)
File: parser_lib.cpp
If L is a non-empty list, return the first element of the list. If it is a string, return the first character as a string. Otherwise NULL.

def flatten(L)
Category: Core functions (C++)
File: parser_lib.cpp
If L is not a list, return a list containing L as an element. Otherwise destroy sublist structures and leave elements untouched.

def forall(s, e1, ..., en)
Category: Core functions (C++)
File: parser.h
Evaluate string s once for each e1,...,en substituting value of each ei in the place of the first # character in s. Return the list of results. If n=1 and e1 is a list, substitute each value of the list e1.

def format(f, e)
Category: Core functions (C++)
File: parser_lib.cpp
Return C-printf formatted string of a real number f.

def fuzzy(s)
Category: Core functions (C++)
File: parser_lib.cpp
Remove all accents from letters and drop spaces and special characters.

def get_lang()
Category: Core functions (C++)
File: parser_lib.cpp
Return current localization language.

def has_entry(e, L)
Category: Core functions (C++)
File: parser_lib.cpp
Return 1 if dictionary L has member e, 0 otherwise. Throw exception, if L is not a dictionary.

def head(L)
Category: Core functions (C++)
File: parser_lib.cpp
Return all member of the list L except the last. If L have one or zero members, return empty list. If L is not a list, return NULL.

def index(L1, L2)
Category: Core functions (C++)
File: parser_lib.cpp
Select members of list L1 using list L2 as index. If any member i of L2 is not integer or i < 0 or i => |L1|, error is thrown. The resulting list has the same number of elements as L2, each element corresponding to indexing member in L2.

def isdict(L)
Category: Core functions (C++)
File: parser_lib.cpp
Return 1 if L is a dictionary.

def isfunction(s)
Category: Core functions (C++)
File: parser.h
Return 1 if s is user defined function, 2 if s is library function, 3 if s is internal parser function, 4 if s is application defined function, 5 if s is a special function and 0 if there is no such function.

def isvar(s)
Category: Core functions (C++)
File: parser.h
Return 1 if a string s name of the defined varible.

def join(e, s)
Category: Core functions (C++)
File: parser_lib.cpp
If e is a list of strings and s is not given, concatenate the strings together and return the resulting string. With s, add a string s between list members.

def joker_match(p, s)
Category: Core functions (C++)
File: parser_lib.cpp
Return 1 if string s matches to joker pattern p. If a list of strings is given instead of a single string, then each maching string is returned.

def keys(D)
Category: Core functions (C++)
File: parser.h
Return list of key elements of dictionary D or throw error if D is not a dictionary. This functions also returns list of first elements of list containing only pairs. If D is given as a string, the parser variable with that name is accessed directly. This is much faster escpecially with file databases.

def L(msg, [arg1], [arg2])
Category: Core functions (C++)
File: parser_lib.cpp
Localize a message.

def languages(code)
Category: Core functions (C++)
File: parser_lib.cpp
Return a dictionary mapping ISO639 language codes to language names.

def last(L)
Category: Core functions (C++)
File: parser_lib.cpp
If L is a non-empty list, return the last element of the list. If it is a string, return the last character as a a string.

def lc(s)
Category: Core functions (C++)
File: parser_lib.cpp
Convert string s to lower case.

def left(s, n)
Category: Core functions (C++)
File: parser_lib.cpp
Return n characters from the beginning of string s or empty string if n <= 0. If s is a list, then return n members from the beginning of the list.

def length(e)
Category: Core functions (C++)
File: parser_lib.cpp
If e is a string or a list, return length of it. Otherwise return -1.

def load(s)
Category: Core functions (C++)
File: parser.h
Load the value of the variable with name s from the save directory. Return 1, if success, 0 otherwise.

def max(L)
Category: Core functions (C++)
File: parser_lib.cpp
Return maximum member of the list L with respect to < operator.

def min(L)
Category: Core functions (C++)
File: parser_lib.cpp
Return minimum member of the list L with respect to < operator.

def pop()
Category: Core functions (C++)
File: parser.h
Remove the topmost value of the stack and return it.

def print(e)
Category: Core functions (C++)
File: parser_lib.cpp
Print the value of expression e to the standard output. List members are separeated by spaces.

def println(e)
Category: Core functions (C++)
File: parser_lib.cpp
Same as print, but a new line is appended.

def push(e1, ..., en)
Category: Core functions (C++)
File: parser.h
Push values e1,...,en to the stack in that order. Return the current size of the stack.

def quit(n)
Category: Core functions (C++)
File: parser_lib.cpp
Throw Quit exception with optional exit code n.

def random(n)
Category: Core functions (C++)
File: parser_lib.cpp
Return random number between 0 and n-1. If n is not an integer, return NULL.

def randomize(e)
Category: Core functions (C++)
File: parser_lib.cpp
Initialize random number generator with seed e if e is integer. Otherwise initialze it with microsecond time value taken from system clock. Return value is the seed.

def read_file(f)
Category: Core functions (C++)
File: parser_lib.cpp
Read a text file f and return list of strings representing lines of the text file. Return NULL if reading fails.

def repeat([n], s)
Category: Core functions (C++)
File: parser.h
Evaluate a string s n times if n > 0. Return list of results. If n is omitted, then evaluate string s forever.

def replace(L, s, d)
Category: Core functions (C++)
File: parser_lib.cpp
Replace object L or members of list L having value s with value d.

def return(e)
Category: Core functions (C++)
File: parser.h
Set the return value during execution of the user defined function. Note: this do not terminate the execution of the function.

def reverse(L)
Category: Core functions (C++)
File: parser_lib.cpp
Return a list L reversed or throw an exception if L is not a list.

def right(s, n)
Category: Core functions (C++)
File: parser_lib.cpp
Return n characters from the end of string s or empty string if n <= 0. If s is a list, then return n members from the end of the list.

def save(s)
Category: Core functions (C++)
File: parser.h
Save the variable with name s to save directory or skip this if it is a database. If the variable s is not declared, throw error. If the variable has two dots in it's name, throw fatal error. Return 1, if success, 0 otherwise.

def select(s, L)
Category: Core functions (C++)
File: parser.h
Substitute each member x\in L into the string s in place of # character(s). If expression evaluates to non-zero integer, add x to the resulting list.

def seq(n1, n2)
Category: Core functions (C++)
File: parser_lib.cpp
Generate sequence (n1,n1+1,...,n2). Return NULL if n1 > n2 or if arguments are not integers.

def set_lang(code)
Category: Core functions (C++)
File: parser_lib.cpp
Select current language for localization.

def shuffle(L)
Category: Core functions (C++)
File: parser_lib.cpp
Return a randomly shuffled version of list L.

def sleep(t)
Category: Core functions (C++)
File: parser_lib.cpp
Wait for t seconds.

def sort(L)
Category: Core functions (C++)
File: parser_lib.cpp
Return list as sorted according to < operator.

def sort_fn(f, L)
Category: Core functions (C++)
File: parser.h
Return the list L sorted using the function f as comparison function. Each list member is substituted in place of '#' in the string f and evaluated to produce coparison function value.

def split(s1, s2, d)
Category: Core functions (C++)
File: parser_lib.cpp
If d is not givent Split the string s1 to pieces separated by the string s2 and return pieces as a list of strings. If s2 is empty string, split the string to single characters. If d=1 is given, add delimiters too in the resulting list.

def stacktrace()
Category: Core functions (C++)
File: parser.h
Print function call stack with arguments.

def strreplace(s, a, b)
Category: Core functions (C++)
File: parser_lib.cpp
Replace every instance of string a found from string s with b. Return NULL on if infinite recursive replacement.

def substr(s, p, z)
Category: Core functions (C++)
File: parser_lib.cpp
Return substring of s starting at position p and having a length of z. If z is not given, return substring of s starting at position p until end of the string.

def tail(L)
Category: Core functions (C++)
File: parser_lib.cpp
Return all members of the list L except the first. If L have one or zero members, return empty list. If L is not a list, return NULL.

def time()
Category: Core functions (C++)
File: parser_lib.cpp
Return current time in 24H clock format %h:%m:%s.

def toint(e)
Category: Core functions (C++)
File: parser_lib.cpp
If e is an integer return it unchanged. If e is a string, convert value to integer. If e is a real, round to nearest integer and return it. Otherwise, return 0.

def toreal(e)
Category: Core functions (C++)
File: parser_lib.cpp
If e is an integer or a real return it as a real. If e is a string, convert value to real. Otherwise, return 0.0.

def tostr(e)
Category: Core functions (C++)
File: parser_lib.cpp
Convert any element to string. This string is in such format that it produces element e when evaluated.

def toval(e)
Category: Core functions (C++)
File: parser_lib.cpp
Convert string converted by tostr back to appropriate value. If e is not a string, return e.

def tr(s, a, b)
Category: Core functions (C++)
File: parser_lib.cpp
Replace every character in string a found from string s with b.

def trim(s)
Category: Core functions (C++)
File: parser_lib.cpp
Remove spaces from the beginning and from the end string s.

def typeof(e)
Category: Core functions (C++)
File: parser_lib.cpp
Return the type of e as a string null, integer, string, list or real.

def uc(s)
Category: Core functions (C++)
File: parser_lib.cpp
Convert string s to upper case.

def ucfirst(s)
Category: Core functions (C++)
File: parser_lib.cpp
Convert the first letter of the string s to upper case.

def unique(L)
Category: Core functions (C++)
File: parser_lib.cpp
Return unique elements of sorted list L.

def valueof(s)
Category: Core functions (C++)
File: parser.h
Return value of the variable named s or NULL if not defined.

def values(D)
Category: Core functions (C++)
File: parser_lib.cpp
Return list of value elements of dictionary D or throw error if D is not a dictionary. This functions also returns list of first elements of list containing only pairs.

def vardump()
Category: Core functions (C++)
File: parser.h
Print all variables and their values to the file named 'vardump'.

def write_file(file, lines)
Category: Core functions (C++)
File: parser_lib.cpp
Write text lines to the file. Return 1 if successful and NULL if fails.

GUI library (C++)

def add_marker(o, n)
Category: GUI library (C++)
File: interpreter.cpp
Add a marker number n to the object o. Throw an exception if n is not valid marker number.

def add_text(o, t)
Category: GUI library (C++)
File: interpreter.cpp
Add a text t to the object o.

def attach(o1, o2)
Category: GUI library (C++)
File: interpreter.cpp
Attach an object o1 to an object o2. Return NULL, if the attachment would cause a loop chain, 1 otherwise.

def beep(o, s)
Category: GUI library (C++)
File: interpreter.cpp
Produce a beep.

def book_cards(o, n)
Category: GUI library (C++)
File: interpreter.cpp
Return all cards at the page n in a book o.

def book_entry(o, n)
Category: GUI library (C++)
File: interpreter.cpp
Return entry of card n from book o (See book_set_entry).

def book_last_page(o)
Category: GUI library (C++)
File: interpreter.cpp
Return last page number of the book.

def book_page(o)
Category: GUI library (C++)
File: interpreter.cpp
Return current page number of the book.

def book_pageof(o, n)
Category: GUI library (C++)
File: interpreter.cpp
Return page number of card n in a book o.

def book_set_deck(o, L)
Category: GUI library (C++)
File: interpreter.cpp
Set current "ondeck" cards according to the list L.

def book_set_entry(o, L)
Category: GUI library (C++)
File: interpreter.cpp
Set card entries of the book o. A list L is a list of pairs ((n1,e1),...,(nk,ek)). Each ni is the card number of the entry ei to be set. Entry data ei is a vector (c,ps,s,pm,f,d), where c is the number of cards owned, ps is the lowest price offered, s is name of the seller, pm is price set by me, f is number of cards for sale from my collection and d is number of cards in my current deck. Alternative shorter form for entries is (c,f,pm), which sets only those fields of the entry.

def book_set_index(o, L)
Category: GUI library (C++)
File: interpreter.cpp
Set the current index of the card book o. A list L contains titles and card numbers to show. Each string is interpreted as a title and each integer as a card number.

def book_set_page(o, p)
Category: GUI library (C++)
File: interpreter.cpp
Set the current page of the card book o to p. Returns previous current page.

def book_set_slot(o, s)
Category: GUI library (C++)
File: interpreter.cpp
Set the current selected slot of the card book o to the card s (integer) or to the title s (string). Returns the page having the slot or NULL if not found. String "" removes the slot selection.

def book_titles(o)
Category: GUI library (C++)
File: interpreter.cpp
Return list all of pairs (ti,pi), where ti is a title from the book o and pi is the page number containing the title.

def card(o)
Category: GUI library (C++)
File: interpreter.cpp
Return the card number of the object o or NULL if o is not a card in play.

def cardbox(n)
Category: GUI library (C++)
File: interpreter.cpp
Return the content of the card box n.

def card_data(o)
Category: GUI library (C++)
File: interpreter.cpp
Return a vector (o,a,c,r), where o is owner of the card, a is current rotation angle, c is the card number of the visible side and r is real identity of the card number if known. Return NULL if o is not a card in play.

def center_of(n, [table])
Category: GUI library (C++)
File: interpreter.cpp
Return a vector (x,y) containing the center of the object or NULL if n is not an object. If optional argument table is given, convert coordinates to the table coordinates.

def change_card(n, c)
Category: GUI library (C++)
File: interpreter.cpp
Change the image of the card with object number n to c. Shift previous card number to real-card value.

def create_book(x, y, n, s, c, r)
Category: GUI library (C++)
File: interpreter.cpp
Create a card book named s with object number n at (x,y). Size of the card book is c columns and r rows. Note that the card book is not visible by default. Sets also variable book.last_page to denote the last page of the book.

def create_cardbox(x, y, n, s)
Category: GUI library (C++)
File: interpreter.cpp
Create a card box object at (x,y). It's object number is n and name s. Return n.

def create_deck(x, y, n, s)
Category: GUI library (C++)
File: interpreter.cpp
Create a deck object to (x,y). Object number is n and name is s. Return n.

def create_hand(x, y, n, s)
Category: GUI library (C++)
File: interpreter.cpp
Create a hand object at (x,y). It's object number is n and name s. Return n.

def create_image(x, y, n, i, s, v)
Category: GUI library (C++)
File: interpreter.cpp
Create an image at (x,y). An object number is n, an image number is i and a name is s. Argument v is optional and defines the visibility of the image.

def create_listbox(x, y, n, s, r, T, W, rv, A)
Category: GUI library (C++)
File: interpreter.cpp
Create a listbox at (x,y) with object number n and name s. The initial number of rows is r (table grows automatically), the number of visible rows is nn, list of titles is T, list of column widths is W and list of alignments (0 - left, 1 - center, 2 - right) is A. Note that list box is not visible by default.

def create_menu(x, y, n, s, M)
Category: GUI library (C++)
File: interpreter.cpp
Create a menu at (x,y) with object number n and name s. List of menu entries M may contain lists with one (t,), two (t,s) or three (t,s,a) string members. Here t is a text to show on entry, s is shortcut key and a is an action to send menu handler (i.e. code to execute).

def create_msgbox(x0, y0, n, s, w, h, L)
Category: GUI library (C++)
File: interpreter.cpp
Create a message box to the position (x0,y0). Object number is n, name is s and the size of the box is w\times h. Return the object number of the message box created. The maximum number of lines is L.

def deck(d)
Category: GUI library (C++)
File: interpreter.cpp
Return the list of card numbers in deck d.

def del_all_texts(o)
Category: GUI library (C++)
File: interpreter.cpp
Delete all texts from the object o. Return number of texts removed.

def del_cardbox(b, i)
Category: GUI library (C++)
File: interpreter.cpp
Remove a card with index i from the card box b. Return NULL if i is not a valid index. Otherwise return the card number of the removed card.

def del_cardbox_all_recenter(b)
Category: GUI library (C++)
File: interpreter.cpp
Remove all cards. Return the number of cards removed.

def del_cardbox_recenter(b, i)
Category: GUI library (C++)
File: interpreter.cpp
Same as the delcardbox, but move the box keeping the center of the box in place.

def del_deck(o, i)
Category: GUI library (C++)
File: interpreter.cpp
Remove the ith card counting from the top of the deck o.

def del_deck_top(d)
Category: GUI library (C++)
File: interpreter.cpp
Remove a card from the top of the deck d. Return card number if successful and NULL if not. h. Return NULL if i is not a valid index. Otherwise return card number of the removed card.

def del_hand(h, i)
Category: GUI library (C++)
File: interpreter.cpp
Remove a card with index i from a hand h. Return NULL if i is not a valid index. Otherwise return card number of the removed card.

def del_marker(o, n)
Category: GUI library (C++)
File: interpreter.cpp
Delete a marker number n from the object o. Throw an exception if n is not valid marker number.

def del_object(n)
Category: GUI library (C++)
File: interpreter.cpp
Remove an object n from the screen if it exist and return 1. Otherwise NULL.

def del_text(o, t)
Category: GUI library (C++)
File: interpreter.cpp
Delete a text t from the object o.

def detach(o)
Category: GUI library (C++)
File: interpreter.cpp
Detach an object o if attached to another object.

def dump()
Category: GUI library (C++)
File: interpreter.cpp
Print status of the all display elements on stdout.

def get_attr(o, a)
Category: GUI library (C++)
File: interpreter.cpp
Get the current value of the widget flag a of the object o (See Class Widget).

def get_texts(o)
Category: GUI library (C++)
File: interpreter.cpp
Return a list of all texts added to object.

def h(h)
Category: GUI library (C++)
File: interpreter.cpp
Convert a width component to the physical pixel width.

def hand(h)
Category: GUI library (C++)
File: interpreter.cpp
Return the list of card numbers in hand h.

def has_text(o, t)
Category: GUI library (C++)
File: interpreter.cpp
Return 1 if an object o has text t on it.

def image_height(i)
Category: GUI library (C++)
File: interpreter.cpp
Return the height of the image i.

def image_pixel(i, x, y)
Category: GUI library (C++)
File: interpreter.cpp
Return (r,g,b) value of the pixel (x,y) of the image i.

def image_width(i)
Category: GUI library (C++)
File: interpreter.cpp
Return the width of the image i.

def inplay([p])
Category: GUI library (C++)
File: interpreter.cpp
Return the list of objects numbers in play owned by player number p or all objects if p is not given. The topmost object is last.

def InputSplit(line)
Category: GUI library (C++)
File: interpreter.cpp
Return a pair where the first component is the input line before the cursor and the second component after the cursor. Each component is splitted list of the input atoms, i.e. mixed list of characters and tags. If the line is empty string returns a pair of two list each having a string "".

def intersect(o)
Category: GUI library (C++)
File: interpreter.cpp
Return a list of all other objects intersecting an object o. Alternatively intersect(x,y,w,h) returns a list of all objects intersecting rectangle.

def invert(o)
Category: GUI library (C++)
File: interpreter.cpp
If an object o is not a card in play, return NULL. If it as already inverted card, return 0. Otherwise invert the card and return 1.

def listbox_clear(l)
Category: GUI library (C++)
File: interpreter.cpp
Clear all elements of list box l.

def listbox_entry(l, r)
Category: GUI library (C++)
File: interpreter.cpp
Return content of the row r of the listbox l.

def listbox_scroll(l, \delta)
Category: GUI library (C++)
File: interpreter.cpp
Scroll list box content by \delta rows up.

def listbox_set_deck(l, D, b)
Category: GUI library (C++)
File: interpreter.cpp
Clear list box l and construct deck listing of the deck D as it's new content. Check missing cards from a card book b. Deck D is hashmap from the part names of the deck to the list of card numbers contained in each part.

def listbox_set_entry(l, i, L)
Category: GUI library (C++)
File: interpreter.cpp
Set a row i of the list box l to contain a list L as it's data. The size of the list L must match to the number of columns defined to the list box. String entries of L are used as they are and non-string entries are converted to string before use.

def listbox_sort_rows(l, r1, r2, c)
Category: GUI library (C++)
File: interpreter.cpp
Sort rows r1-r2 of the list box l using column c as a key.

def load_image(s1, [s2])
Category: GUI library (C++)
File: interpreter.cpp
Load an image with filename s1 or s2 if s1 not found and return it's image number. If neither one is found, throw an exception.

def lower(o)
Category: GUI library (C++)
File: interpreter.cpp
Lower an object o below other objects.

def message(o, m)
Category: GUI library (C++)
File: interpreter.cpp
Print message to the message box o. Returns o if successfull, null otherwise.

def mouse(m)
Category: GUI library (C++)
File: interpreter.cpp
If m is 1, show mouse pointer, otherwise hide it.

def move_object(n, x, y)
Category: GUI library (C++)
File: interpreter.cpp
Move an object n to (x,y).

def msgbox_scroll(b, n)
Category: GUI library (C++)
File: interpreter.cpp
Scroll the content of the message box b by n lines upward if n=> 1 or -n lines downward if n <= -1.

def objects()
Category: GUI library (C++)
File: interpreter.cpp
Return all object numbers of the objects on the screen.

def object_data(n)
Category: GUI library (C++)
File: interpreter.cpp
Return a data vector (x,y,w,h,p,G,M) for the object number n, where (x,y) is coordinates on the table, w \times h is the size of the object, p is the object number of the parent object, G is the list of all attached object numbers and M is list of all pairs (c,n) of markers at the object, where n is number of markers and c is number of color.

def object_name(n)
Category: GUI library (C++)
File: interpreter.cpp
Name of the object number n.

def object_type(n)
Category: GUI library (C++)
File: interpreter.cpp
Type of the object number n as a string "image", "counter", "marker", "cardinplay", "hand", "deck", "messagebox", "cardbox", "cardbook", "menu", or "listbox".

def put_cardbox(b, e)
Category: GUI library (C++)
File: interpreter.cpp
Put a card e or list of cards a e to the card box b. Throw an exception if e is not an imagenumber or contains invalid image number. Otherwise return b.

def put_cardbox_recenter(b, e)
Category: GUI library (C++)
File: interpreter.cpp
Same as the putcardboxrecenter, but move the card box after addition in a such way, that the center point of the box remains in place.

def put_deck_bottom(d, e)
Category: GUI library (C++)
File: interpreter.cpp
If e is an integer, put a card number e to the bottom of the deck. If e is a list, convert each element of the list to integer and add corresponding cards to the bottom of the deck. Return deck size if succesful, otherwise NULL.

def put_deck_top(d, e)
Category: GUI library (C++)
File: interpreter.cpp
If e is an integer, put a card e to the top of the deck. If e is a list, convert each element of the list to integer and add corresponding cards to the top of the deck. Return the deck size if succesful, otherwise NULL.

def put_hand(h, i)
Category: GUI library (C++)
File: interpreter.cpp
Put a card i to a hand h. Return NULL if i is not a imagenumber. Otherwise return h.

def put_inplay(n, x, y, o, i, p)
Category: GUI library (C++)
File: interpreter.cpp
Put a card i on the table, center of untapped card at the postition (x,y) and oriented in o degrees clockwise. Object number is n and owning player is p. Return the object number of new object.

def raise(o)
Category: GUI library (C++)
File: interpreter.cpp
Raise an object o and all related objects (child and parent objects recursively) above other objects. Return the number of raised objects.

def redraw(o)
Category: GUI library (C++)
File: interpreter.cpp
Draw object o again.

def refresh(i)
Category: GUI library (C++)
File: interpreter.cpp
Disable screen refresh (i.e. don't update screen until refresh(1) is called) if i=0 or enable it if i\ne 0. Return refresh status before this call.

def replace_cardbox_recenter(b, e)
Category: GUI library (C++)
File: interpreter.cpp
Replace the content of the card box b by card or cards e. Keep the center of the box in place.

def rot(\alpha, c)
Category: GUI library (C++)
File: interpreter.cpp
Rotate a card c by \alpha degrees.

def scale_image(i, w, h)
Category: GUI library (C++)
File: interpreter.cpp
Scale an image i to new size w \times h. Return old size (w,h) of the image.

def screen2table(x, y)
Category: GUI library (C++)
File: interpreter.cpp
Convert screen coordinates (x,y) to table coordinates (x',y').

def set_attr(o, a, b)
Category: GUI library (C++)
File: interpreter.cpp
Set the value of the widget flag a of the object o to b (See Class Widget).

def set_bgcolor(o, c)
Category: GUI library (C++)
File: interpreter.cpp
Set the background color for object o (see set_fgcolor).

def set_cardsize(t, s)
Category: GUI library (C++)
File: interpreter.cpp
Set card zoom factor s for card type t. The type t is a string "hand", "book", "deck" or "table". Returns old size.

def set_fgcolor(o, c)
Category: GUI library (C++)
File: interpreter.cpp
Set the foreground color of the object o. Color c should be NULL if set to invisible or a list (r,g,b) giving RGB-values between 0 and 255. The previous value is returned.

def set_name(o, s)
Category: GUI library (C++)
File: interpreter.cpp
Give a name s to an object o. Return old name of the object.

def set_textalign(o, a)
Category: GUI library (C++)
File: interpreter.cpp
Set the text alignment a (0 = left, 1 = center, 2 = right) for the object o. Old value is returned.

def set_textcolor(o, c)
Category: GUI library (C++)
File: interpreter.cpp
Set the text color for object o (see set_fgcolor).

def set_textfont(o, f)
Category: GUI library (C++)
File: interpreter.cpp
Set the font for object o.

def set_textmargin(o, m)
Category: GUI library (C++)
File: interpreter.cpp
Set the text margin to m pixels between the object border and the text of the object o. Old value is returned.

def set_textsize(o, s)
Category: GUI library (C++)
File: interpreter.cpp
Set the point size of texts for the object o. Old value is returned.

def set_textvalign(o, a)
Category: GUI library (C++)
File: interpreter.cpp
Set the vertical text alignment a (0 = top, 1 = middle, 2 = bottom) for the object o. Old value is returned.

def set_title(o, t)
Category: GUI library (C++)
File: interpreter.cpp
Set title t for the object o and return previous title.

def table2screen(x, y)
Category: GUI library (C++)
File: interpreter.cpp
Convert screen coordinates (x,y) to table coordinates (x',y').

def tap(o)
Category: GUI library (C++)
File: interpreter.cpp
If an object o is not a card in play, return NULL. If it as already tapped card, return 0. Otherwise tap the card and return 1.

def tapped(o)
Category: GUI library (C++)
File: interpreter.cpp
If o is not a card in play, return NULL. Otherwise return 1 or 0 depending on tapped status.

def tapped_left(o)
Category: GUI library (C++)
File: interpreter.cpp
If o is not a card in play, return NULL. Otherwise return 1 or 0 depending if card is tapped left or not.

def tap_left(o)
Category: GUI library (C++)
File: interpreter.cpp
If an object o is not a card in play, return NULL. If it as already left tapped card, return 0. Otherwise tap left the card and return 1.

def text_height(f, sz, s)
Category: GUI library (C++)
File: interpreter.cpp
Return the text width of a string s when rendered at point size sz using font f.

def text_width(f, sz, s)
Category: GUI library (C++)
File: interpreter.cpp
Return the text width of a string s when rendered at point size sz using font f.

def title(o)
Category: GUI library (C++)
File: interpreter.cpp
Return title of the object o.

def trigger(s1, s2)
Category: GUI library (C++)
File: interpreter.cpp
Call a trigger named "s1" "s2". Return NULL if the trigger does not exists. Otherwise, return 1 and set a variable RET to the last value of evaluated expression in the trigger.

def untap(o)
Category: GUI library (C++)
File: interpreter.cpp
If an object o is not a card in play, return NULL. If it as already untapped card, return 0. Otherwise untap the card and return 1.

def untapped(o)
Category: GUI library (C++)
File: interpreter.cpp
If o is not a card in play, return NULL. Otherwise return 1 or 0 depending on tapped status.

def w(w)
Category: GUI library (C++)
File: interpreter.cpp
Convert a width component to the physical pixel width.

Game data library (C++)

def age(n)
Category: Game data library (C++)
File: parser_libcards.cpp
Card age of the card number n or set named n. Return NULL if n is not a valid card number or set name.

def Attr(k, n)
Category: Game data library (C++)
File: parser_libcards.cpp
Same as cardattr, but return "" instead of NULL for missing attribute.

def attributes()
Category: Game data library (C++)
File: parser_libcards.cpp
Return the list containing all attributes.

def attrs(c)
Category: Game data library (C++)
File: parser_libcards.cpp
Return the sorted list of pairs containg attribute names and values of the cards number c. This list can be used as dictionary.

def canonical_name(n)
Category: Game data library (C++)
File: parser_libcards.cpp
Unique name of a card number n, which identifies the card by adding a set name and key attribute if otherwise undistinguishable. However, cards with the same properties and the same name have also the same canonical name if both belong in the same set.

def cards([set])
Category: Game data library (C++)
File: parser_libcards.cpp
Return the list of all non-special card numbers if no arguments given. Otherwise, return the card numbers from the given set.

def card_attr(k, n)
Category: Game data library (C++)
File: parser_libcards.cpp
Return card attribute of the card number n with key k. If the cards has <attr key="k" value="v"/> defined in XML-description, return v. Otherwise return NULL.

def card_back(c)
Category: Game data library (C++)
File: parser_libcards.cpp
Return background image number of the card.

def decks()
Category: Game data library (C++)
File: parser_libcards.cpp
Return a list of strings containgin deck names available or NULL if cannot open deck directory.

def fuzzy_images(s)
Category: Game data library (C++)
File: parser_libcards.cpp
Return a list of image numbers, which has almost the card name s.

def game_data()
Category: Game data library (C++)
File: parser_libcards.cpp
Return dictionaty of game data containgin entries "game" (name of the game), "gamedir" (directory name for the game), "play" (attribute to call triggers for when playing a card) and "location hint" (attributes to call triggers for when deciding card placement).

def game_option(o)
Category: Game data library (C++)
File: parser_libcards.cpp
Return the value of an option o defined in game.xml file.

def having_rarity(rarity, list of cards)
Category: Game data library (C++)
File: parser_libcards.cpp
Return weighted list of cards having the given rarity. For example, if a card have rarity 'CB+CS2' and we ask for rarity 'CS' then this function returns a list having two occurrences of the card.

def images(s)
Category: Game data library (C++)
File: parser_libcards.cpp
Return a list of image numbers, which has a card name s.

def inline_images()
Category: Game data library (C++)
File: parser_libcards.cpp
Return the list containing inline image tags.

def load_deck(s)
Category: Game data library (C++)
File: parser_libcards.cpp
If a deck named s is available, load it and return a list of strings containing each line of the text file. Return NULL if the deck cannot be loaded.

def name(n)
Category: Game data library (C++)
File: parser_libcards.cpp
Name of the card number n.

def rarities()
Category: Game data library (C++)
File: parser_libcards.cpp
Return the list containing all rarities.

def rules()
Category: Game data library (C++)
File: parser_libcards.cpp
Return the list containing all rule files for this game.

def scripts()
Category: Game data library (C++)
File: parser_libcards.cpp
Return a list of strings containging game specific extension scripts under scripts/Game directory.

def sets()
Category: Game data library (C++)
File: parser_libcards.cpp
List of set abbreviations of loaded card sets.

def set_data(s)
Category: Game data library (C++)
File: parser_libcards.cpp
Return a vector (n,c1,c2) for card set with abbreviation s. Here n is the name of the set, c1 is the first card of the set and c2 is the last card of the set.

def set_of(c)
Category: Game data library (C++)
File: parser_libcards.cpp
return set abbreviation of the set where a card number c belongs to or NULL if none.

def sort_by(k, L, t)
Category: Game data library (C++)
File: parser_libcards.cpp
Sort a list of card numbers L according to the key k. If k is a list, then the first list member is used as a primary key, second as a secundary key and so on. Each key can be a string '[att]', where attr is a card attribute. Then that attribute of the card is used as a sorting key. Special attribute "[name]" sorts according to card name and "[set]" accorfing to the card set. The key can be prepended by a character 'N' to force numerical sorting and by a character '-' to force reverse sorting. If an integer t > 0 is given, add title entries to the list.

def text(n)
Category: Game data library (C++)
File: parser_libcards.cpp
Card text of the card number n.

General client functions

def ActiveSetMenu()
Category: General client functions
File: client.functions
Create a menu for your cards set aside.

def AddCard(card number)
Category: General client functions
File: client.functions
Add a card to my collection.

def AddCards(list of card numbers)
Category: General client functions
File: client.functions
Add cards to my collection.

def AddHistory(string)
Category: General client functions
File: client.functions
Add a string to the input history and reset history position.

def AddMarker(object number, marker type, [count])
Category: General client functions
File: client.functions
Add a marker to the object.

def AddMinuteTimer(delay in minutes, command)
Category: General client functions
File: client.functions
Add a timer which fires after the given delay.

def AddRoomPlayer(player number, data, avatar)
Category: General client functions
File: client.functions
Add player to chat room.

def AddRoomTable(table number, data)
Category: General client functions
File: client.functions
Add table to chat room.

def AddTimer(delay in seconds, command)
Category: General client functions
File: client.functions
Add a timer which fires after the given delay.

def AddToDeck(deck name, deck part, card name, count)
Category: General client functions
File: client.functions
Add card(s) to the deck in the deck collection.

def Alert(message)
Category: General client functions
File: client.functions
Display message box.

def AlertOff()
Category: General client functions
File: client.functions
Hide previously displayed message.

def ApplyImportDeck(path)
Category: General client functions
File: client.functions
Handle menu selection for import deck menu. Check if path ends with / and show a submenu. Otherwise import the selected deck.

def ApplyImportDeckBack(path)
Category: General client functions
File: client.functions
Handle backing up one level in import path.

def ASCIIFormatParser(one or two strings)
Category: General client functions
File: client.functions
Parse ASCII format lines.

def ASCIIFormatSuffix()
Category: General client functions
File: client.functions
Return filename suffix .txt for ASCII-format.

def Attach(src object number, target object number)
Category: General client functions
File: client.functions
Attach an object to another.

def Attachments(object number)
Category: General client functions
File: client.functions
Return list of attached objects.

def AvatarFloorPos(player number)
Category: General client functions
File: client.functions
Return (x,y) pair telling location of the avatar on the floor.

def AvatarRecalcTable(table)
Category: General client functions
File: client.functions
Reposition all avatar at table.

def Bid(results)
Category: General client functions
File: client.functions
Handle bidding results (dictionary mapping player numbers to bids).

def BookChangeForsale(card number, difference)
Category: General client functions
File: client.functions
decrease or increase number of cards for sale.

def BookFullRefresh()
Category: General client functions
File: client.functions
Clear the book content and ask for full refresh.

def BookGoBack()
Category: General client functions
File: client.functions
Return to the previous indexing in history and remove it from the history.

def BookSetPrice(card number, price)
Category: General client functions
File: client.functions
set my price for a card and update it on server.

def Buy(list of received cards)
Category: General client functions
File: client.functions
Called when booster/starter bought.

def CardMenu()
Category: General client functions
File: client.functions
Create a menu for single card in play.

def CardSelectBoxMenu()
Category: General client functions
File: client.functions
Menu for card selector.

def Category(card number)
Category: General client functions
File: client.functions
Return the category of the card from rules.category table.

def CategoryMatch(category, partial categroy)
Category: General client functions
File: client.functions
Return 1 if a 'category' have includes a 'partial category' at the beginning of it's components.

def ChatCommandAway()
Category: General client functions
File: client.functions
Implementation of /away command.

def ChatCommandBuy()
Category: General client functions
File: client.functions
Implementation of /buy command.

def ChatCommandCopydeck()
Category: General client functions
File: client.functions
Implementation of /copydeck command.

def ChatCommandDefault()
Category: General client functions
File: client.functions
Implementation of /default command.

def ChatCommandGive(player, amount)
Category: General client functions
File: client.functions
Implementation of /give command.

def ChatCommandGo()
Category: General client functions
File: client.functions
Implementation of /go command.

def ChatCommandJoin()
Category: General client functions
File: client.functions
Implementation of /join command.

def ChatCommandNewdeck(name, of, the, deck)
Category: General client functions
File: client.functions
Implementation of /newdeck command.

def ChatCommandRd()
Category: General client functions
File: client.functions
Implementation of /rd command in chat mode.

def ChatCommandRenamedeck(new name)
Category: General client functions
File: client.functions
Implementation of renamedeck command.

def ChatCommandSave()
Category: General client functions
File: client.functions
Implementation of /save command.

def ChatCommandSealed()
Category: General client functions
File: client.functions
Implementation of /sealed command.

def ChatCommandSu()
Category: General client functions
File: client.functions
Implementation of /su command.

def ChatKeyControlKeyD()
Category: General client functions
File: client.functions
Handler for key Control+D in chat mode.

def ChatKeyControlKeyE()
Category: General client functions
File: client.functions
Handler for key Control+E in chat mode.

def ChatKeyControlKeyI()
Category: General client functions
File: client.functions
Handler for key Control+I in chat mode.

def ChatKeyControlKeyS()
Category: General client functions
File: client.functions
Handler for key Control+S in chat mode.

def ChatKeyControlKeyW()
Category: General client functions
File: client.functions
Handler for key Control+W in chat mode.

def ChatKeyControlKeyX()
Category: General client functions
File: client.functions
Handler for key Control+X in chat mode.

def CheckFilterVersion()
Category: General client functions
File: client.functions
Check that stored indices and filters are created with the current algorithm and there were the same number of cards. If different, clear all filters and indices and store new filter version.

def CheckForCard()
Category: General client functions
File: client.functions
Return a card number, if mouse points to card name (deck listing, etc.) or card image. Otherwise NULL.

def CheckFunctionsOrQuit(f)
Category: General client functions
File: client.functions
Quit with an error message if function f is not defined.

def CheckInitialVariables()
Category: General client functions
File: client.functions
Check that required variables and functions are defined before game initialization.

def CheckInitialVariablesOrQuit(v)
Category: General client functions
File: client.functions
Quit with an error message if variable v is not defined.

def CheckLegalitySubmenu()
Category: General client functions
File: client.functions
Deck legality checking menu.

def ChooseDeckMenu()
Category: General client functions
File: client.functions
Choose a deck.

def ClearCardBook()
Category: General client functions
File: client.functions
Clear content of the collection.

def ClearEmptyGroups()
Category: General client functions
File: client.functions
Move cards that has been moved enough since they played to the group ("moved",""). Remove groups without cards on table from 'card.group' table. Fix also cards having (0,0) as their coordinates.

def ClearGame()
Category: General client functions
File: client.functions
Clear table, remove aside, hand, deck and avatar objects.

def ClearScores()
Category: General client functions
File: client.functions
Remove all scores.

def ClearSearchbox()
Category: General client functions
File: client.functions
Clear content of the search box.

def CommandBind(text)
Category: General client functions
File: client.functions
Implementation of /bind command.

def CommandBindk(text)
Category: General client functions
File: client.functions
Implementation of /bindk command.

def CommandDisplay()
Category: General client functions
File: client.functions
Implementation of /display command.

def CommandEval()
Category: General client functions
File: client.functions
Implementation of /eval command.

def CommandFind()
Category: General client functions
File: client.functions
Implementation of /find command.

def CommandHelp(topic)
Category: General client functions
File: client.functions
Implementation of /help command.

def CommandLoadimages()
Category: General client functions
File: client.functions
Implementation of /loadimages command.

def CommandLog()
Category: General client functions
File: client.functions
Set logging on/off.

def CommandMe()
Category: General client functions
File: client.functions
Implementation of /me command.

def CommandNewuser()
Category: General client functions
File: client.functions
Implementation of /newuser command.

def CommandQuit()
Category: General client functions
File: client.functions
Implementation of /quit command.

def CommandRefresh()
Category: General client functions
File: client.functions
Implementation of /refresh command.

def CommandSelect()
Category: General client functions
File: client.functions
Implementation of /select command.

def CommandSet()
Category: General client functions
File: client.functions
Implementation of /set command.

def CommandSort()
Category: General client functions
File: client.functions
Implementation of /sort command.

def CommandTables()
Category: General client functions
File: client.functions
Implementation of /tables command.

def CommandUnbind()
Category: General client functions
File: client.functions
Implementation of /unbind command.

def CommandUnset()
Category: General client functions
File: client.functions
Implementation of /unset command.

def CommandWho()
Category: General client functions
File: client.functions
Implementation of /who command.

def ConnectServer(server, port, cookie)
Category: General client functions
File: client.functions
Connect to the game server.

def ConstructMenu(context)
Category: General client functions
File: client.functions
Construct a menu and return a menu for the given context by integrating standard entries (MENU variable), game specific entries (GAMEMENU variable) and extension defined entries (EXTRAMENU variable) together. A context parameter is one of the following: - 'Main Menu - Chat' chat mode main menu. - 'Main Menu - Play' play mode main menu. - 'Main Menu - Watch' watch mode main menu. - 'Current Deck Menu' deck editor. - 'Tap a card' menu used instead of default tapping menu. - 'A card' - menu added to card in play menu. - 'Deck Draw' - Additional deck menu card draw entries. - 'Table' - game table menu. - 'Open Booster' - opened booster menu. - 'Hand' - my hand menu. - 'Products' - products menu.

def CoordinateMapping(category)
Category: General client functions
File: client.functions
Return coordinate mapping rules of the given category from the 'rules.coordinate' table.

def CountCanonicalNamePairs(list of card numbers)
Category: General client functions
File: client.functions
Return the list of strings having number of cards and a card name.

def CounterSubmenu()
Category: General client functions
File: client.functions
Choose a counter color.

def CountNamePairs(list of card numbers)
Category: General client functions
File: client.functions
Return the list of strings having number of cards and a card name.

def CreateActive(object num, owner player, name)
Category: General client functions
File: client.functions
Create active set.

def CreateAvatar(image number, object number, player name, (x, y))
Category: General client functions
File: client.functions
Create avatar image.

def CreateDeck(object num, owner player, name, (x, y))
Category: General client functions
File: client.functions
Create a deck.

def CreateFilter(filter expressions)
Category: General client functions
File: client.functions
Return a list of cards matching the filter expression.

def CreateHand(object num, owner player, object name, (x, y))
Category: General client functions
File: client.functions
Create a hand.

def CreateIndex((filter expression, sort expression), list of cards)
Category: General client functions
File: client.functions
Return indexing matching filter/sort expression pair. First filter collection is checked and already calculated value is returned if found. Otherwise it is generated. The sort expression is either single string or a list of strings. If the list begins with a number, then it is taken as a title level depth, i.e. how many sorting criteria are taken into account when constructing the title for the sorted section. Default title depth is one.

def CreatePanel(name, x, y)
Category: General client functions
File: client.functions
Construct (invisible) objects for the given panel. If the panel already exists, then creation is skipped but the panel is moved to the position (x,y).

def CreatePlayerIcon(object num, player name, (x, y))
Category: General client functions
File: client.functions
Create player icon.

def CreateScreen(name, list of panels)
Category: General client functions
File: client.functions
Connect number of panels to the one screen.

def CurrentDeckMenu()
Category: General client functions
File: client.functions
Menu for current deck editor operations.

def CurrentFilter()
Category: General client functions
File: client.functions
Return value of the current filter expression.

def CurrentSorting()
Category: General client functions
File: client.functions
Return value of the current sorting expression.

def DeckMenu()
Category: General client functions
File: client.functions
Create menu for your deck.

def DeckName(internal name)
Category: General client functions
File: client.functions
Return human readable version of a deck name.

def DeckSearchBoxMenu()
Category: General client functions
File: client.functions
Create menu for deck search box.

def Default(group index, card index)
Category: General client functions
File: client.functions
Return a random point at the center of the screen.

def DefaultInitialPrice(card number)
Category: General client functions
File: client.functions
Return default initial price for cards using 'price' setting.

def DelActive(player, i)
Category: General client functions
File: client.functions
Delete card from the active set.

def DelCardInGroup(object number)
Category: General client functions
File: client.functions
Remove references of the card from table 'card.group'.

def DelCursor()
Category: General client functions
File: client.functions
Remove the cursor from the input line.

def DelDeck(object number, i)
Category: General client functions
File: client.functions
Remove the card at position i from the deck.

def DelDeckTop(object number)
Category: General client functions
File: client.functions
Remove top card of the deck.

def DeleteDeck(name)
Category: General client functions
File: client.functions
Remove the deck from the collection.

def DelHand(player number, i)
Category: General client functions
File: client.functions
Remove the card at position i from the player's hand.

def DelMarker(object number, marker type, [count])
Category: General client functions
File: client.functions
Delete a marker from the object.

def DelMenu()
Category: General client functions
File: client.functions
Remove current menu if shown.

def DelRoomPlayer(player number)
Category: General client functions
File: client.functions
Delete player from chat room.

def DelRoomTable(table number)
Category: General client functions
File: client.functions
Delete table from chat room.

def DelTable(object number)
Category: General client functions
File: client.functions
Del a card 'object number' from the table.

def DestroyUserDisplay()
Category: General client functions
File: client.functions
Remove current display if it is user defined.

def Detach(object number)
Category: General client functions
File: client.functions
Detach an object.

def DiscardPileMenu()
Category: General client functions
File: client.functions
Create menu for your discard pile.

def DisplaySubmenu()
Category: General client functions
File: client.functions
Show display options menu.

def EditAdd(deck part, card name or number)
Category: General client functions
File: client.functions
Add a card to the current deck.

def EditCardname()
Category: General client functions
File: client.functions
return name of the card under mouse on the deck list or NULL if none.

def EditCardNumber()
Category: General client functions
File: client.functions
Return (random) card number in deck editor under mouse or NULL if none.

def EditCountCards(part name, canonical name or number)
Category: General client functions
File: client.functions
Count number of cards in the part of the current deck.

def EditCreateDeck(deck name)
Category: General client functions
File: client.functions
Create a new deck and select it as current deck.

def EditDel(deck part, canonical name or number)
Category: General client functions
File: client.functions
Delete a card from the current deck, return 1 if successful.

def EditNearestPartname()
Category: General client functions
File: client.functions
Return name of the deck part above current line.

def EditPartname()
Category: General client functions
File: client.functions
Return name of the deck part title under mouse or NULL if none.

def ExportASCIIDeck(deck name, deck structure)
Category: General client functions
File: client.functions
Convert a deck to the list of lines of the ASCII deckfile.

def ExportCards(format, list of card number)
Category: General client functions
File: client.functions
Return a list mapped through conversion table cardmap{"E"}{format}.

def ExportDeckMenu()
Category: General client functions
File: client.functions
Export a deck.

def ExportGccgDeck(deck name, deck structure)
Category: General client functions
File: client.functions
Convert a deck to the list of lines of the Gccg deckfile.

def ExportToFile(deck structure, name, format)
Category: General client functions
File: client.functions
Export a deck to the file.

def FindCardGroupIndices(category)
Category: General client functions
File: client.functions
Return a pair (group index,index) by searching for a free slot in 'card.group' table. Add "reserved" entry to the table.

def FindCards(count, card name)
Category: General client functions
File: client.functions
Find several card images, preferably images of owned cards.

def FindOtherCard(group index, card index, expression, xoffset, yoffset)
Category: General client functions
File: client.functions
Look for other card on table using expression as a search criteria 'expression'. The criteria can use predefined variables 'group', 'category' and 'card'. Symbol # refers to the object number of the card on table under testing.

def FindSpace(card number, orientation, face down?)
Category: General client functions
File: client.functions
Return suitable free location (x,y) to put card in play.

def Flash(object number)
Category: General client functions
File: client.functions
Flash the object.

def FreeTablePos()
Category: General client functions
File: client.functions
Return (x,y) pair of the first free table position.

def GameSetup(my player number, total players, list of player names)
Category: General client functions
File: client.functions
Set the number of players, my playernumber and list of player names.

def GccgFormatParser(one or two strings)
Category: General client functions
File: client.functions
Parse Gccg format lines.

def GccgFormatSuffix()
Category: General client functions
File: client.functions
Return filename suffix .deck for Gccg-format.

def GetByPrimaryCategory(category table, primary category)
Category: General client functions
File: client.functions
Return a list of 'category table' table entries having a selected 'primary category'.

def GetGroups(categroy table)
Category: General client functions
File: client.functions
Collect group names from the list of category table entries.

def GiveCardSubmenu(card number)
Category: General client functions
File: client.functions
Generate menu for giving a card.

def GroupNumbers(primary category)
Category: General client functions
File: client.functions
Return group numbers in use under the given primary category.

def HandlePriceInput()
Category: General client functions
File: client.functions
Handler for number + return, i.e. pricing.

def HandMenu()
Category: General client functions
File: client.functions
Create a menu for your hand.

def HashComments(text line)
Category: General client functions
File: client.functions
Return empty string when the text line begins with #-character. Otherwise the line itself.

def HaveList(user name, list of cards for sale)
Category: General client functions
File: client.functions
Receive have list from server.

def HidePanel(name)
Category: General client functions
File: client.functions
Turn the panel invisible.

def HidePlaymat()
Category: General client functions
File: client.functions
Hide play mode background.

def ImportAdd(n, card number)
Category: General client functions
File: client.functions
Add n cards to the import.part part of the import.deck structure.

def ImportASCIIDeck(file content)
Category: General client functions
File: client.functions
ASCII-text importer.

def ImportDeck(file content)
Category: General client functions
File: client.functions
Try to recognize the deck format of the file and then import the deck according to that format. The file content is given as a list of strings representing lines of the file. Return a deck structure or a string describing the reason why import failed.

def ImportDeckFormat(format, file content)
Category: General client functions
File: client.functions
Import deck in the given format. Arguments and return value as in ImportDeck(). The variables import.deck, import.part and import.error are initialized and filled during the import process. It import.error is still an empty string after the calling appropriate importer, then import.deck structure is returned. Otherwise import.error is returned.

def ImportDeckMenu([path])
Category: General client functions
File: client.functions
Show deck import menu. If path is NULL, show the top level. Otherwise the specified sublevel of decks.

def ImportDeckMenuEntry(prefix, filename)
Category: General client functions
File: client.functions
Convert a deck filename to an menu entry.

def ImportErrorAdd(msg)
Category: General client functions
File: client.functions
Add a message msg to import.error variable.

def ImportGccgDeck(file content)
Category: General client functions
File: client.functions
Gccg-format importer.

def ImportReaderLineByLine(file content, comment stripper, line trimmer, line splitter, line parser)
Category: General client functions
File: client.functions
Deck import reader for text formats. Comment stripper, line trimmer and line splitter are function names,which are applied to the each line of the file. Comment stripper removes comments, line trimmer removes unnecessary parts of the line and line splitter converts it to the suitable format to the line parser. The parser updates variables import.error, import.deck and import.part and is applied to every non-empty line after trimming.

def Initialize()
Category: General client functions
File: client.functions
Initialize screen objects and variables.

def InitializeConnection()
Category: General client functions
File: client.functions
Check the variables and try out servers to connect.

def InitializeInputSystem()
Category: General client functions
File: client.functions
Load old history and clear input variables.

def InitializePanelSystem()
Category: General client functions
File: client.functions
Initialize all panel handling variables. Entries for each object in panelstructure are: (type,name,variable,x,y,w,h,txtc,fgc,bgc,font,ptsz,align,valign,attrs,arg1,arg2,arg3), where - type[0] is "msgbox" - name[1] is object name - variable[2] is the name of the variable for object number storage or NULL if none - x[3],y[4],w[5],h[6] is object dimensions (first is absolute, the rest are relative to the first object) - txtc[7],fgc[8],bgc[9] are text, foreground and background colors - font[10],ptsz[11],align[12],valign[13] are font info and text alignment - attrs[14] is a list of attributes to set - arg1[15], arg2[16] and arg3[17] are object specific arguments. msgbox: number of lines Entries for each panel in paneloptions are: - none yet.

def InitializeScoreSystem()
Category: General client functions
File: client.functions
Initialize score structures and objects.

def Input(string)
Category: General client functions
File: client.functions
Append a string to current command line input at the current cursor position.

def InputKeyBackspace()
Category: General client functions
File: client.functions
Input line editor handler for key Backspace.

def InputKeyDelete()
Category: General client functions
File: client.functions
Input line editor handler for key Delete.

def InputKeyEnd()
Category: General client functions
File: client.functions
Input line editor handler for key End.

def InputKeyHome()
Category: General client functions
File: client.functions
Input line editor handler for key Home.

def InputKeyLeft()
Category: General client functions
File: client.functions
Input line editor handler for key Left.

def InputKeyRight()
Category: General client functions
File: client.functions
Input line editor handler for key Right.

def InputNewline()
Category: General client functions
File: client.functions
Clear current input line and append it to the history. Returns the line before clear and converts {lb} and {rb} tags to { and }.

def InputSplit()
Category: General client functions
File: client.functions
Handles prehandling of the input line when editing. Return a pair where the first component is the input line before the cursor and the second component after the cursor. Each component is splitted list of the input, i.e. mixed list of characters and tags.

def InverseSelectByAttr(list of card numbers, attr, search)
Category: General client functions
File: client.functions
Return the list of card numbers which do not have an attribute attr which contains search string.

def IsAway()
Category: General client functions
File: client.functions
Return 1 if away, 0 if not away or NULL if never set before.

def IsStayTapped(object)
Category: General client functions
File: client.functions
Return 1 if object has stay-tapped flag set.

def IsUserDisplay()
Category: General client functions
File: client.functions
Return 1 if the current display is an user defined display.

def IsVeryNear(pos, list of positions)
Category: General client functions
File: client.functions
Return index if pos is near some point in the list or NULL if it is not near any point.

def IsVolatile(list of expressions)
Category: General client functions
File: client.functions
Check the filtering expression and return 1 if it is volatile, i.e. the indexing should be recalculated on every use.

def is_object(object number)
Category: General client functions
File: client.functions
Return 1 if the object exists.

def JoinTable(player number, table number)
Category: General client functions
File: client.functions
Add player to the table.

def JudgeChatCommandTime(minutes, event)
Category: General client functions
File: client.functions
Add timer calling the event after specified time in minutes.

def KeyAltKey1()
Category: General client functions
File: client.functions
Select counter color "red".

def KeyAltKey2()
Category: General client functions
File: client.functions
Select counter color "green".

def KeyAltKey3()
Category: General client functions
File: client.functions
Select counter color "blue".

def KeyAltKey4()
Category: General client functions
File: client.functions
Select counter color "orange".

def KeyAltKey5()
Category: General client functions
File: client.functions
Select counter color "yellow".

def KeyAltKey6()
Category: General client functions
File: client.functions
Select counter color "black".

def KeyBackspace()
Category: General client functions
File: client.functions
Handler for key Backspace.

def KeyControlKeyB()
Category: General client functions
File: client.functions
Handler for key Control+B.

def KeyControlKeyC()
Category: General client functions
File: client.functions
Handler for key Control+C.

def KeyControlKeyH()
Category: General client functions
File: client.functions
Handler for key Control+H.

def KeyControlKeyP()
Category: General client functions
File: client.functions
Handler for key Control+P.

def KeyControlKeyPageDown()
Category: General client functions
File: client.functions
Handler for key Control PageDown.

def KeyControlKeyPageUp()
Category: General client functions
File: client.functions
Handler for key Control PageUp.

def KeyControlKeyR()
Category: General client functions
File: client.functions
Handler for key Control+R.

def KeyControlKeyReturn()
Category: General client functions
File: client.functions
Handler for key Control+Return.

def KeyDelete()
Category: General client functions
File: client.functions
Handler for key Delete.

def KeyDown()
Category: General client functions
File: client.functions
Handler for key Down.

def KeyEnd()
Category: General client functions
File: client.functions
Handler for key End.

def KeyEnter()
Category: General client functions
File: client.functions
Handler for key Enter.

def KeyEscape()
Category: General client functions
File: client.functions
Handler for key Escape.

def KeyF10()
Category: General client functions
File: client.functions
Handler for key F10.

def KeyF11()
Category: General client functions
File: client.functions
Handler for key F11.

def KeyF12()
Category: General client functions
File: client.functions
Handler for key F12.

def KeyF1()
Category: General client functions
File: client.functions
Handler for key F1.

def KeyHome()
Category: General client functions
File: client.functions
Handler for key Home.

def KeyLeft()
Category: General client functions
File: client.functions
Handler for key Left.

def KeyModifierDown(mod)
Category: General client functions
File: client.functions
Called when "shift", "control" or "alt" is pressed down.

def KeyModifierUp(mod)
Category: General client functions
File: client.functions
Called when "shift", "control" or "alt" is released.

def KeyPageDown()
Category: General client functions
File: client.functions
Handler for key PageDown.

def KeyPageUp()
Category: General client functions
File: client.functions
Handler for key PageUp.

def KeyReturn()
Category: General client functions
File: client.functions
Handler for key Return.

def KeyRight()
Category: General client functions
File: client.functions
Handler for key Right.

def KeyTab()
Category: General client functions
File: client.functions
Handler for key Tab.

def KeyUp()
Category: General client functions
File: client.functions
Handler for key Up.

def LeaveChatMode()
Category: General client functions
File: client.functions
Cleaning operations when leaving chat mode.

def LeavePlayMode()
Category: General client functions
File: client.functions
Cleaning operations when leaving play mode.

def LeaveTable(player number, table number)
Category: General client functions
File: client.functions
Delete player from the table.

def LeaveWatchMode()
Category: General client functions
File: client.functions
Cleaning operations when leaving watch mode.

def LineSplitFirstSpace(text line)
Category: General client functions
File: client.functions
Split a line to two from the first space occurring in the text line. Return the original line if none.

def LoadAllRules()
Category: General client functions
File: client.functions
Search all rules for this game and append them to 'deckrules' variable.

def LoadAllScripts()
Category: General client functions
File: client.functions
Search all game specific extension scripts and execute all command-scripts.

def LoadAvatar(name)
Category: General client functions
File: client.functions
Load avatar if not loaded.

def LoadBookState()
Category: General client functions
File: client.functions
Restore the state of the collection from the disk. Return 1 if found, NULL otherwise.

def LoadMenu(script file)
Category: General client functions
File: client.functions
Append menus found from the script file to the menu.

def LocationList(group index, card index, ((x1, y1), (x2, y2), ...))
Category: General client functions
File: client.functions
Predefined positions.

def Lower(object number)
Category: General client functions
File: client.functions
Lower an object.

def LowerAttachments(object number, xoffset, yoffset, xsuboffset, ysuboffset, index)
Category: General client functions
File: client.functions
Scan through attachments of object starting from index and lower each attachment found.

def MainLoop()
Category: General client functions
File: client.functions
Main loop called frequently.

def MakeLegalityCheck(ruleset)
Category: General client functions
File: client.functions
Perform client-side legality check for the current deck.

def ManualTarget(object number, targeting rule)
Category: General client functions
File: client.functions
Apply targeting manually.

def Menu(name, entries)
Category: General client functions
File: client.functions
Delete old menu and create new one. Entries are given as triplets (menu text, short cut, code). Either 'code' is executed or appropriate command (if shortcut starts with /) or keyhandler is called.

def MenuByContext()
Category: General client functions
File: client.functions
Deside which menu to show according to GUI variables.

def MenuClick()
Category: General client functions
File: client.functions
Handle menu event.

def MergeDeck(deck name)
Category: General client functions
File: client.functions
Add content of the another deck to the current deck.

def MergeDeckSubmenu()
Category: General client functions
File: client.functions
Show merge deck options.

def Message(s)
Category: General client functions
File: client.functions
Print a string s as a message.

def Mode()
Category: General client functions
File: client.functions
Return current client mode ("sealed",etc.) or "" if none.

def MouseControlLeftClick()
Category: General client functions
File: client.functions
Handle control+left click event.

def MouseControlLeftDragBegin()
Category: General client functions
File: client.functions
The beginning of mouse dragging using ctrl+left button.

def MouseControlLeftDragEnd()
Category: General client functions
File: client.functions
The end of mouse dragging using ctrl+left button.

def MouseControlMiddleClick()
Category: General client functions
File: client.functions
Handle control+middle click event.

def MouseLeftClick()
Category: General client functions
File: client.functions
Handle left click event.

def MouseLeftClickActiveSet()
Category: General client functions
File: client.functions
Handler for mouse left clicking on active set.

def MouseLeftClickCard()
Category: General client functions
File: client.functions
Handler for mouse left clicking a card.

def MouseLeftClickCardSelectBox()
Category: General client functions
File: client.functions
Apply the selector expression to the selected card.

def MouseLeftClickCurrentDeck()
Category: General client functions
File: client.functions
Handler for mouse left click on the current deck editor.

def MouseLeftClickDeck()
Category: General client functions
File: client.functions
Handler for mouse left clicking on deck.

def MouseLeftClickDeckSearchBox()
Category: General client functions
File: client.functions
Handler for mouse left clicking on deck search box.

def MouseLeftClickHand()
Category: General client functions
File: client.functions
Handler for mouse left clicking on hand.

def MouseLeftClickMyCollection()
Category: General client functions
File: client.functions
Handler for mouse left click on my collection.

def MouseLeftClickOpenBooster()
Category: General client functions
File: client.functions
Handler for mouse left click on opened booster.

def MouseLeftClickOpponentHand()
Category: General client functions
File: client.functions
Handler for mouse left clicking on opponent's hand.

def MouseLeftClickTable()
Category: General client functions
File: client.functions
Handler for mouse left click on table.

def MouseLeftDragBegin()
Category: General client functions
File: client.functions
The beginning of mouse dragging using left button.

def MouseLeftDragEnd()
Category: General client functions
File: client.functions
The end of mouse dragging using left button.

def MouseMiddleClick()
Category: General client functions
File: client.functions
Handle middle click event.

def MouseMiddleClickCard()
Category: General client functions
File: client.functions
Handler for mouse middle clicking a card.

def MouseMiddleClickCurrentDeck()
Category: General client functions
File: client.functions
Handler for mouse middle click on the current deck editor.

def MouseMiddleClickDeckSearchBox()
Category: General client functions
File: client.functions
Handler for mouse middle clicking on deck search box.

def MouseMiddleClickMyCollection()
Category: General client functions
File: client.functions
Handler for mouse middle click on my collection.

def MouseMiddleClickOpenBooster()
Category: General client functions
File: client.functions
Handler for mouse middle click opened booster.

def MouseMiddleClickTable()
Category: General client functions
File: client.functions
Handler for mouse middle click on table.

def MouseMiddleDragBegin()
Category: General client functions
File: client.functions
The beginning of mouse dragging using middle button.

def MouseMiddleDragEnd()
Category: General client functions
File: client.functions
The end of mouse dragging using middle button.

def MouseMoveObject()
Category: General client functions
File: client.functions
Handler for moving objects using mouse.

def MouseWheel(dir)
Category: General client functions
File: client.functions
Mouse wheel rolled (dir=0 up, dir=1 down).

def MouseWheelChatMsg(dir)
Category: General client functions
File: client.functions
Mouse wheel handler for additional chat box.

def MouseWheelCurrentDeck(dir)
Category: General client functions
File: client.functions
Mouse wheel handler for deck editor (dir=0 up, dir=1 down).

def MouseWheelMenu(dir)
Category: General client functions
File: client.functions
Mouse wheel handler for menu (dir=0 up, dir=1 down).

def MouseWheelMyCollection(dir)
Category: General client functions
File: client.functions
Mouse wheel handler for collection (dir=0 up, dir=1 down).

def MoveAvatar(player number, table or -1)
Category: General client functions
File: client.functions
Move avatar.

def MoveObject(n, x, y)
Category: General client functions
File: client.functions
Move object number 'n' to (x,y).

def MovePanel(name, x, y)
Category: General client functions
File: client.functions
Move panel to the specified position.

def Msg(s)
Category: General client functions
File: client.functions
Print message without time stamp.

def MsgChat(s)
Category: General client functions
File: client.functions
Print message without time stamp in watch mode chat box.

def MyCollectionMenu()
Category: General client functions
File: client.functions
Generate menu for card book.

def MyDeck(deck name)
Category: General client functions
File: client.functions
Return object number of the deck.

def NextFreeAttachPos(object number, xoffset, yoffset, xsuboffset, ysuboffset)
Category: General client functions
File: client.functions
Find next free position among attachments having given offsets.

def NextTarget()
Category: General client functions
File: client.functions
Return next target in the targeting queue and remove it from the queue. Return value is a list (object number, card number, xoffset, yoffset, xsuboffset,ysuboffset, options) or NULL if no targets found.

def None()
Category: General client functions
File: client.functions
Empty function returning it's arguments.

def Null()
Category: General client functions
File: client.functions
Null command for TCP/IP keepalive.

def ObjectAt(x, y)
Category: General client functions
File: client.functions
Return an object number whose center point is at (x,y) or NULL if none.

def ObjH(object number)
Category: General client functions
File: client.functions
Return the height of the object.

def ObjW(object number)
Category: General client functions
File: client.functions
Return the width of the object.

def OpenBoosterMenu()
Category: General client functions
File: client.functions
Menu for just opened booster.

def OpponentActiveSetMenu()
Category: General client functions
File: client.functions
Create a menu for opponent's cards set aside.

def OpponentDeckMenu()
Category: General client functions
File: client.functions
Create menu for opponent's deck.

def OpponentDiscardPileMenu()
Category: General client functions
File: client.functions
Create menu for opponent's discard pile.

def OpponentHandMenu()
Category: General client functions
File: client.functions
Create a menu for your opponent's hand.

def OtherDeckFormats()
Category: General client functions
File: client.functions
Return the list of game specific deck format codes.

def Owner(object number)
Category: General client functions
File: client.functions
return player number of the owner of the object.

def PanelVisible(name)
Category: General client functions
File: client.functions
Return 1 if the panel is visible.

def ParentObject(object number)
Category: General client functions
File: client.functions
Return an object where the given object is attached to or NULL if none.

def Play(card number, face down?)
Category: General client functions
File: client.functions
call appropriate functions to play a card.

def PlayCard(card number, upside down?)
Category: General client functions
File: client.functions
Default handler for playing card on table.

def PlayCommandDraw(options)
Category: General client functions
File: client.functions
Implementation of /draw command.

def PlayCommandInplay()
Category: General client functions
File: client.functions
Implementation of /inplay command in play mode.

def PlayCommandLegal()
Category: General client functions
File: client.functions
Implementation of /legal command.

def PlayCommandLose()
Category: General client functions
File: client.functions
Implementation of /lose command (not yet implemented).

def PlayCommandOk()
Category: General client functions
File: client.functions
Implementation of /ok command.

def PlayCommandUndecided(options)
Category: General client functions
File: client.functions
Implementation of /undecided command.

def PlayCommandWin(options)
Category: General client functions
File: client.functions
Implementation of /win command.

def PlayerName(player number)
Category: General client functions
File: client.functions
Convert chat room player number to name.

def PlayKeyControlKeyA()
Category: General client functions
File: client.functions
Handler for key Control+A in play mode.

def PlayKeyControlKeyD()
Category: General client functions
File: client.functions
Handler for key Control+D in play mode.

def PlayKeyControlKeyDelete()
Category: General client functions
File: client.functions
Handler for key Control+Delete in play mode.

def PlayKeyControlKeyE()
Category: General client functions
File: client.functions
Handler for key Control+E in play mode.

def PlayKeyControlKeyF()
Category: General client functions
File: client.functions
Handler for key Control+F in play mode.

def PlayKeyControlKeyHome()
Category: General client functions
File: client.functions
Handler for key Control+Home in play mode.

def PlayKeyControlKeyL()
Category: General client functions
File: client.functions
Handler for key Control+L in play mode.

def PlayKeyControlKeyP()
Category: General client functions
File: client.functions
Handler for key Control+P in play mode.

def PlayKeyControlKeyS()
Category: General client functions
File: client.functions
Handler for key Control+S in play mode.

def PlayKeyControlKeyT()
Category: General client functions
File: client.functions
Handler for key Control+T in play mode.

def PlayKeyControlKeyU()
Category: General client functions
File: client.functions
Handler for key Control+U in play mode.

def PlayKeyDelete()
Category: General client functions
File: client.functions
Handler for key Delete in play mode.

def PlayKeyEnd()
Category: General client functions
File: client.functions
Handler for key End in play mode.

def PlayKeyHome()
Category: General client functions
File: client.functions
Handler for key Home in play mode.

def PlayKeyInsert()
Category: General client functions
File: client.functions
Handler for key Insert in play mode.

def Positions(object numbers)
Category: General client functions
File: client.functions
Return list of coordinates having center points of objects.

def PressKey(key code, key ascii)
Category: General client functions
File: client.functions
Handle keypress, return 0 if not undefined key.

def PriceDelta(prc)
Category: General client functions
File: client.functions
Search for suitable price increase/decrease step according to the current price prc.

def ProductLookup(name)
Category: General client functions
File: client.functions
Search for a product name defined by user supplied string.

def PutActive(player number, card)
Category: General client functions
File: client.functions
Put a card to the players active set.

def PutCardInGroup(card number, object number, x, y)
Category: General client functions
File: client.functions
Update 'card.group' table replacing "reserved" entry with this card. This hook is called when a card is put to the table. If no "reserved" entry is found, reserve new enrty.

def PutDeck(object number, card number(s), [real cards])
Category: General client functions
File: client.functions
Put one or more cards to the top of the deck.

def PutDeckBottom(object number, card number(s), [real cards])
Category: General client functions
File: client.functions
Put card(s) to the bottom of the deck.

def PutHand(player number, card)
Category: General client functions
File: client.functions
Put a card to the players hand.

def PutTable(object number, x, y, orientation, card number, player, real card number)
Category: General client functions
File: client.functions
Put a card owned by player using object number to the table centered at (x,y) using the given orientation. Real card number can be different than card number, if card is placed face down.

def Quit()
Category: General client functions
File: client.functions
Called when metaserver closes connection.

def Raise(object number)
Category: General client functions
File: client.functions
Raise an object.

def RandomNearPoint(group index, card index, x, y)
Category: General client functions
File: client.functions
Return random point near (x,y).

def Receive(e, d)
Category: General client functions
File: client.functions
Network event ('e','d') received.

def RecognizeCard(name)
Category: General client functions
File: client.functions
Try to convert a name to card number applying images() and fuzzyimages(). Return NULL if unknown.

def RecognizeDeckFormat(file content)
Category: General client functions
File: client.functions
Return format code for the deck or NULL if not recognized.

def RefineFilter(single filter expression)
Category: General client functions
File: client.functions
Add expression to the current filter and update the collection to show refined filtering.

def RefreshBook(list of cards)
Category: General client functions
File: client.functions
Ask for refresh for cards if not yet asked.

def RefreshBookForDeck(deck name)
Category: General client functions
File: client.functions
Refresh all cards in deck.

def RefreshCurrentDeck()
Category: General client functions
File: client.functions
Update collection and current deck if selected.

def RegisterSubmenu()
Category: General client functions
File: client.functions
Set registration menu.

def RemoveAvatar(player name)
Category: General client functions
File: client.functions
Delete avatar from screen.

def ReplaceTable(object, card)
Category: General client functions
File: client.functions
Replace card on table with new card image.

def RestoreDeck(deck name or id, deck content)
Category: General client functions
File: client.functions
Retrieve the registered deck.

def RestoreMenuContext()
Category: General client functions
File: client.functions
Restore saved GUI object variables.

def root_object(object number)
Category: General client functions
File: client.functions
Return the root object of the object.

def Rotate(object number, orientation degrees)
Category: General client functions
File: client.functions
Rotate an object.

def RuleOptions(category)
Category: General client functions
File: client.functions
Return options for the rule matching category.

def SaveAll()
Category: General client functions
File: client.functions
Save all user variables.

def SaveBookState()
Category: General client functions
File: client.functions
Store the state of the collection to the disk.

def SaveMenuContext()
Category: General client functions
File: client.functions
Save GUI object variables.

def Say(message)
Category: General client functions
File: client.functions
Say given message.

def Score(player, score structure)
Category: General client functions
File: client.functions
Set the current score for player.

def ScoreToText(score structure)
Category: General client functions
File: client.functions
Convert a score structure to string.

def ScrollHistory(dir)
Category: General client functions
File: client.functions
Scroll the input history down if dir is 1 or up if -1. Return value of the history line at the new position.

def SearchDeck(L)
Category: General client functions
File: client.functions
Set search box content to 'L'.

def SectionSubmenu()
Category: General client functions
File: client.functions
Display page title choices.

def SelectByAttr(list of card numbers, attr, search)
Category: General client functions
File: client.functions
Return the list of card numbers which have an attribute attr and it contains search string.

def SelectCard(list of cards, expression, card source)
Category: General client functions
File: client.functions
Select a card and evaluate expression denoting the selected card with #. If card source is not null, the selected card can be transferred with shortcut keys.

def SelectDeck(deck name)
Category: General client functions
File: client.functions
Called when player selects his deck.

def SelectDeckPart(part)
Category: General client functions
File: client.functions
Select default editing section.

def SelectMenuChooseADeck()
Category: General client functions
File: client.functions
Handler for selection from deck menu.

def Send(event)
Category: General client functions
File: client.functions
Send network protocol message to the server.

def SendMeta(event)
Category: General client functions
File: client.functions
Send network protocol message to the meta server.

def SetActive(player number, card list)
Category: General client functions
File: client.functions
Set content of the active set.

def SetAvatar(player number, player name, avatar name, table or -1)
Category: General client functions
File: client.functions
Create avatar (if needed) and locate it to the table or floor.

def SetAwayOff()
Category: General client functions
File: client.functions
Turn away status off.

def SetAwayOn(message)
Category: General client functions
File: client.functions
Turn away status on.

def SetBookIndex(filter, sorting)
Category: General client functions
File: client.functions
Set current filter and sorting for the card book. If the (filter,sorting) pair does not yet exist, create it first. If the filtering expression is volatile, don't save index.

def SetBookPage(page)
Category: General client functions
File: client.functions
Select the page for your collection.

def SetCardbook(entries)
Category: General client functions
File: client.functions
Update entries (# of cards,for sale,my price) at my card book.

def SetDeck(object number, card list, [identity of cards])
Category: General client functions
File: client.functions
Set deck content.

def SetHand(player number, card list)
Category: General client functions
File: client.functions
Set hand content.

def SetHandSize(size percentage)
Category: General client functions
File: client.functions
Set hand size with respect to the default size.

def SetJoinGame(player, table, 0 or 1)
Category: General client functions
File: client.functions
Player joins (1) or leaves (0) the game at table.

def SetMe(number)
Category: General client functions
File: client.functions
Set my player number.

def SetMode(mode)
Category: General client functions
File: client.functions
Change current client mode "menu","chat","play" or "watch".

def SetMoney(amount)
Category: General client functions
File: client.functions
Set current amount of money.

def SetMyName(name)
Category: General client functions
File: client.functions
Set my name.

def SetOption(option, value)
Category: General client functions
File: client.functions
Set option during a game.

def SetPassword(user, password)
Category: General client functions
File: client.functions
Set and save password for user.

def SetPrice(card number, (seller, price))
Category: General client functions
File: client.functions
Set price data for a card in card book.

def SetProducts(product list)
Category: General client functions
File: client.functions
Set content of product list.

def SetScore(player, value)
Category: General client functions
File: client.functions
Set value of player's score counter.

def SetStayTapped()
Category: General client functions
File: client.functions
Set stay-tapped flag for card under the mouse.

def ShowHelp()
Category: General client functions
File: client.functions
Show help text.

def ShowPanel(name, [state])
Category: General client functions
File: client.functions
Turn the panel visible or hide it if state is given and zero or NULL.

def ShowPlaymat()
Category: General client functions
File: client.functions
Load play mode background and turn playmat visible.

def ShowScreen(name)
Category: General client functions
File: client.functions
Hide previous screen (if any) and display the given screen.

def SingleCardMenu(context)
Category: General client functions
File: client.functions
Return menu items for single card.

def SlashCommand(string)
Category: General client functions
File: client.functions
Analyze and execute chat /-command.

def SlashComments(text line)
Category: General client functions
File: client.functions
Return empty string when the text line begins with //. Otherwise the line itself.

def Special(function, args)
Category: General client functions
File: client.functions
Handle game specific special commands.

def SplitToWords(string)
Category: General client functions
File: client.functions
Split an input string to the pieces. Each member of the return list is either a single letter or a tag.

def StacksByGroup(group index, card index, x, y, xoffset, yoffset, stack x-step, stack y-step)
Category: General client functions
File: client.functions
Each group forms own vertical stack.

def StartChatMode()
Category: General client functions
File: client.functions
Initialization of the chat mode.

def StartPlayMode()
Category: General client functions
File: client.functions
Initialization of the play mode.

def StartWatchMode()
Category: General client functions
File: client.functions
Initialization of the watch mode.

def str2filter_atom(string)
Category: General client functions
File: client.functions
Helper function for String2Filter(). Parse atomic expression and return a pair (e,t), where e is the expression corresponding the atom, t is a presenting type the type of expression "i"/"r"/"s" (integer,real,string).

def str2filter_exp(string)
Category: General client functions
File: client.functions
Helper function for String2Filter(). Parse logical expression.

def str2filter_join((e1, e2), operator)
Category: General client functions
File: client.functions
Join one or two triplets together by adding operator string between them. If two triplets are given, they are assumed to have the same type.

def str2filter_rel(string)
Category: General client functions
File: client.functions
Helper function for String2Filter(). Parse comparison relation.

def str2filter_split(string, split string, function)
Category: General client functions
File: client.functions
Helper function for String2Filter(). Try to split a string from every possible index containing a split string. Call a function for each splitted part and return a list containing two return values of the successful call. Return NULL if the string cannot be splitted legally from any position. (See str2filteratom for more info about return values).

def str2filter_sum(string)
Category: General client functions
File: client.functions
Helper function for String2Filter(). Parse sum expression.

def str2filter_term(string)
Category: General client functions
File: client.functions
Helper function for String2Filter(). Parse multiplication expression.

def str2filter_typeconvert(e1, e2)
Category: General client functions
File: client.functions
Helper function for String2Filter(). Check compatibility of types for triplets e1 and e2 (See str2filteratom for info about triplets). If incompatible, add proper type conversion to the expression and change a type of the return value. If an argument e2 is not given, return arguments unmodified.

def str2filter_typetoint(e1, e2)
Category: General client functions
File: client.functions
Helper function for String2Filter(). Convert types to integer when needed.

def str2filter_typetostring(e1, e2)
Category: General client functions
File: client.functions
Helper function for String2Filter(). Convert types to string when needed.

def str2sorting(string)
Category: General client functions
File: client.functions
Helper function to String2Sorting().

def String2Filter(string)
Category: General client functions
File: client.functions
Convert a string to the filter expression or return NULL if invalid.

def String2Sorting(string)
Category: General client functions
File: client.functions
Convert a string to the sorting expression, or return NULL if invalid.

def Submenu(name, entries)
Category: General client functions
File: client.functions
Create submenu (same as Menu() right now).

def subobjects(object number)
Category: General client functions
File: client.functions
Return all direct subobjects of the object.

def Table()
Category: General client functions
File: client.functions
Return number of table where i am sitting or -1.

def TableCoord(table number)
Category: General client functions
File: client.functions
Convert table number to (x,y) pair describing position of the table.

def TableMenu()
Category: General client functions
File: client.functions
Menu for tables.

def TableNumber(object number)
Category: General client functions
File: client.functions
Convert object number to table number.

def TableObject(table number)
Category: General client functions
File: client.functions
Convert table number to object number presenting the table.

def TargetCard(group index, card index, xoffset, yoffset, xsuboffset, ysuboffset)
Category: General client functions
File: client.functions
Choose a target for card.

def TargetingOptions()
Category: General client functions
File: client.functions
Return the list of targetting (category,group) pairs defined for this game.

def Timer15Seconds()
Category: General client functions
File: client.functions
Timer which is called every 15 seconds. Unused.

def Timer5Seconds()
Category: General client functions
File: client.functions
Timer which is called every 5 seconds. Handle timerminute queue.

def Timer()
Category: General client functions
File: client.functions
Timer function to handle timer events in queue every second if the queue is not empty.

def TimerMinute()
Category: General client functions
File: client.functions
Timer which is called every minute. Send NULL to meta server.

def TogglePanel(name)
Category: General client functions
File: client.functions
Toggle visibility status of the panel.

def TrimSpaces(text line)
Category: General client functions
File: client.functions
Remove spaces from the beginning and the end of text line.

def TryTransferTo(e)
Category: General client functions
File: client.functions
Check the object under cursor and send transfer request to destination 'e' if the object was recognized.

def UnsetStayTapped()
Category: General client functions
File: client.functions
Clear stay-tapped flag for card under the mouse.

def UpdatePanel(panel)
Category: General client functions
File: client.functions
Refresh a content of the panel by calling appropriate function.

def UpdateProductsPanel()
Category: General client functions
File: client.functions
Refresh content of the product panel.

def WantList(user name, list of wanted cards)
Category: General client functions
File: client.functions
Receive want list from server.

def WatchActiveSetMenu()
Category: General client functions
File: client.functions
Nothing.

def WatchCardMenu()
Category: General client functions
File: client.functions
Create single card menu during watch mode.

def WatchCommandInplay()
Category: General client functions
File: client.functions
Implementation of /inplay command in watch mode.

def WatchCommandNewdeck(name, of, the, deck)
Category: General client functions
File: client.functions
Implementation of /newdeck command.

def WatchCommandRd()
Category: General client functions
File: client.functions
Implementation of /rd command in watch mode.

def WatchDeckMenu()
Category: General client functions
File: client.functions
Nothing.

def WatchDeckSearchBoxMenu()
Category: General client functions
File: client.functions
Create deck search box menu during watch mode.

def WatchDiscardPileMenu()
Category: General client functions
File: client.functions
Nothing.

def WatchHandMenu()
Category: General client functions
File: client.functions
Nothing.

def WatchKeyControlKeyD()
Category: General client functions
File: client.functions
Handler for key Control+D in watch mode.

def WatchKeyControlKeyE()
Category: General client functions
File: client.functions
Handler for key Control+E in watch mode.

def WatchKeyControlKeyI()
Category: General client functions
File: client.functions
Handler for key Control+I in watch mode.

def WatchKeyControlKeyS()
Category: General client functions
File: client.functions
Handler for key Control+S in chat mode.

def WatchKeyControlKeyW()
Category: General client functions
File: client.functions
Handler for key Control+W in watch mode.

def WatchKeyControlKeyX()
Category: General client functions
File: client.functions
Handler for key Control+X in watch mode.

def WatchOpponentDeckMenu()
Category: General client functions
File: client.functions
Create deck menu during watch mode.

def WatchOpponentDiscardPileMenu()
Category: General client functions
File: client.functions
Create opponent's discard pile menu during watch mode.

def WatchOpponentHandMenu()
Category: General client functions
File: client.functions
Nothing.

def _EndGame()
Category: General client functions
File: client.functions
Game over. Close connections.

def _InitializeGame()
Category: General client functions
File: client.functions
Initialize game variables.

def _StartGame()
Category: General client functions
File: client.functions
Initialize a game.

General factory server functions

def CardsOfSetWithRarity(card numbers, rarity)
Category: General factory server functions
File: factory-server.functions
Return weighted set of cards with given rarity.

def FixedSet(set, list of card names)
Category: General factory server functions
File: factory-server.functions
return fixed set of card numbers.

def Initialize()
Category: General factory server functions
File: factory-server.functions
Initialize all card distribution tables.

def InitTables(set abbrev)
Category: General factory server functions
File: factory-server.functions
Initialize card distribution tables for a set.

def Log(message)
Category: General factory server functions
File: factory-server.functions
Print a message with date and time.

def Produce(set, type)
Category: General factory server functions
File: factory-server.functions
Return "booster" or "starter" of set.

def RandomCardSet(set abbrev, distribution)
Category: General factory server functions
File: factory-server.functions
Return random sample of cards with given distribution.

General game server functions

def AcceptableResult(text)
Category: General game server functions
File: server.functions
return list of acceptable results.

def AcceptResult()
Category: General game server functions
File: server.functions
Give acceptance to the currently declared result.

def Action(s)
Category: General game server functions
File: server.functions
Player takes an action 's'.

def AddMarker(object number, marker type, [count])
Category: General game server functions
File: server.functions
Add or del marker(s) on object.

def AllDecksLoaded()
Category: General game server functions
File: server.functions
Return 1 if all players have uploaded their decks.

def AssignPlayer(player name, player number)
Category: General game server functions
File: server.functions
Reassign player with the name to the number. Player having the number before reassignment gets the current player number of the player to be assigned. Note: this function does not transfer cards, only connections and scores are remapped. So, this is identical to exchanging seats in the table, but not exchanging any cards.

def Attach(src object number, target object number)
Category: General game server functions
File: server.functions
Detach an object and attach it to the another target.

def AvatarPos(player number)
Category: General game server functions
File: server.functions
Return position of the avatar in server coordinates.

def Command(cmd string)
Category: General game server functions
File: server.functions
Handle special commands.

def CommandBid(bid)
Category: General game server functions
File: server.functions
Store arguments and display all bids if all players has placed their bids.

def CommandDelgame()
Category: General game server functions
File: server.functions
Delete saved game.

def CommandLoadgame()
Category: General game server functions
File: server.functions
Load saved game status.

def CommandReload()
Category: General game server functions
File: server.functions
Reload function definions.

def CommandRtfm()
Category: General game server functions
File: server.functions
Show some extra help.

def CommandSavegame()
Category: General game server functions
File: server.functions
Save current game status.

def Con2Plr(connection)
Category: General game server functions
File: server.functions
Convert client connection number to player number. Return NULL if no such connection.

def CoordToPlr(x, y, p)
Category: General game server functions
File: server.functions
Convert server coordinates (x,y) to player coordinates for player or watcher p.

def CoordToSvr(x, y, p)
Category: General game server functions
File: server.functions
Convert player coordinates (x,y) for player 'p' to server coordinates.

def CreateDeck(owner, name, x, y)
Category: General game server functions
File: server.functions
Create new deck to the game.

def CreatePlayerObjects(player)
Category: General game server functions
File: server.functions
Create GUI objects for decks, hands, etc. related to the player by sending appropriate creation commands to all.

def DeckName(object number)
Category: General game server functions
File: server.functions
Return human readable version of a deck.

def DeclareResult(win|lose|draw|undecided, optional sub type)
Category: General game server functions
File: server.functions
Declare the result of the game.

def DelMarker(object number, marker type, [count])
Category: General game server functions
File: server.functions
Delete marker(s) from an object.

def Detach(object number)
Category: General game server functions
File: server.functions
Detach an object if attached.

def EndGame()
Category: General game server functions
File: server.functions
Close the current game.

def Flip(object number)
Category: General game server functions
File: server.functions
Reval or hide object.

def Group(object number)
Category: General game server functions
File: server.functions
Return list of all cards attached recursively including card itself in table stacking order.

def HandleMetaServer(event)
Category: General game server functions
File: server.functions
Handle meta server instruction.

def HandPos(player number)
Category: General game server functions
File: server.functions
Return position of the hand cards in server coordinates.

def Image(card number, visibility)
Category: General game server functions
File: server.functions
Return card number or it's background if not visible.

def InitializeWatcher(player number)
Category: General game server functions
File: server.functions
Initialize structures and send current game status to watcher.

def InitServer(nmb.of players)
Category: General game server functions
File: server.functions
Initialize server structures.

def IsLoop(src object number, target object number)
Category: General game server functions
File: server.functions
Return 1 if attachment would cause a loop.

def IsObject(num)
Category: General game server functions
File: server.functions
Check if num is legal object number.

def LegalityCheck()
Category: General game server functions
File: server.functions
Make lagality check for the current player's deck.

def Log(s)
Category: General game server functions
File: server.functions
Write string 's' to the log.

def Lower(object number)
Category: General game server functions
File: server.functions
Lower an object.

def MakeLegalityCheck(deck, verbose report)
Category: General game server functions
File: server.functions
Perform legality check for the deck. Return list of legal game formats.

def MapCon2Plr(connection, player)
Category: General game server functions
File: server.functions
Set mapping between connection number and player number.

def MoveObject(n, x, y)
Category: General game server functions
File: server.functions
Move object to new place on table. (x,y) given in current player's coordinates.

def MsgCards(list of cards, visibile?, options)
Category: General game server functions
File: server.functions
Convert a card list to text.

def MsgOrdinal(order number, total, item, container)
Category: General game server functions
File: server.functions
Return container with item name and order number if given (>= 0).

def MsgTransfer(src, cards to self, cards to others, dst, nmb. of cards, options)
Category: General game server functions
File: server.functions
Send transfer message.

def MsgVerbObject(verb, obj.num or (obj.num, index) or text, [notes])
Category: General game server functions
File: server.functions
Tell all that current player acts 'verb' with 'object'. Optional argument notes is added to the end of the message.

def MsgVerbObjectObject(verb, object number, preposition, object number, [notes])
Category: General game server functions
File: server.functions
Tell all that current player acts 'verb' with 'object' prep 'object'. Optional argument notes is added to the end of the message.

def Null()
Category: General game server functions
File: server.functions
Handler for client Null message. Check the inactivity of other clients.

def Number(player name)
Category: General game server functions
File: server.functions
Return player or watcher number or NULL if none.

def ObjectName(to whom, object number or string)
Category: General game server functions
File: server.functions
Calculate name for the object as text as seen by players.

def OriToPlr(o, p)
Category: General game server functions
File: server.functions
Convert server orientation 'o' to player orientation for player or watcher 'p'.

def OriToSvr(o, p)
Category: General game server functions
File: server.functions
Convert player orientation 'o' for player 'p' to server orientation.

def Owner(object number)
Category: General game server functions
File: server.functions
Return player number owning the object.

def Play.Card.Stage1(card number, vis.self, vis.opp, face down?)
Category: General game server functions
File: server.functions
First stage of the playing a card, i.e. after announcement the card is moved from the source to the play.stack.

def Play.Card.Stage2(vis.self, vis.opp, card number, face down?)
Category: General game server functions
File: server.functions
Second stage of the playing a card, i.e remove the card from play.stack.

def PlayerNumber(player name)
Category: General game server functions
File: server.functions
Convert a player name to it's player number or -1 if not playing.

def PlayerOrder()
Category: General game server functions
File: server.functions
Return list of player names in current player order.

def Plr2Con(connection)
Category: General game server functions
File: server.functions
Convert player number to client connection number. Returns NULL if no such player.

def Put.Active(card number, vis.self, vis.opp, player)
Category: General game server functions
File: server.functions
Put a card to active set.

def Put.DeckBottom(card number, vis.self, vis.opp, deck object number)
Category: General game server functions
File: server.functions
Put a card to bottom of the deck.

def Put.DeckTop(card number, vis.self, vis.opp, deck object number)
Category: General game server functions
File: server.functions
Put a card to top of the deck.

def Put.Hand(card number, vis.self, vis.opp, owner of hand)
Category: General game server functions
File: server.functions
Put a card to the hand.

def Put.OutOfPlay(card number, vis.self, vis.opp)
Category: General game server functions
File: server.functions
Put a card to the out of play.

def Put.Table(card number, vis.self, vis.opp, x, y, orientation, face down?)
Category: General game server functions
File: server.functions
Put a card to the table.

def Raise(object number)
Category: General game server functions
File: server.functions
Raise an object.

def ReceiveClose(connection number)
Category: General game server functions
File: server.functions
Handle network event "close".

def ReceiveData(e, d)
Category: General game server functions
File: server.functions
Called when network event (e,d) was received.

def ReceiveOpen(connection number)
Category: General game server functions
File: server.functions
Handle network event "open".

def RegisterPlayer(user, version, number of known cards, game name, cookie)
Category: General game server functions
File: server.functions
Check registration information and and initialize player/watcher. Return 1 if registration is successful.

def Reply(m)
Category: General game server functions
File: server.functions
Send message 'm' to current connection.

def ResultAccepted()
Category: General game server functions
File: server.functions
Return 1 if all players has been accepted the game result or disconnected.

def Reveal(object number, card index to reveal)
Category: General game server functions
File: server.functions
Reveal one of the cards.

def Roll(d)
Category: General game server functions
File: server.functions
Roll dice 'd' which is a string i.e. "2d6".

def RootObject(object number)
Category: General game server functions
File: server.functions
Return root object of the group where an object belongs.

def Rotate(n, d)
Category: General game server functions
File: server.functions
Rotate object number 'n' on table to have rotation angle 'd' degrees clockwise.

def SaveFilename()
Category: General game server functions
File: server.functions
Generate filename for save game.

def Say(s)
Category: General game server functions
File: server.functions
Player says 's'.

def Score(player, score)
Category: General game server functions
File: server.functions
Set score for a player.

def SearchDeck(object number)
Category: General game server functions
File: server.functions
Player looks for deck.

def Send(player, command)
Category: General game server functions
File: server.functions
Send a command to client if still online.

def SendAll(command)
Category: General game server functions
File: server.functions
Send command to all.

def SendFullGameStatus(player)
Category: General game server functions
File: server.functions
Send full update of the game status to the player or watcher.

def SendOther(player, command)
Category: General game server functions
File: server.functions
Send command to all players except player 'p'.

def ShuffleDeck(object number)
Category: General game server functions
File: server.functions
Shuffle deck or hand.

def Special(data...)
Category: General game server functions
File: server.functions
Send special event to all clients.

def StartGame()
Category: General game server functions
File: server.functions
Initialize structures and send all initialization commands to clients.

def SubjectName(p)
Category: General game server functions
File: server.functions
Return player name or "You" if 'p' is current player.

def Take.Active(vis.self, vis.opp, player, card index)
Category: General game server functions
File: server.functions
Take a card from active set.

def Take.Deck(vis.self, vis.opp, object number, deck card index)
Category: General game server functions
File: server.functions
Take a card from any position from the deck.

def Take.DeckTop(vis.self, vis.opp, object number)
Category: General game server functions
File: server.functions
Take a card from the top of the deck.

def Take.Hand(vis.self, vis.opp, owner of hand, hand card index)
Category: General game server functions
File: server.functions
Take a card from the hand.

def Take.OutOfPlay(vis.self, vis.opp, card number)
Category: General game server functions
File: server.functions
Take a card from out of play.

def Take.SearchDeck(vis.self, vis.opp, object number, card number(s), iteration)
Category: General game server functions
File: server.functions
Search a card from the deck.

def Take.Table(vis.self, vis.opp, object number)
Category: General game server functions
File: server.functions
Take a card from table.

def TargetName(to whom, number of cards in transfer, target type, target parameters)
Category: General game server functions
File: server.functions
Convert target to text. Traget parameters are the same as in TransferFunction source and destination.

def Touch(object number, index)
Category: General game server functions
File: server.functions
Send message to all, that current player touches 't'.

def Transfer(number of cards, source, destination, options)
Category: General game server functions
File: server.functions
Generic card transfer. Source location is one of the following: - ("active",player number,card index) - from cards set aside - ("deck",deck object number,card index) - from a card pile - ("deck.top",deck object number) - from top of a card pile - ("deck.search",deck object number,card number) - search a card from a pile - ("hand",player number,card index) - players hand - ("out.of.play",card number) - generate a card - ("play",card number,face down?) - finish the playing of a card by placing it to destination - ("table",card object number) - from table Destination locations is one of the following: - ("active",player number) - set aside - ("deck.bottom",deck object number) - to the bottom of a card pile - ("deck.top",deck object number) - to the top of a card pile - ("hand",player number) - to hand - ("out.of.play",) - remove from play - ("play",face down?) - play a card by taking it from source - ("table",x,y,orientation,face down?) - put to the table Option is a dictionary containing possible following entries: - reveal - attribute of a cards to reveal if otherwise unknown. - shuffle - if, "yes" shuffle transferred cards.

def UploadDeck(dictionary of deck parts)
Category: General game server functions
File: server.functions
Player uploads his decks. Check legality.

def Verb(to whom, verb)
Category: General game server functions
File: server.functions
Return a verb in correct form.

def WaitMetaEvents(end)
Category: General game server functions
File: server.functions
Wait and handle events from the meta server until receiving 'end' event.

def WatcherSay(s)
Category: General game server functions
File: server.functions
Watcher says 's'.

General meta server functions

def Action(s)
Category: General meta server functions
File: meta-server.functions
Player takes an action 's'.

def AddCard(player name, card number)
Category: General meta server functions
File: meta-server.functions
Add a card to player's collection.

def AddCards(player name, card number, count)
Category: General meta server functions
File: meta-server.functions
Add cards to player's collection.

def AddGameResult(nmb.players, player, result)
Category: General meta server functions
File: meta-server.functions
Add one game result to the given player.

def AddTickets(user name, product name, count)
Category: General meta server functions
File: meta-server.functions
Add or del product tickets. If count is negative, return number of tickets deleted.

def AvailableForSale(user name, card number, amount)
Category: General meta server functions
File: meta-server.functions
Return 1 if a player can sell cards (i.e. not registered).

def AvailableForTrade(user name, card number)
Category: General meta server functions
File: meta-server.functions
Return 1 if a player can give the card away (i.e. not registered).

def Buy(amount, product name)
Category: General meta server functions
File: meta-server.functions
Client buys a product.

def BuyCard(card number, [price])
Category: General meta server functions
File: meta-server.functions
Client buys a card.

def CheckPrice(player name, card number)
Category: General meta server functions
File: meta-server.functions
Check if card is not for sale any more and remove price entry if not.

def CheckSealedCharacter(mode name)
Category: General meta server functions
File: meta-server.functions
Check existence of sealed character and create if necessary.

def Command(string)
Category: General meta server functions
File: meta-server.functions
Handle special commands.

def CommandAddproduct()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /addproduct.

def CommandBan()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /ban.

def CommandBans()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /bans.

def CommandDebug()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /debug.

def CommandDelproduct()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /delproduct.

def CommandFaq()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /faq.

def CommandFaqclear()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /faqclear.

def CommandGiveticket()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /giveticket.

def CommandGrant()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /grant.

def CommandHave()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /have.

def CommandKick(user)
Category: General meta server functions
File: meta-server.functions
Implementation of the command /kick.

def CommandKicktable()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /kicktable.

def CommandPayall()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /payall.

def CommandProducts()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /products.

def CommandReboot()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /reboot.

def CommandRegister()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /register.

def CommandReload()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /reload.

def CommandRemoveuser()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /removeuser.

def CommandReproduce()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /reproduce.

def CommandRestrict()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /restrict.

def CommandRo()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /ro.

def CommandRtfm()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /debug.

def CommandSave()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /save.

def CommandUnban()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /unban.

def CommandUnrestrict()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /unrestrict.

def CommandUsers()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /users.

def CommandWant()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /want.

def CommandWhois()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /whois.

def CommandYell()
Category: General meta server functions
File: meta-server.functions
Implementation of the command /yell.

def Con(user name)
Category: General meta server functions
File: meta-server.functions
Return connection number of the player or -1 if not connected.

def DeckCheck(username, card list, original deck)
Category: General meta server functions
File: meta-server.functions
Check a card list having entries of form (nmb. of cards,card number) if user has them. Return a quadruple (username, nmb.of proxies,registered flag,orginal form flag).

def DelCard(player name, card number)
Category: General meta server functions
File: meta-server.functions
Delete a card from player's collection.

def DelCards(player name, card number, count)
Category: General meta server functions
File: meta-server.functions
Delete cards from player's collection.

def DisconnectPlayer()
Category: General meta server functions
File: meta-server.functions
Called when player disconnects.

def DisconnectServer()
Category: General meta server functions
File: meta-server.functions
Called when game server disconnects.

def EndGame(player name who declared, result, result options)
Category: General meta server functions
File: meta-server.functions
Game ended by game server. If the result is undecided, then argument is NULL.

def EnsurePriceUpdate(card number, old, new)
Category: General meta server functions
File: meta-server.functions
Check if new (seller list,price) pair differs from old and send update if they do.

def Give("username amount")
Category: General meta server functions
File: meta-server.functions
Give money.

def GiveCard(user name, card number)
Category: General meta server functions
File: meta-server.functions
Give a card.

def GiveMoney(user name, amount)
Category: General meta server functions
File: meta-server.functions
Give or remove money.

def IsRestricted(domain, ip)
Category: General meta server functions
File: meta-server.functions
Return 1 if access from the given domain/ip is restricted.

def IsServer()
Category: General meta server functions
File: meta-server.functions
Return 1 if current message is received from server.

def IsTableBanned(domain, ip)
Category: General meta server functions
File: meta-server.functions
Return 1 if access from the given domain/ip is restricted.

def JoinTable(table number)
Category: General meta server functions
File: meta-server.functions
Player joins a table.

def LeaveTable()
Category: General meta server functions
File: meta-server.functions
Leave the table where player is sitting if any.

def Log()
Category: General meta server functions
File: meta-server.functions
Write arguments to log.

def Mode([name])
Category: General meta server functions
File: meta-server.functions
current special mode ("sealed",etc.) of the current or specified player or "" if not in any mode.

def NewUser(password)
Category: General meta server functions
File: meta-server.functions
Create new user.

def Null()
Category: General meta server functions
File: meta-server.functions
Null command for TCP/IP keepalive.

def PrizeForDraw(nmb. of players, bet)
Category: General meta server functions
File: meta-server.functions
Calcluate prize for draw.

def PrizeForLoss(nmb. of players, bet)
Category: General meta server functions
File: meta-server.functions
Calcluate prize for loser.

def PrizeForWin(nmb. of players, bet)
Category: General meta server functions
File: meta-server.functions
Calcluate prize for winner.

def ReceiveData(e, d)
Category: General meta server functions
File: meta-server.functions
Called when network event (e,d) was received.

def Refresh(list of cards)
Category: General meta server functions
File: meta-server.functions
Send an update for cards.

def RefreshChatRoom()
Category: General meta server functions
File: meta-server.functions
Called when client asks for chat room update after the game.

def RegisterDeck(registration id, pres1, pres2)
Category: General meta server functions
File: meta-server.functions
Store a deck info for tournament purposes. The deck presentation pres1 is a list of pairs (nmb.of cards, card number). The second presentation deck2 is in original client-side deck format.

def RegisterGameResult(nmb. of players, player names, player name who declared, result type)
Category: General meta server functions
File: meta-server.functions
Update player stats.

def RegisterPlayer(user, version, number of known cards, game name, password, system, serial)
Category: General meta server functions
File: meta-server.functions
Store player info.

def RegisterServer(port number, players, bet, cookie, list of rules, description, version)
Category: General meta server functions
File: meta-server.functions
Add server to server cluster.

def RemoveObsoletePrices()
Category: General meta server functions
File: meta-server.functions
Helper function to be called once after transition from older server to the caching server. Using God account, this can be done by issuing /debug RemoveObsoletePrices().

def Reply(m)
Category: General meta server functions
File: meta-server.functions
Send message 'm' to current player.

def ReRegisterPlayer(new user, version, number of known cards, game name, password, system, serial)
Category: General meta server functions
File: meta-server.functions
Relogin.

def Roll(d)
Category: General meta server functions
File: meta-server.functions
Roll dice 'd' which is a string i.e. "2d6".

def SaveAll()
Category: General meta server functions
File: meta-server.functions
Save all server variables.

def Say(s)
Category: General meta server functions
File: meta-server.functions
Player says 's'.

def Sealed(mode name, command, arg, option dictionary)
Category: General meta server functions
File: meta-server.functions
Handle sealed commands: ("start",<amount>) ("end",NULL) ("on",NULL) ("off",NULL).

def SealedEnd()
Category: General meta server functions
File: meta-server.functions
Transfer cards and money, then end sealed session.

def SealedOff(mode name, NULL, options)
Category: General meta server functions
File: meta-server.functions
Return from sealed session.

def SealedOn(mode name, NULL, options)
Category: General meta server functions
File: meta-server.functions
Switch to sealed session.

def SealedStart(mode name, money, options)
Category: General meta server functions
File: meta-server.functions
Start sealed deck session.

def Send(connection, command)
Category: General meta server functions
File: meta-server.functions
Send a command to client if still online.

def SendAll(command)
Category: General meta server functions
File: meta-server.functions
Send command to all players who are not playing.

def SendAllNP(command)
Category: General meta server functions
File: meta-server.functions
Send command to all players who are not playing.

def SendOther(p, command)
Category: General meta server functions
File: meta-server.functions
Send command to all (non-playing) players except player 'p'.

def Set(variable, value)
Category: General meta server functions
File: meta-server.functions
Set an user variable for the current user.

def SetForsale(card number, amount)
Category: General meta server functions
File: meta-server.functions
set number of cards for sale.

def SetOfCard(card number)
Category: General meta server functions
File: meta-server.functions
return set abbreviation of the card or NULL if none.

def SetPrice(card number, price)
Category: General meta server functions
File: meta-server.functions
Set selling price for a card.

def StartGame(table number)
Category: General meta server functions
File: meta-server.functions
Initiate a game.

def Tickets(user name)
Category: General meta server functions
File: meta-server.functions
Dictionary of all tickets the user have.

def TicketsList(user name)
Category: General meta server functions
File: meta-server.functions
Return a list of tickets user have as text or "" if none.

def TicketsOf(user name, product)
Category: General meta server functions
File: meta-server.functions
Return number of tickets user have for product.

def ToggleJoinGame(force leave if 1)
Category: General meta server functions
File: meta-server.functions
Player joins or leaves game in the current table.

def TransferMoney(player name, change)
Category: General meta server functions
File: meta-server.functions
Add or substract money from the player.

def UpdateCard(card number)
Category: General meta server functions
File: meta-server.functions
Update current players card data for one card.

def User([con])
Category: General meta server functions
File: meta-server.functions
Username of the player causing an event or user name of the player with the connection con.

def UserWithoutMode([user])
Category: General meta server functions
File: meta-server.functions
Username minus mode string of the current player or the player specified.

def WeStartedGame()
Category: General meta server functions
File: meta-server.functions
called when game server announces successful game start.

General server functions (C++)

def add_to_collection(user, list of cards)
Category: General server functions (C++)
File: server.cpp
Add a list of cards to collection (variable 'users') of the given user. Note: there is no error chcekcing for card numbers.

def check_card(user name, card number)
Category: General server functions (C++)
File: server.cpp
Check existense of a user and a card and create new empty card to collection if not already exist.

def count_cards(user)
Category: General server functions (C++)
File: server.cpp
Return triplet (# cards owned,# cards for sale,# cards wanted) for user.

def del_prices(user name)
Category: General server functions (C++)
File: server.cpp
Delete all prices from 'prices' variable set by the given player. Return 1 if succesful.

def get_card_data(user, card list)
Category: General server functions (C++)
File: server.cpp
Return a list of full update entries for cards given. check the validity of all arguments and return NULL if some of the arguments are not valid.

def have_list(user asking, user target)
Category: General server functions (C++)
File: server.cpp
Return a list of cards which target user has more than his tradelimit or has at least one for sale; and asking user has in his want list.

def is_user(user name)
Category: General server functions (C++)
File: server.cpp
Return 1 if user exist.

def min_price(card number)
Category: General server functions (C++)
File: server.cpp
Find the cheapest offer for sale. Return (list of sellers,price) pair or NULL if there are 0 cards for sale.

def price_list(list of card numbers or single card number)
Category: General server functions (C++)
File: server.cpp
With single card number argument, return the best offer for the card in format (card numer,(seller,price)). If there are not any cards for sale, return NULL. If a list of card numbers is given, return list of the prices for those cards. Without any arguments, return the full list of all prices. NULLs are removed when returning a list.

def remove_obsolete_prices(card numbers)
Category: General server functions (C++)
File: server.cpp
Helper function to make transition from older server to the caching server easier. Clean obsolete entries from 'prices' variable. Return number of removed entries.

def set_error_trigger(key1, key2)
Category: General server functions (C++)
File: server.cpp
Set hook to call when error occurrs during script.

def set_forsale(user, card, how many)
Category: General server functions (C++)
File: server.cpp
Set the number of cards for sale (or wanted if < 0). Return NULL if fails, 1 if success and 2 if success and clients may need price refresh.

def set_price(user, card, price)
Category: General server functions (C++)
File: server.cpp
Set the price for a card. Return NULL if fails, 1 if success.

def user_has_cards(user, card list)
Category: General server functions (C++)
File: server.cpp
Return number of missing cards in card list (nmb. of cards,card number).

def want_list(user asking, user target)
Category: General server functions (C++)
File: server.cpp
Return a list of cards which target wants.

Lotr specific client functions

def BidHook(results)
Category: Lotr specific client functions
File: Lotr.include
This hook is called when bidding results are received. The results are presented as a dictionary mapping player numbers to bids.

def CompanySize()
Category: Lotr specific client functions
File: Lotr.include
Return size of the my company.

def EndOfTurnHook()
Category: Lotr specific client functions
File: Lotr.include
Called after end of turn is announced.

def InitializeGame()
Category: Lotr specific client functions
File: Lotr.include
Game specific initialization of game variables.

def InitializeLocationTables()
Category: Lotr specific client functions
File: Lotr.include
Fill tables for location algorithm (See Mtg.include for details).

def InputHook(input)
Category: Lotr specific client functions
File: Lotr.include
This hook is called when the enter key is pressed and the current input line is not going to be a pricing command. This hook should return 1, if it handles the input or 0, if default handler should be used instead.

def MouseLeftClickActiveSet()
Category: Lotr specific client functions
File: Lotr.include
Play a card.

def MouseLeftClickSiteCard()
Category: Lotr specific client functions
File: Lotr.include
Move to the next site.

def MouseLeftClickSites()
Category: Lotr specific client functions
File: Lotr.include
Play next site.

def MouseLeftClickSitesSearchBoxHook()
Category: Lotr specific client functions
File: Lotr.include
Play a site.

def MouseLeftClickTwilightPool()
Category: Lotr specific client functions
File: Lotr.include
Add one twilight counter.

def MouseMiddleClickTwilightPool()
Category: Lotr specific client functions
File: Lotr.include
Delete one twilight counter.

def MyFrodo()
Category: Lotr specific client functions
File: Lotr.include
Return object number of my Frodo or NULL if not found.

def NewDeck()
Category: Lotr specific client functions
File: Lotr.include
Game specific creation of empty deck structure.

def NextSiteNumber()
Category: Lotr specific client functions
File: Lotr.include
Calculate the smallest site number not yet in table.

def PlayEvent(card number, is face down?)
Category: Lotr specific client functions
File: Lotr.include
Play an event card.

def PlayKeyControlKeyA()
Category: Lotr specific client functions
File: Lotr.include
Handler for key Control+A in play mode.

def PlayKeyControlKeyD()
Category: Lotr specific client functions
File: Lotr.include
Handler for key Control+D in play mode.

def PlayKeyControlKeyDelete()
Category: Lotr specific client functions
File: Lotr.include
Handler for key Control+Delete in play mode.

def PlayKeyControlKeyU()
Category: Lotr specific client functions
File: Lotr.include
Delete all tokens from Twilight pool.

def PlaySite(card number, is face down?)
Category: Lotr specific client functions
File: Lotr.include
Play a site card.

def PlaySitesMenu()
Category: Lotr specific client functions
File: Lotr.include
Generate menu for sites.

def PlayTwilightPoolMenu()
Category: Lotr specific client functions
File: Lotr.include
Generate menu for Twilight Pool.

def PutTableHook(n, x, y, o, c, p)
Category: Lotr specific client functions
File: Lotr.include
Put a card number 'c' owned by 'p' using object number 'n' to the table centered at (x,y) oriented 'o' degrees clockwise.

def SearchStartingCards()
Category: Lotr specific client functions
File: Lotr.include
Search all potential starting cards from the deck and set aside.

def StartGame()
Category: Lotr specific client functions
File: Lotr.include
What to do when game begins.

def TryTransferHook(dest)
Category: Lotr specific client functions
File: Lotr.include
Called before applying relevant transfer function. This function may modify target when needed.

def TwilightPool()
Category: Lotr specific client functions
File: Lotr.include
Return object number of the twilight pool or NULL if not found.

def TwilightTokens()
Category: Lotr specific client functions
File: Lotr.include
Count number of twilight tokens.

Lotr specific factory server functions

def InitDistributions()
Category: Lotr specific factory server functions
File: Lotr-factory-server.include
Initialize product distribution data.

Lotr specific game server functions

def InitialScore(p)
Category: Lotr specific game server functions
File: Lotr-server.include
Return a structure representing initial score for a player 'p'.

def InitServerHook(nmb.of players)
Category: Lotr specific game server functions
File: Lotr-server.include
Called during server initialization.

def SetUpPlayer(p)
Category: Lotr specific game server functions
File: Lotr-server.include
Create necessary strucrures for player 'p'.

Metw specific client functions

def AddSideboardFwCards()
Category: Metw specific client functions
File: Metw.include
Add anti fw cards to sideboard.

def AdjustScore(object, amount)
Category: Metw specific client functions
File: Metw.include
Set score adjustment for a card.

def ChatMapMenu()
Category: Metw specific client functions
File: Metw.include
Generate menu for map.

def CreateDeckHook(object num, owner player, name, (x, y))
Category: Metw specific client functions
File: Metw.include
This hook is called after creation of a deck.

def CurrentDeckAddHavens()
Category: Metw specific client functions
File: Metw.include
Check site types already in deck and add havens of that type.

def CurrentDeckAddSites(site type)
Category: Metw specific client functions
File: Metw.include
Add one card of each site with the given type.

def CurrentDeckRemoveSites()
Category: Metw specific client functions
File: Metw.include
Delete all cards from 'sites' section.

def CurrentDeckRemoveUnownedSites()
Category: Metw specific client functions
File: Metw.include
Remove sites that player does not have.

def DelDeckHook(object number, deck name, card number, index)
Category: Metw specific client functions
File: Metw.include
Called before removing a card from the deck.

def DelTableHook(object number)
Category: Metw specific client functions
File: Metw.include
Del a card 'object number' from the table.

def EditAddSideboard()
Category: Metw specific client functions
File: Metw.include
Add sideboard vs. fw to the current deck.

def EditRemoveSideboard()
Category: Metw specific client functions
File: Metw.include
Remove sideboard vs. fw from the current deck if exist.

def InitializeGame()
Category: Metw specific client functions
File: Metw.include
Game specific initialization of game variables.

def InitializeLocationTables()
Category: Metw specific client functions
File: Metw.include
Fill tables for location algorithm (See Mtg.include for details).

def KeyControlKeyM()
Category: Metw specific client functions
File: Metw.include
Toggle map.

def KeyEscapeHook(current list of objects)
Category: Metw specific client functions
File: Metw.include
Modify list of objects potentially hided by key Esc.

def KeyShiftAltKeyB()
Category: Metw specific client functions
File: Metw.include
Produce {B}.

def KeyShiftAltKeyD()
Category: Metw specific client functions
File: Metw.include
Produce {D}.

def KeyShiftAltKeyF()
Category: Metw specific client functions
File: Metw.include
Produce {F}.

def KeyShiftAltKeyH()
Category: Metw specific client functions
File: Metw.include
Produce {H}.

def KeyShiftAltKeyR()
Category: Metw specific client functions
File: Metw.include
Produce {R}.

def KeyShiftAltKeyS()
Category: Metw specific client functions
File: Metw.include
Produce {S}.

def KeyShiftControlKeyB()
Category: Metw specific client functions
File: Metw.include
Produce {b}.

def KeyShiftControlKeyC()
Category: Metw specific client functions
File: Metw.include
Produce {c}.

def KeyShiftControlKeyD()
Category: Metw specific client functions
File: Metw.include
Produce {d}.

def KeyShiftControlKeyF()
Category: Metw specific client functions
File: Metw.include
Produce {f}.

def KeyShiftControlKeyS()
Category: Metw specific client functions
File: Metw.include
Produce {s}.

def KeyShiftControlKeyW()
Category: Metw specific client functions
File: Metw.include
Produce {w}.

def MouseControlMiddleClickMap()
Category: Metw specific client functions
File: Metw.include
Add region name and type to the chat.

def MouseLeftClickActiveSet()
Category: Metw specific client functions
File: Metw.include
Play a card.

def MouseLeftClickDiscardPile()
Category: Metw specific client functions
File: Metw.include
Look at discard.

def MouseLeftClickDiscardPileSearchBoxHook()
Category: Metw specific client functions
File: Metw.include
Shuffle a card to the deck revealing type.

def MouseLeftClickMap()
Category: Metw specific client functions
File: Metw.include
Search sites of the clicked region.

def MouseLeftClickPool()
Category: Metw specific client functions
File: Metw.include
Look at pool.

def MouseLeftClickPoolSearchBoxHook()
Category: Metw specific client functions
File: Metw.include
Play a card face up from pool.

def MouseLeftClickSideboard()
Category: Metw specific client functions
File: Metw.include
Look at sideboard.

def MouseLeftClickSideboardSearchBoxHook()
Category: Metw specific client functions
File: Metw.include
Shuffle a card to the deck and reveal type.

def MouseLeftClickSites()
Category: Metw specific client functions
File: Metw.include
Look at sites.

def MouseLeftClickSitesSearchBoxHook()
Category: Metw specific client functions
File: Metw.include
Play a site face down or face up if the first site.

def MouseMiddleClickHand()
Category: Metw specific client functions
File: Metw.include
Play card face down.

def MouseMiddleClickMap()
Category: Metw specific client functions
File: Metw.include
Toggle map off.

def MouseMiddleClickPoolSearchBoxHook()
Category: Metw specific client functions
File: Metw.include
Play a card face down from pool.

def MouseMiddleClickSites()
Category: Metw specific client functions
File: Metw.include
Show a map.

def NewDeck()
Category: Metw specific client functions
File: Metw.include
Game specific creation of empty deck structure.

def PlayFromSelectionHook(NULL)
Category: Metw specific client functions
File: Metw.include
Called after transfering a card directly from the selection. Hides the map.

def PlayKeyControlKeyMinus()
Category: Metw specific client functions
File: Metw.include
Decrease score for a card.

def PlayKeyControlKeyPlus()
Category: Metw specific client functions
File: Metw.include
Increase score for a card.

def PlayKeyEnter()
Category: Metw specific client functions
File: Metw.include
Enter to the site.

def PlayMapMenu()
Category: Metw specific client functions
File: Metw.include
Generate menu for map.

def PlayPoolMenu()
Category: Metw specific client functions
File: Metw.include
Generate menu for pool.

def PlaySideboardMenu()
Category: Metw specific client functions
File: Metw.include
Generate menu for sideboard.

def PlaySiteFromSelection(card number)
Category: Metw specific client functions
File: Metw.include
Play site from selector.

def PlaySitesMenu()
Category: Metw specific client functions
File: Metw.include
Generate menu for sites.

def PoolSearchBoxMenuHook()
Category: Metw specific client functions
File: Metw.include
Generate menu for a character pool.

def PutDeckHook(object number, deck name, card number(s))
Category: Metw specific client functions
File: Metw.include
Called after adding cards to the deck.

def PutTableHook(n, x, y, o, c, p)
Category: Metw specific client functions
File: Metw.include
Put a card number 'c' owned by 'p' using object number 'n' to the table centered at (x,y) oriented 'o' degrees clockwise.

def RecalculateScores()
Category: Metw specific client functions
File: Metw.include
Compute and update scores on server.

def ReplaceTableHook(object, card, old card)
Category: Metw specific client functions
File: Metw.include
Replace card on table with new card image.

def ScoreAdjustment(object)
Category: Metw specific client functions
File: Metw.include
Return current adjustment to score for the object.

def ScoreToText(score structure)
Category: Metw specific client functions
File: Metw.include
Convert a score structure to string.

def SideboardSearchBoxMenuHook()
Category: Metw specific client functions
File: Metw.include
Generate menu for sideboard search box.

def SingleCardMenuHook(context)
Category: Metw specific client functions
File: Metw.include
added to menu for a single card.

def SitesOfRegion(region name)
Category: Metw specific client functions
File: Metw.include
Return list of sites currently in location deck that are accessible from the region.

def SortSites()
Category: Metw specific client functions
File: Metw.include
Sort sites of the cuttent deck to order used during game.

def SpecialEventAdjustScore(object number, change)
Category: Metw specific client functions
File: Metw.include
Hande special event AdjustScore.

def StartGame()
Category: Metw specific client functions
File: Metw.include
What to do when game begins.

def TryTransferHook(dest)
Category: Metw specific client functions
File: Metw.include
called before applying relevant transfer function.

def UntapHook(object number)
Category: Metw specific client functions
File: Metw.include
Return 1 if card shoud be untapped using Ctrl+U.

Metw specific common client and server functions

def RuleAgentMindTotal(list of card numbers)
Category: Metw specific common client and server functions
File: Metw-common.include
Check that total mind of agents are not exceeded.

def RuleBothHeroAndMinionUnique(cards)
Category: Metw specific common client and server functions
File: Metw-common.include
Return 1 if there are no unique cards as both hero and minion version.

def RuleCheckWizards(card list, "deck"/"total", "H"/"M"/"F"/"B")
Category: Metw specific common client and server functions
File: Metw-common.include
Check that the number of wizards comply rules in deck or in total.

def RuleCountCreatures(list of card numbers, "H"/"M"/"F"/"B")
Category: Metw specific common client and server functions
File: Metw-common.include
Return number of creatures.

def RuleHazardResourceBalance(card list, "H"/"M"/"F"/"B")
Category: Metw specific common client and server functions
File: Metw-common.include
Check that there is as many hazards as resources.

def RuleNonUniqueStageCards(cards)
Category: Metw specific common client and server functions
File: Metw-common.include
Count number of non-unique stage cards.

def RuleSpecific(cards)
Category: Metw specific common client and server functions
File: Metw-common.include
Return number of "specifics" in deck.

def RuleStagepoints(cards)
Category: Metw specific common client and server functions
File: Metw-common.include
Count number of stage points.

Metw specific factory server functions

def InitDistributions()
Category: Metw specific factory server functions
File: Metw-factory-server.include
Initialize product distribution data.

def ProduceLE_Starter()
Category: Metw specific factory server functions
File: Metw-factory-server.include
Produce The Lidless Eye starter.

def ProduceTW_Starter()
Category: Metw specific factory server functions
File: Metw-factory-server.include
Produce The Wizards starter.

Metw specific game server functions

def InitialScore(p)
Category: Metw specific game server functions
File: Metw-server.include
Return a structure representing initial score for a player 'p'.

def InitServerHook(nmb.of players)
Category: Metw specific game server functions
File: Metw-server.include
Called during server initialization.

def LoadgameHook(special)
Category: Metw specific game server functions
File: Metw-server.include
Called after the game is restored but before objects are sent to players. Argument is the same as returned by SavegameHook().

def SavegameHook()
Category: Metw specific game server functions
File: Metw-server.include
Return game specific stuff to save.

def SendFullGameStatusHook(player)
Category: Metw specific game server functions
File: Metw-server.include
Called when full game status is sent to the player/watcher.

def SetUpPlayer(p)
Category: Metw specific game server functions
File: Metw-server.include
Create necessary strucrures for player 'p'.

def SpecialHook(command, object number, adjust)
Category: Metw specific game server functions
File: Metw-server.include
Adjust score.

Metw specific meta server functions

def EndGameHook(player name who declared, result, result options, player numbers, player names, bet)
Category: Metw specific meta server functions
File: Metw-meta-server.include
This hook is called at the beginning of the game result prosessing. Note: this hook is not called for undecided results.

def SealedEndHook()
Category: Metw specific meta server functions
File: Metw-meta-server.include
This hook is called before ending sealed mode. Current user is sealed mode player.

def SealedStartHook(sealed player name, mode name, money, options)
Category: Metw specific meta server functions
File: Metw-meta-server.include
This hook is called after initialization of sealed mode is complete. Current user is a player entering in the sealed mode. Note: This hook can be called more often than end hook.

Mtg specific client functions

def AddInputHook(left input, right input, string)
Category: Mtg specific client functions
File: Mtg.include
Called when a string is about to be added to the input line. This hook must add a string to the current input line and return the whole input line.

def CreateDeckHook(object num, owner player, name, (x, y))
Category: Mtg specific client functions
File: Mtg.include
This hook is called after creation of a deck.

def EditAddSideboard()
Category: Mtg specific client functions
File: Mtg.include
Add sideboard to the current deck.

def EditRemoveSideboard()
Category: Mtg specific client functions
File: Mtg.include
Remove sideboard from the current deck if exist.

def EndGame()
Category: Mtg specific client functions
File: Mtg.include
Game over.

def filter_mana(card number)
Category: Mtg specific client functions
File: Mtg.include
Return converted mana cost of the card.

def InitializeGame()
Category: Mtg specific client functions
File: Mtg.include
Game specific initialization of game variables.

def InitializeLocationTables()
Category: Mtg specific client functions
File: Mtg.include
Fill tables for location algorithm.

def InputHook(input)
Category: Mtg specific client functions
File: Mtg.include
This hook is called when the enter key is pressed and the current input line is not going to be a pricing command. This hook should return 1, if it handles the input or 0, if default handler should be used instead.

def KeyShiftControlKey0()
Category: Mtg specific client functions
File: Mtg.include
Produce {0}.

def KeyShiftControlKeyB()
Category: Mtg specific client functions
File: Mtg.include
Produce {B}.

def KeyShiftControlKeyC()
Category: Mtg specific client functions
File: Mtg.include
Produce {1}.

def KeyShiftControlKeyG()
Category: Mtg specific client functions
File: Mtg.include
Produce {G}.

def KeyShiftControlKeyR()
Category: Mtg specific client functions
File: Mtg.include
Produce {R}.

def KeyShiftControlKeyT()
Category: Mtg specific client functions
File: Mtg.include
Produce {T}.

def KeyShiftControlKeyU()
Category: Mtg specific client functions
File: Mtg.include
Produce {U}.

def KeyShiftControlKeyW()
Category: Mtg specific client functions
File: Mtg.include
Produce {W}.

def KeyShiftControlKeyX()
Category: Mtg specific client functions
File: Mtg.include
Produce {X}.

def KeyShiftControlKeyY()
Category: Mtg specific client functions
File: Mtg.include
Produce {Y}.

def mana(cost string)
Category: Mtg specific client functions
File: Mtg.include
Helper function to filtermana(). Return the converted mana cost for a single cost string.

def MessageHook(string)
Category: Mtg specific client functions
File: Mtg.include
Called before output when a message is received. This hook should return the modified message.

def MouseLeftClickSideboard()
Category: Mtg specific client functions
File: Mtg.include
Look at sideboard.

def NewDeck()
Category: Mtg specific client functions
File: Mtg.include
Game specific creation of empty deck structure.

def PlayInstant(card number, is face down?)
Category: Mtg specific client functions
File: Mtg.include
Play an instant card.

def PlayInterrupt(card number, is face down?)
Category: Mtg specific client functions
File: Mtg.include
Play an interrupt card.

def PlayKeyControlKeyI()
Category: Mtg specific client functions
File: Mtg.include
Imprint.

def PlaySideboardMenu()
Category: Mtg specific client functions
File: Mtg.include
Generate menu for sideboard.

def PlaySorcery(card number, is face down?)
Category: Mtg specific client functions
File: Mtg.include
Play a sorcery card.

def PutTableHook()
Category: Mtg specific client functions
File: Mtg.include
Clear imprint flag.

def ShowGameSpecificHelp()
Category: Mtg specific client functions
File: Mtg.include
Additional help text.

def SingleCardMenuHook(context)
Category: Mtg specific client functions
File: Mtg.include
added to menu for a single card.

def StartGame()
Category: Mtg specific client functions
File: Mtg.include
What to do when game begins.

def TokenSubmenu()
Category: Mtg specific client functions
File: Mtg.include
Create a submenu of token options.

def UntapHook(object number)
Category: Mtg specific client functions
File: Mtg.include
Return 1 if card shoud be untapped using Ctrl+U.

Mtg specific common client and server functions

def CreateTypeLegalTable(type)
Category: Mtg specific common client and server functions
File: Mtg-common.include
Fill table TYPELEGAL, if not already filled.

def RuleCountBiggestPopulation(list of card numbers)
Category: Mtg specific common client and server functions
File: Mtg-common.include
Count the biggest number of creatures having the same type.

def RuleCountColors(list of card numbers)
Category: Mtg specific common client and server functions
File: Mtg-common.include
Return the list of total numbers of each color (black,blue,green,red,white).

def TribalLegal(card number)
Category: Mtg specific common client and server functions
File: Mtg-common.include
Return 1 if card is a tribal legal creature.

def TypeLegal(rule set, card number)
Category: Mtg specific common client and server functions
File: Mtg-common.include
Return 1 if a card is a legal in the type.

def TypeRestricted(rule set, card number)
Category: Mtg specific common client and server functions
File: Mtg-common.include
Return 1 if a card is limited to one in the type.

Mtg specific factory server functions

def InitDistributions()
Category: Mtg specific factory server functions
File: Mtg-factory-server.include
Initialize product distribution data.

def ProduceBE_Booster()
Category: Mtg specific factory server functions
File: Mtg-factory-server.include
Produce beta booster.

def ProduceBE_Starter()
Category: Mtg specific factory server functions
File: Mtg-factory-server.include
Produce beta starter.

Mtg specific game server functions

def InitialScore(p)
Category: Mtg specific game server functions
File: Mtg-server.include
Return a structure representing initial score for a player 'p'.

def SetUpPlayer(p)
Category: Mtg specific game server functions
File: Mtg-server.include
Create necessary strucrures for player 'p'.

Mtg specific meta server functions

def EndGameHook(player name who declared, result, result options, player numbers, player names, bet)
Category: Mtg specific meta server functions
File: Mtg-meta-server.include
This hook is called at the beginning of the game result prosessing. Note: this hook is not called for undecided results.

def SealedEndHook()
Category: Mtg specific meta server functions
File: Mtg-meta-server.include
This hook is called before ending sealed mode. Current user is sealed mode player.

def SealedStartHook(sealed player name, mode name, money, options)
Category: Mtg specific meta server functions
File: Mtg-meta-server.include
This hook is called after initialization of sealed mode is complete. Current user is a player entering in the sealed mode. Note: This hook can be called more often than end hook.

Net library (C++)

def net_client_ip(c)
Category: Net library (C++)
File: parser_libnet.cpp
Return IP of the client c as a string.

def net_client_name(c)
Category: Net library (C++)
File: parser_libnet.cpp
Return canonical hostname of the client, which uses server connetion number c.

def net_close(n)
Category: Net library (C++)
File: parser_libnet.cpp
Close clients's connection number n.

def net_connect(s, p)
Category: Net library (C++)
File: parser_libnet.cpp
Connect to the port p of server named s. Return a client connection number or NULL if socket creation fails. Other network errors throws an exception.

def net_create_server(p)
Category: Net library (C++)
File: parser_libnet.cpp
Initialize server on TCP-port p. Throw Parser::LangErr if socket initialization fails.

def net_get()
Category: Net library (C++)
File: parser_libnet.cpp
Check if there are data available in some client connection. Return NULL, if not. Otherwise, return a pair (n,s), where n is the number of the client connection that originates data and s is the data itself. Function returns ("close",n) if server closed connection n.

def net_isopen(n)
Category: Net library (C++)
File: parser_libnet.cpp
Check if connection number n is open.

def net_send(n, e)
Category: Net library (C++)
File: parser_libnet.cpp
Send the value of expression e as a newline terminated string using the client connection number n. Return 1 if successful and 0 on SIGPIPE.

def net_server_close(n)
Category: Net library (C++)
File: parser_libnet.cpp
Close server's connection number n.

def net_server_get(t)
Category: Net library (C++)
File: parser_libnet.cpp
Wait for network events. If a client connects to the server, return a pair {\tt("open",n)} where n is is a client number. Whenever a client disconnects, return a pair ("close",n) respectively. Special event ("quit",NULL) is returned when the server process is interrupted by the signal. If the client number n sends data, return a pair (n,s) where s is a string containing data sent. Throw an exception if network error occurs. Parameter t defines time out for listening process. If t is NULL, then the function does not return until there is an event available. If t is positive integer, process waits for tms and returns NULL if there are no events available.

def net_server_isopen(n)
Category: Net library (C++)
File: parser_libnet.cpp
Check if server's connection number n is open.

def net_server_send(n, s)
Category: Net library (C++)
File: parser_libnet.cpp
Send a string s to the client number n. Return 1 if successful and 0 on SIGPIPE.

def net_server_send_all(s)
Category: Net library (C++)
File: parser_libnet.cpp
Send a string s to all clients.

Pokemon specific client functions

def InitializeGame()
Category: Pokemon specific client functions
File: Pokemon.include
Game specific initialization of game variables.

def InitializeLocationTables()
Category: Pokemon specific client functions
File: Pokemon.include
Fill tables for location algorithm (See Mtg.include for details).

def KeyControlKey0()
Category: Pokemon specific client functions
File: Pokemon.include
Use pokemon power on a card.

def KeyControlKey1()
Category: Pokemon specific client functions
File: Pokemon.include
Use first attack on a card.

def KeyControlKey2()
Category: Pokemon specific client functions
File: Pokemon.include
Use second attack on a card.

def KeyControlKey3()
Category: Pokemon specific client functions
File: Pokemon.include
Use third attack on a card.

def KeyControlKey4()
Category: Pokemon specific client functions
File: Pokemon.include
Use 4th attack on a card.

def KeyControlKey5()
Category: Pokemon specific client functions
File: Pokemon.include
Use 5th attack on a card.

def KeyShiftControlKeyC()
Category: Pokemon specific client functions
File: Pokemon.include
Produce {c}.

def KeyShiftControlKeyF()
Category: Pokemon specific client functions
File: Pokemon.include
Produce {f}.

def KeyShiftControlKeyG()
Category: Pokemon specific client functions
File: Pokemon.include
Produce {g}.

def KeyShiftControlKeyL()
Category: Pokemon specific client functions
File: Pokemon.include
Produce {l}.

def KeyShiftControlKeyP()
Category: Pokemon specific client functions
File: Pokemon.include
Produce {p}.

def KeyShiftControlKeyR()
Category: Pokemon specific client functions
File: Pokemon.include
Produce {r}.

def KeyShiftControlKeyW()
Category: Pokemon specific client functions
File: Pokemon.include
Produce {w}.

def MouseLeftClickPrizes()
Category: Pokemon specific client functions
File: Pokemon.include
Draw a card from prizes.

def MouseMiddleClickCard()
Category: Pokemon specific client functions
File: Pokemon.include
Untap and remove poison counter.

def NewDeck()
Category: Pokemon specific client functions
File: Pokemon.include
Game specific creation of empty deck structure.

def OpponentPrizesMenu()
Category: Pokemon specific client functions
File: Pokemon.include
Generate menu for opponent's prize pile.

def PlayTrainer(card number, is face down?)
Category: Pokemon specific client functions
File: Pokemon.include
Play a trainer card.

def PrizesMenu()
Category: Pokemon specific client functions
File: Pokemon.include
Generate menu for prize pile.

def ScoreToText(score structure)
Category: Pokemon specific client functions
File: Pokemon.include
Convert a score structure to string.

def ShowGameSpecificHelp()
Category: Pokemon specific client functions
File: Pokemon.include
Additional help text.

def StartGame()
Category: Pokemon specific client functions
File: Pokemon.include
What to do when game begins.

Pokemon specific factory server functions

def InitDistributions()
Category: Pokemon specific factory server functions
File: Pokemon-factory-server.include
Initialize product distribution data.

def ProduceBooster(set)
Category: Pokemon specific factory server functions
File: Pokemon-factory-server.include
Return random booster.

Pokemon specific game server functions

def InitialScore(p)
Category: Pokemon specific game server functions
File: Pokemon-server.include
Return a structure representing initial score for a player 'p'.

def InitServerHook(nmb.of players)
Category: Pokemon specific game server functions
File: Pokemon-server.include
Called during server initialization.

def SetUpPlayer(p)
Category: Pokemon specific game server functions
File: Pokemon-server.include
Create necessary strucrures for player 'p'.