diff --git a/HallOfDMs b/HallOfDMs index 9c608f260..8abfa08e2 100644 --- a/HallOfDMs +++ b/HallOfDMs @@ -713,9 +713,11 @@ y 26 end arch sign name Petitions for the DM -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options Petitions board +arch event_say +title Python +slaying /python/IPO/board.py +name Petitions board +end msg I am a talking board, designed for leaving messages for the DM. If you don't know what to say, say help. @@ -2473,8 +2475,10 @@ y 28 end arch chicken name The Great Chicken Oracle -event_say_plugin Python -event_say /python/IPO/seen.py +arch event_say +title Python +slaying /python/IPO/seen.py +end msg @match * The Great Chicken Oracle is out of service. Buk Buk Buka. @@ -2799,10 +2803,14 @@ x 13 y 28 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 @@ -4248,9 +4256,11 @@ y 26 end arch sign name DM Message Board -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options DM board +arch event_say +title Python +slaying /python/IPO/board.py +name DM board +end msg I am a talking board, designed for inter-DM messages. If you don't know what to say, say help. diff --git a/azumauindo/minatomachi/stores/diamondex1 b/azumauindo/minatomachi/stores/diamondex1 index ce2300f63..f20ea42bf 100644 --- a/azumauindo/minatomachi/stores/diamondex1 +++ b/azumauindo/minatomachi/stores/diamondex1 @@ -2905,8 +2905,10 @@ end arch man name Accountant name_pl Accountant -event_say /python/IPO/banksay.py -event_say_plugin Python +arch event_say +slaying /python/IPO/banksay.py +title Python +end x 9 y 7 end diff --git a/azumauindo/minatomachi/stores/postoffice b/azumauindo/minatomachi/stores/postoffice index 5c1ccddc6..4f56d29aa 100644 --- a/azumauindo/minatomachi/stores/postoffice +++ b/azumauindo/minatomachi/stores/postoffice @@ -411,10 +411,14 @@ x 2 y 18 end arch mailbox -event_close /python/IPO/send.py -event_close_plugin Python -event_apply /python/IPO/receive.py -event_apply_plugin Python +arch event_close +slaying /python/IPO/send.py +title Python +end +arch event_apply +slaying /python/IPO/receive.py +title Python +end x 2 y 18 material 0 @@ -579,10 +583,14 @@ x 3 y 18 end arch mailbox -event_close /python/IPO/send.py -event_close_plugin Python -event_apply /python/IPO/receive.py -event_apply_plugin Python +arch event_close +slaying /python/IPO/send.py +title Python +end +arch event_apply +slaying /python/IPO/receive.py +title Python +end x 3 y 18 material 0 @@ -653,8 +661,10 @@ end arch guildmaster name postmaster name_pl postmaster -event_say /python/IPO/say.py -event_say_plugin Python +arch event_say +slaying /python/IPO/say.py +title Python +end x 4 y 3 end @@ -731,10 +741,14 @@ x 4 y 18 end arch mailbox -event_close /python/IPO/send.py -event_close_plugin Python -event_apply /python/IPO/receive.py -event_apply_plugin Python +arch event_close +slaying /python/IPO/send.py +title Python +end +arch event_apply +slaying /python/IPO/receive.py +title Python +end x 4 y 18 material 0 @@ -899,10 +913,14 @@ x 5 y 18 end arch mailbox -event_close /python/IPO/send.py -event_close_plugin Python -event_apply /python/IPO/receive.py -event_apply_plugin Python +arch event_close +slaying /python/IPO/send.py +title Python +end +arch event_apply +slaying /python/IPO/receive.py +title Python +end x 5 y 18 material 0 diff --git a/azumauindo/suno-yamatoshi/shops/bank1 b/azumauindo/suno-yamatoshi/shops/bank1 index 21ad9119b..dca314786 100644 --- a/azumauindo/suno-yamatoshi/shops/bank1 +++ b/azumauindo/suno-yamatoshi/shops/bank1 @@ -436,10 +436,12 @@ end arch merchant name Bank Accountant name_pl Bank Accountant -event_say /python/IPO/banksay.py -event_say_plugin Python x 2 y 8 +arch event_say +title Python +slaying /python/IPO/banksay.py +end end arch dungeon_magic x 2 diff --git a/brest/brest.IPO b/brest/brest.IPO index 860a9af10..c70ab2422 100644 --- a/brest/brest.IPO +++ b/brest/brest.IPO @@ -115,10 +115,14 @@ x 1 y 4 end arch mailbox -event_close /python/IPO/send.py -event_close_plugin Python -event_apply /python/IPO/receive.py -event_apply_plugin Python +arch event_close +slaying /python/IPO/send.py +title Python +end +arch event_apply +slaying /python/IPO/receive.py +title Python +end x 1 y 4 material 0 @@ -175,8 +179,10 @@ msg Seems the mail's down... sorry, come back once the required law is passed. endmsg -event_say /python/IPO/say.py -event_say_plugin Python +arch event_say +slaying /python/IPO/say.py +title Python +end x 2 y 2 level 115 @@ -498,9 +504,11 @@ msg I am a talking board, please say something to me. If you don't know what to say, say help. endmsg -event_say /python/IPO/board.py -event_say_plugin Python -event_say_options Brest board +arch event_say +slaying /python/IPO/board.py +title Python +name Brest board +end x 7 y 4 end diff --git a/mlab/citydeclouds/bank/bank2 b/mlab/citydeclouds/bank/bank2 index ee652bcab..8b06dfa69 100644 --- a/mlab/citydeclouds/bank/bank2 +++ b/mlab/citydeclouds/bank/bank2 @@ -3066,8 +3066,10 @@ y 17 end arch courier name Bank of Skud Representative -event_say_plugin Python -event_say /python/IPO/banksay.py +arch event_say +title Python +slaying /python/IPO/banksay.py +end name_pl Bank of Skud Representative x 8 y 17 diff --git a/mlab/citydeclouds/citydeclouds2G b/mlab/citydeclouds/citydeclouds2G index 01e18b186..85ed32f49 100644 --- a/mlab/citydeclouds/citydeclouds2G +++ b/mlab/citydeclouds/citydeclouds2G @@ -3026,10 +3026,14 @@ x 6 y 46 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 @@ -3611,10 +3615,14 @@ x 7 y 46 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 @@ -4053,10 +4061,14 @@ x 8 y 46 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 @@ -4574,10 +4586,14 @@ x 9 y 46 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 @@ -7041,10 +7057,14 @@ x 14 y 21 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 diff --git a/navar_city/casino_infernal/casino_infernal1 b/navar_city/casino_infernal/casino_infernal1 index 5c4407424..5fdc0e00c 100644 --- a/navar_city/casino_infernal/casino_infernal1 +++ b/navar_city/casino_infernal/casino_infernal1 @@ -1227,9 +1227,10 @@ y 15 end arch slotmachine3 name GoldFinger -event_apply_plugin Python -event_apply /python/casino/goldslots.py -slaying +arch event_apply +title Python +slaying /python/casino/goldslots.py +end food 0 last_sp 1 x 7 @@ -1285,8 +1286,10 @@ y 23 end arch c_woman name Ruby -event_say_plugin Python -event_say /python/IPO/banksay.py +arch event_say +title Python +slaying /python/IPO/banksay.py +end msg @match * Sorry I'm on my break. @@ -1588,8 +1591,10 @@ y 12 end arch slotmachine2 name TheMagistrate -event_apply_plugin Python -event_apply /python/casino/imperialslots.py +arch event_apply +title Python +slaying /python/casino/imperialslots.py +end msg Imperial banknotes only! endmsg @@ -1617,9 +1622,10 @@ y 16 end arch slotmachine2 name BigNugget -event_apply_plugin Python -event_apply /python/casino/goldslots.py -slaying +arch event_apply +title Python +slaying /python/casino/goldslots.py +end food 0 last_sp 1 x 9 @@ -2042,9 +2048,10 @@ y 15 end arch slotmachine3 name GoldBrick -event_apply_plugin Python -event_apply /python/casino/goldslots.py -slaying +arch event_apply +title Python +slaying /python/casino/goldslots.py +end food 0 last_sp 1 x 11 @@ -2424,9 +2431,10 @@ end arch slotmachine3 name Silverado face slotmachine2.111 -event_apply_plugin Python -event_apply /python/casino/silverslots.py -slaying +arch event_apply +title Python +slaying /python/casino/silverslots.py +end food 0 last_sp 1 x 12 @@ -2671,8 +2679,10 @@ end arch slotmachine2 name WolvesBane face slotmachine1.111 -event_apply_plugin Python -event_apply /python/casino/silverslots.py +arch event_apply +title Python +slaying /python/casino/silverslots.py +end x 13 y 24 end @@ -3448,8 +3458,10 @@ y 24 end arch slotmachine1 name Starlight -event_apply_plugin Python -event_apply /python/casino/silverslots.py +arch event_apply +title Python +slaying /python/casino/silverslots.py +end x 17 y 24 end @@ -3746,9 +3758,10 @@ y 25 end arch slotmachine3 name WhiteLightning -event_apply_plugin Python -event_apply /python/casino/silverslots.py -slaying +arch event_apply +title Python +slaying /python/casino/silverslots.py +end food 0 last_sp 1 x 18 @@ -3935,9 +3948,10 @@ y 13 end arch slotmachine2 name DwarfHorde -event_apply_plugin Python -event_apply /python/casino/diamondslots.py -slaying +arch event_apply +title Python +slaying /python/casino/diamondslots.py +end food 0 last_sp 1 x 19 @@ -3953,9 +3967,10 @@ y 15 end arch slotmachine3 name GoldenShower -event_apply_plugin Python -event_apply /python/casino/goldslots.py -slaying +arch event_apply +title Python +slaying /python/casino/goldslots.py +end food 0 x 19 y 15 @@ -4068,8 +4083,10 @@ x 19 y 26 end arch cobblestones2 -event_say_plugin Python -event_say casinodoor.py +arch event_say +title Python +slaying casinodoor.py +end x 19 y 27 end @@ -4357,9 +4374,10 @@ end arch slotmachine2 name KingMaker face slotmachine1.111 -event_apply_plugin Python -event_apply /python/casino/imperialslots.py -slaying +arch event_apply +title Python +slaying /python/casino/imperialslots.py +end food 0 last_sp 1 x 21 @@ -4393,9 +4411,11 @@ end arch slotmachine2 name Moria face slotmachine1.111 -event_apply_plugin Python -event_apply /python/misc/CFInsulter.py -event_apply_options shakespear +arch event_apply +title Python +slaying /python/misc/CFInsulter.py +name shakespear +end msg You hear angry muttering coming from inside this slotmachine. Perhaps it is broken. @@ -4827,9 +4847,10 @@ y 13 end arch slotmachine2 name MineShaft -event_apply_plugin Python -event_apply /python/casino/diamondslots.py -slaying +arch event_apply +title Python +slaying /python/casino/diamondslots.py +end food 0 last_sp 1 x 23 @@ -4845,9 +4866,10 @@ y 15 end arch slotmachine3 name MidasTouch -event_apply_plugin Python -event_apply /python/casino/goldslots.py -slaying +arch event_apply +title Python +slaying /python/casino/goldslots.py +end food 0 last_sp 1 x 23 diff --git a/navar_city/city1court b/navar_city/city1court index 76e8dff20..2083c5d92 100644 --- a/navar_city/city1court +++ b/navar_city/city1court @@ -1680,9 +1680,11 @@ y 13 end arch sign name Petitions for the DMs -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options Petitions board +arch event_say +title Python +slaying /python/IPO/board.py +name Petitions board +end msg I am a talking board, designed for leaving messages for the DMs. If you don't know what to say, say help. diff --git a/navar_city/city1houses b/navar_city/city1houses index 279b340fd..ae57abcd9 100644 --- a/navar_city/city1houses +++ b/navar_city/city1houses @@ -2240,9 +2240,11 @@ y 2 end arch c_man name Rudy -event_say_plugin Python -event_say /python/misc/CFInsulter.py -event_say_options texas +arch event_say +title Python +slaying /python/misc/CFInsulter.py +name texas +end x 13 y 2 end diff --git a/navar_city/misc/IPO_navar b/navar_city/misc/IPO_navar index e6e74f13d..b148b83d1 100644 --- a/navar_city/misc/IPO_navar +++ b/navar_city/misc/IPO_navar @@ -139,9 +139,11 @@ y 8 end arch sign name Navar Message Board -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options Navar board +arch event_say +title Python +slaying /python/IPO/board.py +name Navar board +end msg I am a talking board, please say something to me. If you don't know what to say, say help. @@ -304,8 +306,10 @@ y 2 end arch c_woman name Babs -event_say_plugin Python -event_say /python/IPO/say.py +arch event_say +title Python +slaying /python/IPO/say.py +end msg @match * I'm on a break. @@ -616,10 +620,14 @@ x 8 y 4 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 diff --git a/navar_city/misc/city1bank b/navar_city/misc/city1bank index 33182af2f..d138b111f 100644 --- a/navar_city/misc/city1bank +++ b/navar_city/misc/city1bank @@ -1068,8 +1068,10 @@ y 5 end arch c_man name Sal -event_say_plugin Python -event_say /python/IPO/banksay.py +arch event_say +title Python +slaying /python/IPO/banksay.py +end msg @match * Sorry the abacus is down at the moment... diff --git a/navar_city/misc/city1mermaid b/navar_city/misc/city1mermaid index 7fb052a6c..a97f70942 100644 --- a/navar_city/misc/city1mermaid +++ b/navar_city/misc/city1mermaid @@ -177,8 +177,10 @@ y 11 end arch pirate_lass name Cindy Loo -event_say_plugin Python -event_say /python/IPO/seen.py +arch event_say +title Python +slaying /python/IPO/seen.py +end msg @match * I ain't seen nuthin. diff --git a/navar_city/mlab/tavernb1 b/navar_city/mlab/tavernb1 index 25f80bd27..0e00c3693 100644 --- a/navar_city/mlab/tavernb1 +++ b/navar_city/mlab/tavernb1 @@ -7988,8 +7988,10 @@ arch slotmachine3 name Imps and Devils name_pl Silver Sliver slaying silvercoin -event_apply /python/casino/silverslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/silverslots.py +title Python +end food 0 x 30 y 27 @@ -8363,8 +8365,10 @@ end arch slotmachine2 name Yellow Dog name_pl Golden Nugget -event_apply /python/casino/goldslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/goldslots.py +title Python +end food 0 x 31 y 27 @@ -8701,8 +8705,10 @@ end arch slotmachine2 name Golden Nugget name_pl Golden Nugget -event_apply /python/casino/goldslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/goldslots.py +title Python +end food 0 x 32 y 25 @@ -8730,8 +8736,10 @@ end arch slotmachine2 name Golden Nugget name_pl Golden Nugget -event_apply /python/casino/goldslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/goldslots.py +title Python +end food 0 x 32 y 27 @@ -9100,8 +9108,10 @@ slaying platinacoin msg Drop a platinum coin to play. endmsg -event_apply /python/casino/platinumslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/platinumslots.py +title Python +end x 33 y 25 end @@ -9129,8 +9139,10 @@ arch slotmachine3 name Silver Sliver name_pl Silver Sliver slaying silvercoin -event_apply /python/casino/silverslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/silverslots.py +title Python +end food 0 x 33 y 27 @@ -9440,8 +9452,10 @@ end arch slotmachine2 name Yellow Dog name_pl Golden Nugget -event_apply /python/casino/goldslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/goldslots.py +title Python +end food 0 x 34 y 25 @@ -9474,8 +9488,10 @@ slaying platinacoin msg Drop a platinum coin to play. endmsg -event_apply /python/casino/platinumslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/platinumslots.py +title Python +end x 34 y 27 end @@ -9751,8 +9767,10 @@ arch slotmachine3 name Silver Sliver name_pl Silver Sliver slaying silvercoin -event_apply /python/casino/silverslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/silverslots.py +title Python +end food 0 x 35 y 25 @@ -9780,8 +9798,10 @@ end arch slotmachine2 name Golden Nugget name_pl Golden Nugget -event_apply /python/casino/goldslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/goldslots.py +title Python +end food 0 x 35 y 27 @@ -10100,8 +10120,10 @@ slaying platinacoin msg Drop a platinum coin to play. endmsg -event_apply /python/casino/platinumslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/platinumslots.py +title Python +end x 36 y 25 end @@ -10133,8 +10155,10 @@ slaying platinacoin msg Drop a platinum coin to play. endmsg -event_apply /python/casino/platinumslots.py -event_apply_plugin Python +arch event_apply +slaying /python/casino/platinumslots.py +title Python +end x 36 y 27 end diff --git a/pup_land/nurnberg/IPO_nurnberg b/pup_land/nurnberg/IPO_nurnberg index c9e7cbf7b..f5a859322 100644 --- a/pup_land/nurnberg/IPO_nurnberg +++ b/pup_land/nurnberg/IPO_nurnberg @@ -133,10 +133,14 @@ x 1 y 8 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 @@ -222,8 +226,10 @@ y 1 end arch small_troll name Betty-Lou -event_say_plugin Python -event_say /python/IPO/say.py +arch event_say +title Python +slaying /python/IPO/say.py +end friendly 1 stand_still 1 sleep 0 diff --git a/pup_land/nurnberg/bank b/pup_land/nurnberg/bank index fc3d586cc..04509ade6 100644 --- a/pup_land/nurnberg/bank +++ b/pup_land/nurnberg/bank @@ -1992,8 +1992,10 @@ end arch man name Hoff face man.131 -event_say_plugin Python -event_say /python/IPO/banksay.py +arch event_say +title Python +slaying /python/IPO/banksay.py +end msg @match * I'm too busy to answer your queries. diff --git a/pup_land/nurnberg/city b/pup_land/nurnberg/city index 737377350..0a65a6553 100644 --- a/pup_land/nurnberg/city +++ b/pup_land/nurnberg/city @@ -4334,9 +4334,11 @@ y 21 end arch sign name Nurnberg Message Board -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options Nurnberg Board +arch event_say +title Python +slaying /python/IPO/board.py +name Nurnberg Board +end msg I am a talking board, please say something to me. If you don't know what to say, say help. diff --git a/pup_land/nurnberg/nf_bar b/pup_land/nurnberg/nf_bar index 77e0ffba5..aab7981bc 100644 --- a/pup_land/nurnberg/nf_bar +++ b/pup_land/nurnberg/nf_bar @@ -1246,8 +1246,10 @@ x 8 y 8 end arch sailor -event_say_plugin Python -event_say /python/IPO/seen.py +arch event_say +title Python +slaying /python/IPO/seen.py +end msg @match * ...Shake it baby! @@ -1411,8 +1413,10 @@ y 18 end arch slotmachine2 name Midas Touch -event_apply_plugin Python -event_apply /python/casino/goldslots.py +arch event_apply +title Python +slaying /python/casino/goldslots.py +end food 0 x 9 y 18 @@ -1726,8 +1730,10 @@ y 18 end arch slotmachine3 name Silver Penny-0-Rama -event_apply_plugin Python -event_apply /python/casino/silverslots.py +arch event_apply +title Python +slaying /python/casino/silverslots.py +end food 0 x 11 y 18 diff --git a/python/CFBank.py b/python/CFBank.py index 8d3d18f0b..ec0cdacf6 100644 --- a/python/CFBank.py +++ b/python/CFBank.py @@ -23,13 +23,13 @@ import os.path import shelve -import CFPython +import Crossfire class CFBank: bankdb = {} def __init__(self, bankfile): - self.bankdb_file = os.path.join(CFPython.GetLocalDirectory(),bankfile) + self.bankdb_file = os.path.join(Crossfire.LocalDirectory(),bankfile) self.bankdb = shelve.open(self.bankdb_file) def deposit(self, user, amount): @@ -52,7 +52,7 @@ class CFBank: return self.bankdb[user] else: return 0 - + def remove_account(self,user): if self.bankdb.has_key(user): del self.bankdb[user] diff --git a/python/CFBoard.py b/python/CFBoard.py index 3675d7ffd..757357ca9 100644 --- a/python/CFBoard.py +++ b/python/CFBoard.py @@ -23,11 +23,11 @@ import os.path import shelve -import CFPython +import Crossfire class CFBoard: - boarddb_file = os.path.join(CFPython.GetLocalDirectory(),'crossfireboard') + boarddb_file = os.path.join(Crossfire.LocalDirectory(),'crossfireboard') boarddb = {} total = 0 @@ -46,8 +46,8 @@ class CFBoard: if self.boarddb.has_key(boardname): elements=self.boarddb[boardname] return elements - - + + def delete(self, boardname, id): if self.boarddb.has_key(boardname): if id>0 and id<=len(self.boarddb[boardname]): @@ -62,7 +62,7 @@ class CFBoard: return len(self.boarddb[boardname]) else: return 0 - + def getauthor(self, boardname, id): if self.boarddb.has_key(boardname): if id>0 and id<=len(self.boarddb[boardname]): diff --git a/python/CFDataFile.py b/python/CFDataFile.py index 6edfa73d3..0f7794def 100644 --- a/python/CFDataFile.py +++ b/python/CFDataFile.py @@ -19,17 +19,17 @@ import os import string -import CFPython +import Crossfire class CFDataFile: '''Plain text storage for Crossfire data''' - + def __init__(self, datafile_name): '''make datafile paths for datafile 'object' - these all go in ../var/crossfire/datafiles to keep the local dir clean''' self.datafile_name = datafile_name - self.filename = os.path.join((CFPython.GetLocalDirectory()),'datafiles',datafile_name) - + self.filename = os.path.join((Crossfire.LocalDirectory()),'datafiles',datafile_name) + def exists(self): '''checks for datafile - no need to load it yet''' if os.path.isfile(self.filename): @@ -69,7 +69,7 @@ class CFDataFile: templist = list.split('|') DF[templist[0]] = templist[1:] return DF - + def putData(self, dic): '''Writes dictionary to formatted file - uses | character as a delimiter''' try: @@ -90,7 +90,7 @@ class CFDataFile: tmp.append(str(item)) temp = '%s|%s\n' %(entry, (string.join(tmp,'|'))) file.write(temp) - file.close() + file.close() class CFData: '''CFData Object is basically a dictionary parsed from the datafile - @@ -100,7 +100,7 @@ class CFData: def __init__(self, filename, header): self.header = header self.datafile = CFDataFile(filename) - + if self.datafile.exists(): self.datadb = self.datafile.getData() if self.datadb['#'] != self.header: @@ -119,7 +119,7 @@ class CFData: return 1 else: return 0 - + def exist(self, name): '''checks if a record exists given the primary key as "name"''' if self.datadb.has_key(name): @@ -137,7 +137,7 @@ class CFData: return record else: return 0 - + def put_record(self, record): '''adds an line entry to the datafile''' name = record['#'] @@ -147,11 +147,11 @@ class CFData: temp.append(record[item]) self.datadb[name]=temp self.datafile.putData(self.datadb) - + def get_keys(self): '''returns a sorted list of the primary keys (usually names) in the datafile''' keys = self.datadb.keys() keys.remove('#') keys.sort() return keys - + diff --git a/python/CFGamble.py b/python/CFGamble.py index fa2d3953d..f85f54252 100644 --- a/python/CFGamble.py +++ b/python/CFGamble.py @@ -8,13 +8,13 @@ import os.path import shelve import random -import CFPython +import Crossfire class SlotMachine: #sets up the file that holds all the slotmachine jackpots #make sure this points to your writable var/crossfire directory #you can delete that file to reset all the slotmachine jackpots - slotfile = os.path.join(CFPython.GetLocalDirectory(),'SlotMachine_file') + slotfile = os.path.join(Crossfire.LocalDirectory(),'SlotMachine_file') slotdb = {} def __init__(self,slotname,slotlist,minpot,maxpot): slotdb = shelve.open(self.slotfile) @@ -22,18 +22,18 @@ class SlotMachine: self.slotlist = slotlist self.minpot = minpot self.maxpot = maxpot - + def placebet(self,amount): if not self.slotdb.has_key(self.slotname): self.slotdb[self.slotname] = self.minpot+amount else: temp=self.slotdb[self.slotname] self.slotdb[self.slotname]=temp+amount - + def payoff(self,amount): temp=self.slotdb[self.slotname] self.slotdb[self.slotname] = temp-amount - + def spin(self,slotnum): result=[] while slotnum >=1: @@ -41,12 +41,12 @@ class SlotMachine: result.append(r) slotnum=slotnum-1 return result - + def checkslot(self): limit = self.slotdb[self.slotname] if limit >= self.maxpot: self.slotdb[self.slotname] = self.maxpot elif limit < self.minpot: self.slotdb[self.slotname] = self.minpot - return self.slotdb[self.slotname] - + return self.slotdb[self.slotname] + diff --git a/python/CFGuilds.py b/python/CFGuilds.py index 4b48f9638..07cff5924 100644 --- a/python/CFGuilds.py +++ b/python/CFGuilds.py @@ -18,14 +18,14 @@ # # The author can be reached via e-mail at temitchell@sourceforge.net -import CFPython +import Crossfire from time import localtime, strftime, time import os from CFDataFile import CFDataFile, CFData def GuildUpdate(): - GuildList = os.path.join(CFPython.GetDataDirectory(),CFPython.GetMapDirectory(),'templates','guild','GuildList') + GuildList = os.path.join(Crossfire.DataDirectory(),Crossfire.MapDirectory(),'templates','guild','GuildList') try: guildfile = open(GuildList,'r') guildlisting = guildfile.read().split('\n') @@ -65,7 +65,7 @@ class CFGuildHouses: return record else: return 0 - + def list_guilds(self): return self.guildhouselist.get_keys() @@ -91,8 +91,8 @@ class CFGuildHouses: self.guildhouselist.put_record(record) return 1 else: - return 0 - + return 0 + def change_status(self, name, status): record = self.info(name) if record: @@ -104,7 +104,7 @@ class CFGuildHouses: return 0 else: return 0 - + def add_questpoints(self, name, number): record = self.info(name) if record: @@ -118,7 +118,7 @@ class CFGuildHouses: return 1 else: return 0 - + def update_points(self, name, number): record = self.info(name) if record: @@ -161,7 +161,7 @@ class CFGuild: return 1 except: return 0 - + def remove_member(self, name): try: self.guildlist.remove_record(name) @@ -196,7 +196,7 @@ class CFGuild: return 1 else: return 0 - + def remove_demerits(self, name, number): record = self.info(name) if record: @@ -210,7 +210,7 @@ class CFGuild: return 1 else: return 0 - + def add_questpoints(self, name, number): record = self.info(name) if record: @@ -224,7 +224,7 @@ class CFGuild: return 1 else: return 0 - + def pay_dues(self, name, number): record = self.info(name) if record: diff --git a/python/CFItemBroker.py b/python/CFItemBroker.py index e2aa5cd5c..b0ee9ff97 100644 --- a/python/CFItemBroker.py +++ b/python/CFItemBroker.py @@ -1,35 +1,35 @@ #CFItemBroker.py #An often used bit of code to add or remove a number of objects #Useful for removing items (like in payment or as part of -#an inventory check) This is also useful for setting the number -#of a newly created item(s) as it will check for existing item(s) and add -#the appropriate number of new items avoiding such silliness as the +#an inventory check) This is also useful for setting the number +#of a newly created item(s) as it will check for existing item(s) and add +#the appropriate number of new items avoiding such silliness as the #number of the existing items being reset. #This will not check for the existence of an item as that would better #be done in the calling script so you can be flexible. -# +# #ToddMitchell -import CFPython +import Crossfire class Item: def __init__(self, object): self.object = object - self.numberof = CFPython.GetQuantity(self.object) + self.numberof = self.object.Quantity def add(self, number): tmp = (self.numberof + number)-1 - CFPython.SetQuantity(self.object, tmp) + self.object.Quantity=tmp return 1 - + def subtract(self, number): - remainder = self.numberof - number + remainder = self.numberof - number if remainder >= number: - CFPython.SetQuantity(self.object, remainder) + self.object.Quantity=remainder return 1 elif remainder == 0: - CFPython.RemoveObject(self.object) + self.object.Remove() return 1 else: return 0 diff --git a/python/CFLog.py b/python/CFLog.py index c3c63cbb2..19e3b41b9 100644 --- a/python/CFLog.py +++ b/python/CFLog.py @@ -25,7 +25,7 @@ # and rewritten to use plain text file storage (CFDataFile) instead of shelve. -import CFPython +import Crossfire from time import localtime, strftime, time from CFDataFile import CFDataFile, CFData @@ -60,21 +60,21 @@ class CFLog: record['Last_Login_Date']=date record['Login_Count']=int(record['Login_Count'])+1 self.log.put_record(record) - + def kick_update(self, name): date = strftime("%a, %d %b %Y %H:%M:%S CEST", localtime(time())) record = self.log.get_record(name) record['Kick_Count']=int(record['Kick_Count'])+1 record['Last_Kick_Date']=date self.log.put_record(record) - + def muzzle_update(self, name): date = strftime("%a, %d %b %Y %H:%M:%S CEST", localtime(time())) record = self.log.get_record(name) record['Muzzle_Count']=int(record['Muzzle_Count'])+1 record['Last_Muzzle_Date']=date self.log.put_record(record) - + def info(self, name): record = self.log.get_record(name) if record: diff --git a/python/CFMail.py b/python/CFMail.py index 33bb01a3f..fba6089e1 100644 --- a/python/CFMail.py +++ b/python/CFMail.py @@ -23,11 +23,11 @@ import os.path import shelve -import CFPython +import Crossfire class CFMail: - maildb_file = os.path.join(CFPython.GetLocalDirectory(),'crossfiremail') + maildb_file = os.path.join(Crossfire.LocalDirectory(),'crossfiremail') maildb = {} total = 0 @@ -48,8 +48,8 @@ class CFMail: elements=self.maildb[toname] del self.maildb[toname] return elements - - + + def countmail(self, toname): if self.maildb.has_key(toname): return len(self.maildb[toname]) diff --git a/python/IPO/README b/python/IPO/README index 063005cb1..8896d68cd 100755 --- a/python/IPO/README +++ b/python/IPO/README @@ -1,7 +1,7 @@ Mail and Messageboard Python scripts for Crossfire Joris Bontje -Updated Sept 2005 by Ryo Saeba +Updated Oct. 2005 by Gros This collection offers scripts and a map that allow you to send mail (including items) to your fellow players and place public @@ -10,7 +10,7 @@ It also allows for NPCs who can report on player login activity (seen.py). (note the bank script has been moved to banksay.py) Requirements: -- Crossfire (1.4x or higher(version must have system path functions in Python Plugin)) +- Crossfire (October 19th, 2005 CVS code or later, requires v2.0 plugin interface) - Python (2.0 or higher) - Python Crossfire plugin (latest) diff --git a/python/IPO/banksay.py b/python/IPO/banksay.py index 57e303984..0cfb9ec6d 100644 --- a/python/IPO/banksay.py +++ b/python/IPO/banksay.py @@ -1,4 +1,4 @@ -# Script for say event of Imperial Bank Tellers +# Script for say event of Imperial Bank Tellers # # Copyright (C) 2002 Joris Bontje # @@ -18,22 +18,22 @@ # # The author can be reached via e-mail at jbontje@suespammers.org # -# Updated to use new path functions in CFPython and broken and +# Updated to use new path functions in CFPython and broken and # modified a bit by -Todd Mitchell -import CFPython +import Crossfire import string import random import CFBank import CFItemBroker -activator=CFPython.WhoIsActivator() -activatorname=CFPython.GetName(activator) -whoami=CFPython.WhoAmI() -x=CFPython.GetXPosition(activator) -y=CFPython.GetYPosition(activator) +activator=Crossfire.WhoIsActivator() +activatorname=activator.Name +whoami=Crossfire.WhoAmI() +x=activator.X +y=activator.Y #EASILY SETTABLE PARAMETERS @@ -44,7 +44,7 @@ bankdatabase="ImperialBank_DB" fees=(service_charge/100.0)+1 bank = CFBank.CFBank(bankdatabase) -text = string.split(CFPython.WhatIsMessage()) +text = string.split(Crossfire.WhatIsMessage()) thanks_message = ['Thank you for banking the Imperial Way.', 'Thank you, please come \ again.', 'Thank you, please come again.','Thank you for banking the Imperial Way.', \ 'Thank you for your patronage.', 'Thank you, have a nice day.', 'Thank you. "Service" \ @@ -61,7 +61,7 @@ if text[0] == 'help' or text[0] == 'yes': elif text[0] == 'deposit': if len(text)==2: - if (CFPython.PayAmount(activator, int((int(text[1])*exchange_rate)*fees))): + if (activator.PayAmount(int((int(text[1])*exchange_rate)*fees))): bank.deposit(activatorname, int(text[1])) message = '%d received, %d imperials deposited to bank account. %s' \ %((int(text[1])*(exchange_rate/50))*fees,int(text[1]),random.choice(thanks_message)) @@ -75,7 +75,7 @@ elif text[0] == 'withdraw': if (bank.withdraw(activatorname, int(text[1]))): message = '%d imperials withdrawn from bank account. %s' \ %(int(text[1]),random.choice(thanks_message)) - id = CFPython.CreateObject('imperial', (x, y)) + id = activator.Map.CreateObject('imperial', (x, y)) CFItemBroker.Item(id).add(int(text[1])) else: message = 'Not enough imperials on your account' @@ -84,11 +84,11 @@ elif text[0] == 'withdraw': elif text[0] == 'exchange': if len(text)==2: - inv=CFPython.CheckInventory(activator,'imperial') + inv=activator.CheckInventory('imperial') if inv: pay = CFItemBroker.Item(inv).subtract(int(text[1])) if pay: - id = CFPython.CreateObject('platinum coin', (x, y)) + id = activator.Map.CreateObject('platinum coin', (x, y)) CFItemBroker.Item(id).add(int(text[1])*(exchange_rate/50)) message = random.choice(thanks_message) else: @@ -96,7 +96,7 @@ elif text[0] == 'exchange': else: message = 'Sorry, you do not have any imperials' else: - message = 'Usage "exchange " (imperials to platimum coins)' + message = 'Usage "exchange " (imperials to platimum coins)' elif text[0] == 'balance': balance = bank.getbalance(activatorname) @@ -109,4 +109,4 @@ elif text[0] == 'balance': else: message = 'Do you need help?' -CFPython.Say(whoami, message) +whoami.Say(message) diff --git a/python/IPO/board.py b/python/IPO/board.py index 13ed1fa6e..4fef5d3b0 100755 --- a/python/IPO/board.py +++ b/python/IPO/board.py @@ -22,62 +22,62 @@ # #Updated to use new path functions in CFPython -Todd Mitchell -import CFPython +import Crossfire import CFBoard import string board = CFBoard.CFBoard() -activator=CFPython.WhoIsActivator() -activatorname=CFPython.GetName(activator) -whoami=CFPython.WhoAmI() +activator=Crossfire.WhoIsActivator() +activatorname=activator.Name +whoami=Crossfire.WhoAmI() -boardname=CFPython.GetEventOptions(whoami,6) # 6 is say event +boardname=Crossfire.ScriptParameters() # 6 is say event print "Activated %s" %boardname if (boardname): - text = string.split(CFPython.WhatIsMessage(), ' ', 1) + text = string.split(Crossfire.WhatIsMessage(), ' ', 1) if text[0] == 'help' or text[0] == 'yes': message='Help for %s\nList of commands:\n\n- list\n- write \n- remove \n'%boardname - CFPython.Write(message, activator) + activator.Write(message) elif text[0] == 'write': if len(text)==2: board.write(boardname, activatorname, text[1]) - CFPython.Write('Added to %s'%boardname, activator) + activator.Write('Added to %s'%boardname) else: - CFPython.Write('Usage "write "', activator) + activator.Write('Usage "write "') elif text[0] == 'list': total = board.countmsg(boardname) if total > 0: - CFPython.Write('Content of %s:'%boardname, activator) + activator.Write('Content of %s:'%boardname) elements = board.list(boardname) element = [] id = 1 for element in elements: author, message = element - CFPython.Write('<%d> (%s) %s'%(id,author,message), activator) + activator.Write('<%d> (%s) %s'%(id,author,message)) id=id+1 else: - CFPython.Write('%s is empty'%boardname, activator) + activator.Write('%s is empty'%boardname) elif text[0] == 'remove': if len(text)==2: - if board.getauthor(boardname,int(text[1]))==activatorname or CFPython.IsDungeonMaster(activator): + if board.getauthor(boardname,int(text[1]))==activatorname or activator.IsDungeonMaster: if board.delete(boardname, int(text[1])): - CFPython.Write('Removed from %s'%boardname, activator) + activator.Write('Removed from %s'%boardname) else: - CFPython.Write('Doesn\'t exist on %s'%boardname, activator) + activator.Write('Doesn\'t exist on %s'%boardname) else: - CFPython.Write('Access denied', activator) + activator.Write('Access denied') else: - CFPython.Write('Usage "remove "', activator) + activator.Write('Usage "remove "') else: - CFPython.Write('Do you need help?', activator) + activator.Write('Do you need help?') else: - CFPython.Write('Board Error', activator) + activator.Write('Board Error') diff --git a/python/IPO/receive.py b/python/IPO/receive.py index 75ff6e479..6a8ec8aa7 100755 --- a/python/IPO/receive.py +++ b/python/IPO/receive.py @@ -20,13 +20,13 @@ # #Updated to use new path functions in CFPython -Todd Mitchell -import CFPython +import Crossfire import CFMail import string -activator=CFPython.WhoIsActivator() -activatorname=CFPython.GetName(activator) -whoami=CFPython.WhoAmI() +activator=Crossfire.WhoIsActivator() +activatorname=activator.Name +whoami=Crossfire.WhoAmI() mail = CFMail.CFMail() total = mail.countmail(activatorname) @@ -37,26 +37,26 @@ if total > 0: for element in elements: type, fromname, message = element if type==1: - msgob = CFPython.CreateObjectInside('scroll', whoami) - CFPython.SetName(msgob,'mailscroll F: '+fromname+' T: '+activatorname) - CFPython.SetMessage(msgob, message) - CFPython.SetValue(msgob, 0) + msgob = whoami.CreateObject('scroll') + msgob.Name='mailscroll F: '+fromname+' T: '+activatorname + msgob.Message=message + msgob.Value=0 elif type==2: - msgob = CFPython.CreateObjectInside('note', whoami) - CFPython.SetName(msgob,'newspaper D: '+fromname) - CFPython.SetMessage(msgob, message) - CFPython.SetValue(msgob, 0) + msgob = whoami.CreateObject('note') + msgob.Name='newspaper D: '+fromname + msgob.Message=message + msgob.Value=0 elif type==3: - msgob = CFPython.CreateObjectInside('diploma', whoami) - CFPython.SetName(msgob,'mailwarning F: '+fromname+' T: '+activatorname) - CFPython.SetMessage(msgob, message) - CFPython.SetValue(msgob, 0) + msgob = whoami.CreateObject('diploma') + msgob.Name='mailwarning F: '+fromname+' T: '+activatorname + msgob.Message=message + msgob.Value=0 else: print 'ERROR: unknown mailtype\n' if total == 1: - CFPython.Write('You got 1 mail.', activator) + activator.Write('You got 1 mail.') elif total > 1: - CFPython.Write('You got %s mails.'%total, activator) + activator.Write('You got %s mails.'%total) else: - CFPython.Write('You haven\'t got any mail.', activator) + activator.Write('You haven\'t got any mail.') diff --git a/python/IPO/say.py b/python/IPO/say.py index 753806e98..f0c0c455b 100755 --- a/python/IPO/say.py +++ b/python/IPO/say.py @@ -1,4 +1,4 @@ -# Script for say event of IPO employees +# Script for say event of IPO employees # # Copyright (C) 2002 Joris Bontje # @@ -43,74 +43,75 @@ storage_y = 2 # Post office sack name (one word without space) sackName = 'package' -import CFPython +import Crossfire import string import CFLog -activator=CFPython.WhoIsActivator() -activatorname=CFPython.GetName(activator) -whoami=CFPython.WhoAmI() -x=CFPython.GetXPosition(activator) -y=CFPython.GetYPosition(activator) +activator=Crossfire.WhoIsActivator() +activatorname=activator.Name +whoami=Crossfire.WhoAmI() +x=activator.X +y=activator.Y log = CFLog.CFLog() -text = string.split(CFPython.WhatIsMessage()) +text = string.split(Crossfire.WhatIsMessage()) if text[0] == 'help' or text[0] == 'yes': message = 'How can I help you ? Here is a quick list of commands:\n\n- pen (%s platinum)\n- literacy (%s platinum)\n- mailscroll (%s platinum)\n- bag (%s platinum)\n- package (%s platinum)\n- carton (%s platinum)\n- send \n- receive'%(priceWritingPen,priceScrollOfLiteracy,priceMailScroll,priceBag,pricePackage,priceCarton) - CFPython.Say(whoami,message) + whoami.Say(message) + elif text[0] == 'pen': - if (CFPython.PayAmount(activator, priceWritingPen*priceFactor)): - CFPython.Say(whoami, 'Here is your IPO Writing Pen') - id = CFPython.CreateObject('writing pen', (x, y)) - CFPython.SetName(id, 'IPO Writing Pen') - CFPython.SetValue(id, 0) + if (activator.PayAmount(priceWritingPen*priceFactor)): + whoami.Say('Here is your IPO Writing Pen') + id = activator.Map.CreateObject('writing pen', x, y) + id.Name='IPO Writing Pen' + id.Value=0 else: - CFPython.Say(whoami, 'You need %s platinum for an IPO Writing Pen'%priceWritingPen) + whoami.Say('You need %s platinum for an IPO Writing Pen'%priceWritingPen) elif text[0] == 'literacy': - if (CFPython.PayAmount(activator,priceScrollOfLiteracy*priceFactor)): - CFPython.Say(whoami, 'Here is your IPO Scroll of Literacy') - id = CFPython.CreateObject('scroll of literacy', (x, y)) - CFPython.SetName(id, 'IPO Scroll of Literacy') - CFPython.SetValue(id, 0) + if (activator.PayAmount(priceScrollOfLiteracy*priceFactor)): + whoami.Say('Here is your IPO Scroll of Literacy') + id = activator.Map.CreateObject('scroll of literacy', x, y) + id.SetName='IPO Scroll of Literacy' + id.SetValue=0 else: - CFPython.Say(whoami, 'You need %s platinum for an IPO Scroll of Literacy'%priceScrollOfLiteracy) + whoami.Say('You need %s platinum for an IPO Scroll of Literacy'%priceScrollOfLiteracy) elif text[0] == 'mailscroll': if len(text)==2: if log.info(text[1]): - if (CFPython.PayAmount(activator, priceMailScroll*priceFactor)): - CFPython.Say(whoami, 'Here is your mailscroll') - id = CFPython.CreateObject('scroll', (x, y)) - CFPython.SetName(id, 'mailscroll T: '+text[1]+' F: '+ activatorname) - CFPython.SetValue(id, 0) + if (activator.PayAmount(priceMailScroll*priceFactor)): + whoami.Say('Here is your mailscroll') + id = activator.Map.CreateObject('scroll', x, y) + id.Name='mailscroll T: '+text[1]+' F: '+ activatorname + id.Value=0 else: - CFPython.Say(whoami, 'You need %s platinum for a mailscroll'%priceMailScroll) + whoami.Say('You need %s platinum for a mailscroll'%priceMailScroll) else: - CFPython.Say(whoami, 'I don\'t know any %s'%text[1]) + whoami.Say('I don\'t know any %s'%text[1]) else: - CFPython.Say(whoami, 'Usage "mailscroll "') + whoami.Say('Usage "mailscroll "') elif text[0] == 'mailwarning': - if (CFPython.IsDungeonMaster(activator)): + if (activator.IsDungeonMaster): if len(text)==2: if log.info(text[1]): - CFPython.Say(whoami, 'Here is your mailwarning') - id = CFPython.CreateObject('diploma', (x, y)) - CFPython.SetName(id, 'mailwarning T: '+text[1]+' F: '+ activatorname) - CFPython.SetValue(id, 0) + whoami.Say('Here is your mailwarning') + id = activator.Map.CreateObject('diploma', x, y) + id.Name='mailwarning T: '+text[1]+' F: '+ activatorname + id.Value=0 else: - CFPython.Say(whoami, 'I don\'t know any %s'%text[1]) + whoami.Say('I don\'t know any %s'%text[1]) else: - CFPython.Say(whoami, 'Usage "mailwarning "') + whoami.Say('Usage "mailwarning "') else: - CFPython.Say(whoami, 'You need to be DM to be able to use this command') + whoami.Say('You need to be DM to be able to use this command') elif text[0] == 'bag' or text[0] == 'package' or text[0] == 'carton': if (len(text) == 2): @@ -128,59 +129,60 @@ elif text[0] == 'bag' or text[0] == 'package' or text[0] == 'carton': max = 100000 item = 'r_sack' - if ( CFPython.PayAmount(activator, price*priceFactor) ): - box = CFPython.CreateObject(item, (x, y)) - CFPython.SetName(box, sackName + ' T: ' + text[1] + ' F: ' + activatorname) - CFPython.SetWeightLimit(box, max) - CFPython.SetStrength(box, 0) - CFPython.Say(whoami, 'Here is your %s'%text[0]) - CFPython.InsertObjectInside(box, activator) + if ( activator.PayAmount(price*priceFactor) ): + box = activator.Map.CreateObject(item, x, y) + box.Name=sackName + ' T: ' + text[1] + ' F: ' + activatorname + box.WeightLimit=max + box.Strength=0 + whoami.Say(whoami, 'Here is your %s'%text[0]) + activator.InsertObject(box) else: - CFPython.Say(whoami, 'You need %s platinum to buy a %s'%( price, text[0] ) ) + whoami.Say('You need %s platinum to buy a %s'%( price, text[0] ) ) else: - CFPython.Say(whoami, 'I don\'t know any %s'%text[1]) + whoami.Say('I don\'t know any %s'%text[1]) else: - CFPython.Say(whoami, 'Send a %s to who?'%text[0] ) + whoami.Say('Send a %s to who?'%text[0] ) elif text[0] == 'send': if len(text) == 2: - inv = CFPython.CheckInventory(activator,sackName) + inv = activator.CheckInventory(sackName) map = 0 if inv != 0: while inv != 0: - next = CFPython.GetNextObject(inv) - text2=string.split(CFPython.GetName(inv)) + next = inv.Below + text2=string.split(inv.Name) if text2[0]==sackName and text2[1]=='T:' and text2[3]=='F:' and text2[2] == text[1]: - map = CFPython.ReadyMap(storage_map) + map = Crossfire.ReadyMap(storage_map) if map == 0: - CFPython.Say(whoami, 'I\'m sorry but the post can\'t send your package now.') + whoami.Say('I\'m sorry but the post can\'t send your package now.') else: - CFPython.Teleport(inv, map, storage_x, storage_y) - CFPython.Say(whoami, 'Package sent') + inv.Teleport(map, storage_x, storage_y) + whoami.Say('Package sent') inv = next else: - CFPython.Say(whoami, 'No package to send.') + whoami.Say('No package to send.') else: - CFPython.Say(whoami, 'Send packages to who?') + whoami.Say('Send packages to who?') elif text[0] == 'receive': - map = CFPython.ReadyMap(storage_map) + map = Crossfire.ReadyMap(storage_map) if ( map != 0 ): - item = CFPython.GetObjectAt(map, storage_x, storage_y) + item = map.GetObjectAt(storage_x, storage_y) count = 0 while item != 0: - previous = CFPython.GetPreviousObject(item) - text2 = string.split(CFPython.GetName(item)) + previous = item.above + text2 = string.split(item.Name) if ( len(text2) == 5 ) and ( text2[0] == sackName ) and ( text2[2] == activatorname ): - CFPython.InsertObjectInside(item,activator) + activator.InsertObjectInside(item) count = count + 1 item = previous if ( count == 0 ): - CFPython.Say(whoami, 'No package for you, sorry.') + whoami.Say('No package for you, sorry.') else: - CFPython.Say(whoami, 'Here you go.') + whoami.Say('Here you go.') else: - CFPython.Say(whoami, 'Sorry, our package delivery service is currently in strike. Please come back later.') + whoami.Say('Sorry, our package delivery service is currently in strike. Please come back later.') else: - CFPython.Say(whoami, 'Do you need help?') + whoami.Say('Do you need help?') +Crossfire.setReturnValue(1) \ No newline at end of file diff --git a/python/IPO/seen.py b/python/IPO/seen.py index 23418eea0..959b5cbba 100644 --- a/python/IPO/seen.py +++ b/python/IPO/seen.py @@ -1,4 +1,4 @@ -# Script for seen event +# Script for seen event # # Copyright (C) 2002 Joris Bontje # @@ -22,19 +22,19 @@ # # seen - tells player information from logger -import CFPython +import Crossfire import string import CFLog -activator=CFPython.WhoIsActivator() -activatorname=CFPython.GetName(activator) -whoami=CFPython.WhoAmI() -isDM=CFPython.IsDungeonMaster(activator) -x=CFPython.GetXPosition(activator) -y=CFPython.GetYPosition(activator) +activator=Crossfire.WhoIsActivator() +activatorname=activator.Name +whoami=Crossfire.WhoAmI() +isDM=activator.IsDungeonMaster +x=activator.X +y=activator.Y log = CFLog.CFLog() -text = string.split(CFPython.WhatIsMessage()) +text = string.split(Crossfire.WhatIsMessage()) if text[0] == 'seen': if len(text)==2: @@ -49,12 +49,12 @@ if text[0] == 'seen': else: message = 'Usage "seen "' -elif text[0] == 'help': +elif text[0] == 'help': if isDM: message = "How can I help you? Here is a quick list of commands:\nseen, info, muzzlecount, lastmuzzle, kickcount, lastkick" else: message = "I have seen just about everybody - go ahead and ask me." - + elif text[0] == 'muzzlecount' and isDM: if len(text)==2: record = log.info(text[1]) @@ -84,7 +84,7 @@ elif text[0] == 'kickcount' and isDM: message = "I have no knowledge of '%s'." % text[1] else: message = 'Usage "kickcount "' - + elif text[0] == 'lastkick' and isDM: if len(text)==2: record = log.info(text[1]) @@ -107,4 +107,4 @@ elif text[0] == 'info' and isDM: else: message = "Do you need help?" -CFPython.Say(whoami, message) +whoami.Say(message) diff --git a/python/IPO/send.py b/python/IPO/send.py index e5650a36d..c1a566d2e 100755 --- a/python/IPO/send.py +++ b/python/IPO/send.py @@ -20,61 +20,62 @@ # #Updated to use new path functions in CFPython -Todd Mitchell -import CFPython +import Crossfire import CFMail import string from time import localtime, strftime, time mail = CFMail.CFMail() date = strftime("%a, %d %b %Y %H:%M:%S CEST", localtime(time())) -activator=CFPython.WhoIsActivator() -activatorname=CFPython.GetName(activator) -whoami=CFPython.WhoAmI() +activator=Crossfire.WhoIsActivator() +activatorname=activator.Name +whoami=Crossfire.WhoAmI() idlist=[] -inv = CFPython.CheckInventory(CFPython.WhoAmI(),"mailscroll") -if inv != 0: - while inv!=0: - text=string.split(CFPython.GetName(inv)) +inv = whoami.CheckInventory("mailscroll") +if inv != None: + while inv!=None: + print("INV:%s" %inv.Name) + text=string.split(inv.Name) if text[0]=='mailscroll' and text[1]=='T:' and text[3]=='F:': idlist.append(inv) toname=text[2] fromname=text[4] - message='From: %s\nTo: %s\nDate: %s\n\n%s\n' % (fromname, toname, date, CFPython.GetMessage(inv)[:-1]) - CFPython.Write('mailscroll to '+toname+' sent.', activator) + message='From: %s\nTo: %s\nDate: %s\n\n%s\n' % (fromname, toname, date, inv.Message[:-1]) + activator.Write('mailscroll to '+toname+' sent.') mail.send(1, toname, fromname, message) elif text[0]=='mailscroll' and text[1]=='F:' and text[3]=='T:': idlist.append(inv) fromname=text[2] toname=text[4] - message=CFPython.GetMessage(inv)[:-1]+'\n' + message=inv.Message[:-1]+'\n' mail.send(1, toname, fromname, message) else: print "ID: %d"%inv - print "Name: "+CFPython.GetName(inv) - inv=CFPython.GetNextObject(inv) + print "Name: "+inv.Name + inv=inv.Below -inv = CFPython.CheckInventory(CFPython.WhoAmI(),"mailwarning") -if inv != 0: - while inv!=0: - text=string.split(CFPython.GetName(inv)) +inv = whoami.CheckInventory("mailwarning") +if inv != None: + while inv!=None: + text=string.split(inv.Name) if text[0]=='mailwarning' and text[1]=='T:' and text[3]=='F:': idlist.append(inv) toname=text[2] fromname=text[4] - message='From: %s\nTo: %s\nDate: %s\n\n%s\n' % (fromname, toname, date, CFPython.GetMessage(inv)[:-1]) - CFPython.Write('mailwarning to '+toname+' sent.', activator) + message='From: %s\nTo: %s\nDate: %s\n\n%s\n' % (fromname, toname, date, inv.Message[:-1]) + activator.Write('mailwarning to '+toname+' sent.') mail.send(3, toname, fromname, message) elif text[0]=='mailwarning' and text[1]=='F:' and text[3]=='T:': idlist.append(inv) fromname=text[2] toname=text[4] - message=CFPython.GetMessage(inv)[:-1]+'\n' + message=inv.Message[:-1]+'\n' mail.send(3, toname, fromname, message) else: print "ID: %d"%inv - print "Name: "+CFPython.GetName(inv) - inv=CFPython.GetNextObject(inv) + print "Name: "+inv.Name + inv=inv.Below for inv in idlist: - CFPython.RemoveObject(inv) + inv.Remove() diff --git a/santo_dominion/city_hall b/santo_dominion/city_hall index 776192e28..c70a04c49 100644 --- a/santo_dominion/city_hall +++ b/santo_dominion/city_hall @@ -277,8 +277,10 @@ y 2 end arch blue_dragon2 name Edwardo -event_say_plugin Python -event_say /python/IPO/banksay.py +arch event_say +title Python +slaying /python/IPO/banksay.py +end msg @match * Sorry I am on break, please come back later. @@ -804,9 +806,11 @@ y 13 end arch sign name Santo Dominion Message Board -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options Santo Dominion Board +arch event_say +title Python +slaying /python/IPO/board.py +name Santo Dominion Board +end msg I am a talking board, please say something to me. If you don't know what to say, say help. @@ -1674,10 +1678,14 @@ x 14 y 5 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 @@ -1726,9 +1734,11 @@ y 13 end arch sign name Petitions for the DMs -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options Petitions board +arch event_say +title Python +slaying /python/IPO/board.py +name Petitions board +end msg I am a talking board, designed for leaving messages for the DMs. If you don't know what to say, say help. @@ -2143,8 +2153,10 @@ y 3 end arch fatwoman name Betina -event_say_plugin Python -event_say /python/IPO/say.py +arch event_say +title Python +slaying /python/IPO/say.py +end stand_still 1 x 18 y 3 diff --git a/scorn/misc/cityhall b/scorn/misc/cityhall index eac84ae8d..d6b105073 100644 --- a/scorn/misc/cityhall +++ b/scorn/misc/cityhall @@ -2594,9 +2594,11 @@ y 1 end arch sign name Petitions for the DMs -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options Petitions board +arch event_say +title Python +slaying /python/IPO/board.py +name Petitions board +end msg I am a talking board, designed for leaving messages for the DM. If you don't know what to say, say help. diff --git a/scorn/shops/IPO_scorn b/scorn/shops/IPO_scorn index bd4c0ca03..5604c6687 100644 --- a/scorn/shops/IPO_scorn +++ b/scorn/shops/IPO_scorn @@ -117,10 +117,14 @@ x 1 y 4 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 @@ -184,8 +188,10 @@ y 2 end arch c_woman name Colette -event_say_plugin Python -event_say /python/IPO/say.py +arch event_say +title Python +slaying /python/IPO/say.py +end msg @match * I'm on a break. endmsg @@ -340,9 +346,11 @@ y 7 end arch sign name Scorn Message Board -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options Scorn board +arch event_say +title Python +slaying /python/IPO/board.py +name Scorn board +end msg I am a talking board, please say something to me. If you don't know what to say, say help. diff --git a/scorn/shops/bank b/scorn/shops/bank index 7d6746e03..f77007e0f 100644 --- a/scorn/shops/bank +++ b/scorn/shops/bank @@ -361,8 +361,10 @@ y 8 end arch woman name Nancy -event_say_plugin Python -event_say /python/IPO/banksay.py +arch event_say +title Python +slaying /python/IPO/banksay.py +end msg @match * Sorry I am on break, please come back later. diff --git a/scorn/taverns/goths b/scorn/taverns/goths index f758a9258..28ed7b019 100644 --- a/scorn/taverns/goths +++ b/scorn/taverns/goths @@ -1361,8 +1361,10 @@ y 1 end arch slotmachine2 name Gerty Gold -event_apply_plugin Python -event_apply /python/casino/goldslots.py +arch event_apply +title Python +slaying /python/casino/goldslots.py +end slaying food 0 x 5 @@ -1753,8 +1755,10 @@ y 1 end arch slotmachine3 name Sally Silver -event_apply_plugin Python -event_apply /python/casino/silverslots.py +arch event_apply +title Python +slaying /python/casino/silverslots.py +end slaying food 0 x 7 @@ -3805,8 +3809,10 @@ x 16 y 27 end arch man -event_say_plugin Python -event_say /python/IPO/seen.py +arch event_say +title Python +slaying /python/IPO/seen.py +end msg @match * Howdy diff --git a/templates/bungalo/bungalo1.tpl b/templates/bungalo/bungalo1.tpl index 9a081d39b..ec522c6fb 100644 --- a/templates/bungalo/bungalo1.tpl +++ b/templates/bungalo/bungalo1.tpl @@ -951,10 +951,14 @@ x 4 y 19 end arch mailbox -event_close_plugin Python -event_close /scorn/ImperialPost/send.py -event_apply_plugin Python -event_apply /scorn/ImperialPost/receive.py +arch event_close +title Python +slaying /scorn/ImperialPost/send.py +end +arch event_apply +title Python +slaying /scorn/ImperialPost/receive.py +end x 4 y 19 end diff --git a/templates/guild/guild_HQ b/templates/guild/guild_HQ index cadeda91b..bb1da152d 100644 --- a/templates/guild/guild_HQ +++ b/templates/guild/guild_HQ @@ -614,9 +614,11 @@ y 1 end arch sign name GuildMaster Message Board -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options GUILD_TEMPLATE_GM_board +arch event_say +title Python +slaying /python/IPO/board.py +name GUILD_TEMPLATE_GM_board +end msg I am a talking board, please say something to me. If you don't know what to say, say help. @@ -656,9 +658,11 @@ y 7 end arch crystalball name Guild Oracle -event_say_plugin Python -event_say /python/guilds/guildoracle.py -event_say_options GUILD_TEMPLATE +arch event_say +title Python +slaying /python/guilds/guildoracle.py +name GUILD_TEMPLATE +end name_pl Guild Oracle material 256 no_pick 1 @@ -697,8 +701,10 @@ y 13 end arch sign name GuildRankings -event_apply_plugin Python -event_apply /python/guilds/guildboard.py +arch event_apply +title Python +slaying /python/guilds/guildboard.py +end x 7 y 13 end diff --git a/templates/guild/hallofjoining b/templates/guild/hallofjoining index 6fd021396..bc0671e12 100644 --- a/templates/guild/hallofjoining +++ b/templates/guild/hallofjoining @@ -1843,9 +1843,11 @@ y 11 end arch trigger name Load -event_apply_plugin Python -event_apply /python/guilds/guildjoin.py -event_apply_options GUILD_TEMPLATE +arch event_apply +title Python +slaying /python/guilds/guildjoin.py +name GUILD_TEMPLATE +end msg Pull to add member to guild. endmsg diff --git a/templates/guild/mainfloor b/templates/guild/mainfloor index a7ddc58f4..cd3f7d11f 100644 --- a/templates/guild/mainfloor +++ b/templates/guild/mainfloor @@ -1057,9 +1057,11 @@ y 7 end arch beholder name Jack -event_say_plugin Python -event_say /python/guilds/guild_dues.py -event_say_options GUILD_TEMPLATE +arch event_say +title Python +slaying /python/guilds/guild_dues.py +name GUILD_TEMPLATE +end msg Sorry, I'm on my break. endmsg @@ -4504,9 +4506,11 @@ y 24 end arch sign name Guardian -event_say_plugin Python -event_say /python/guilds/guild_entry.py -event_say_options GUILD_TEMPLATE +arch event_say +title Python +slaying /python/guilds/guild_entry.py +name GUILD_TEMPLATE +end x 15 y 25 end @@ -8691,10 +8695,14 @@ x 30 y 5 end arch mailbox -event_close_plugin Python -event_close /python/IPO/send.py -event_apply_plugin Python -event_apply /python/IPO/receive.py +arch event_close +title Python +slaying /python/IPO/send.py +end +arch event_apply +title Python +slaying /python/IPO/receive.py +end material 0 weight 0 no_pick 1 @@ -8892,9 +8900,11 @@ x 31 end arch button_lever name The Big Lever -event_apply_plugin Python -event_apply /python/guilds/guildbuy.py -event_apply_options GUILD_TEMPLATE +arch event_apply +title Python +slaying /python/guilds/guildbuy.py +name GUILD_TEMPLATE +end msg Pull to establish this guild. endmsg @@ -8991,9 +9001,11 @@ y 7 end arch sign name Guild Message Board -event_say_plugin Python -event_say /python/IPO/board.py -event_say_options GUILD_TEMPLATE_board +arch event_say +title Python +slaying /python/IPO/board.py +name GUILD_TEMPLATE_board +end msg I am a talking board, please say something to me. If you don't know what to say, say help. @@ -9277,9 +9289,11 @@ x 32 y 28 end arch altar -event_apply_plugin Python -event_apply /python/guilds/guildbuy.py -event_apply_options GUILD_TEMPLATE +arch event_apply +title Python +slaying /python/guilds/guildbuy.py +name GUILD_TEMPLATE +end msg Please drop 5000 imperial notes for guild. endmsg diff --git a/unlinked/casino/casino_infernal b/unlinked/casino/casino_infernal index 91566f88d..a57f14c0b 100755 --- a/unlinked/casino/casino_infernal +++ b/unlinked/casino/casino_infernal @@ -236,8 +236,10 @@ msg Drop a platinum coin to play. endmsg title Slot -event_apply_plugin Python -event_apply /python/casino/platinumslots.py +arch event_apply +title Python +slaying /python/casino/platinumslots.py +end x 1 y 8 end @@ -262,8 +264,10 @@ name #4 msg Drop a gold coin to play. endmsg -event_apply_plugin Python -event_apply /python/casino/goldslots.py +arch event_apply +title Python +slaying /python/casino/goldslots.py +end title Slot x 1 y 10 @@ -290,8 +294,10 @@ msg Drop a silver coin to play. endmsg title Slot -event_apply_plugin Python -event_apply /python/casino/silverslots.py +arch event_apply +title Python +slaying /python/casino/silverslots.py +end x 1 y 12 end @@ -416,8 +422,10 @@ msg Drop a platinum coin to play. endmsg title Slot -event_apply_plugin Python -event_apply /python/casino/platinumslots.py +arch event_apply +title Python +slaying /python/casino/platinumslots.py +end x 2 y 8 end @@ -443,8 +451,10 @@ msg Drop a gold coin to play. endmsg title Slot -event_apply_plugin Python -event_apply /python/casino/goldslots.py +arch event_apply +title Python +slaying /python/casino/goldslots.py +end x 2 y 10 end @@ -470,8 +480,10 @@ msg Drop a silver coin to play. endmsg title Slot -event_apply_plugin Python -event_apply /python/casino/silverslots.py +arch event_apply +title Python +slaying /python/casino/silverslots.py +end x 2 y 12 end @@ -596,8 +608,10 @@ msg Drop a platinum coin to play. endmsg title Slot -event_apply_plugin Python -event_apply /python/casino/platinumslots.py +arch event_apply +title Python +slaying /python/casino/platinumslots.py +end x 3 y 8 end @@ -623,8 +637,10 @@ msg Drop a gold coin to play. endmsg title Slot -event_apply_plugin Python -event_apply /python/casino/goldslots.py +arch event_apply +title Python +slaying /python/casino/goldslots.py +end x 3 y 10 end @@ -650,8 +666,10 @@ msg Drop a silver coin to play. endmsg title Slot -event_apply_plugin Python -event_apply /python/casino/silverslots.py +arch event_apply +title Python +slaying /python/casino/silverslots.py +end x 3 y 12 end