| version 1.2 | | version 1.3 |
|---|
| | |
| import shelve | | import shelve |
| import random | | import random |
| | | |
| import CFgetPaths | | import CFPython |
| | | |
| class SlotMachine: | | class SlotMachine: |
| #sets up the file that holds all the slotmachine jackpots | | #sets up the file that holds all the slotmachine jackpots |
| #make sure this points to your writable var/crossfire directory | | #make sure this points to your writable var/crossfire directory |
| #you can delete that file to reset all the slotmachine jackpots | | #you can delete that file to reset all the slotmachine jackpots |
| slotfile = '%sSlotMachine_file' %(CFgetPaths.getPaths("localdir")) | | slotfile = os.path.join(CFPython.GetLocalDirectory(),'SlotMachine_file') |
| slotdb = {} | | slotdb = {} |
| def __init__(self,slotname,slotlist,minpot,maxpot): | | def __init__(self,slotname,slotlist,minpot,maxpot): |
| slotdb = shelve.open(self.slotfile) | | slotdb = shelve.open(self.slotfile) |