Jump to content

Pyton Dice Roll Email Filter


Recommended Posts

Guest Black Lotus

Re: Pyton Dice Roll Email Filter

 

I like it, although I know almost nothing about source code (or any code, ha ha) and the like. Still, I'd be willing to give it a go. Dice rollers are always good.

Link to comment
Share on other sites

Guest Black Lotus

Re: Pyton Dice Roll Email Filter

 

I use Thunderbird, so it should work. Not sure if I know how to do the required modifications, though.

Link to comment
Share on other sites

Re: Python Dice Roll Email Filter

 

How it's used:

 

So you are on a mailing list suchas CoolHeroPBEM@sweetdomain.com. This is where you conduct all your PBEM emailing.

 

Now, normally any message goes to that list, on sweetdomain.com's server, and then gets parsed out to the individual members. This script gets inserted into that process, so that any dice roll expression gets evaluated before it is sent off.

 

Typically on such a server you would have a mail aliases file that says something like:

 

CoolHeroPBEM: "| /path/to/mailinglistmanager"

 

You would change that to:

 

CoolHeroPBEM: "| /path/to/rollerscript | /path/to/mailinglistmanager"

 

Alternatively, if your mail is stored on server which allows personal procmail handling you should have a .procmailrc file in your home directory. If so, you could add this to the file:

 

:0 fHw

* ^Subject.*rollit

| /path/to/rollerscript

 

The drawback to the personal procmail solution is that only messages sent to you get parsed. But using the mailing list feature, everyone will see the roll as it's delivered.

 

This isn't something you can just add to any email client (although that would be a pretty cool Thunderbird plug-in). This is a python script, that needs a python environment and either a list server or procmail to run.

 

The general syntax is as follows (not case-sensitive):

roll[text label,die expression]

text label = any text string

die expression = any combination of XdYz, (), +, -, *, / where X is a number of dice to roll, Y is the number of sides, and z represents a limited set of options

 

'Y' Side Symbols

dF = Fudge Dice

d%o = d100 open-ended high & low

d%l = d100 open-ended low

d%h = d100 open-ended high

 

'z' Options

: = open-ended all dice total (e.g. Deadlands/HoE damage)

; = open-ended all dice total, but each open-ended die is -1 (e.g. used in Hackmaster for damage)

@ = open-ended highest die (e.g. Deadlands/HoE skill test)

B = calculate Body (e.g. Hero System)

L = count sixes (e.g. Hero Luck)

w = Savage Worlds 1d6 wild die (e.g. SW standard skill test)

x = Savage Worlds 1d10 wild die (e.g. SW master skill test)

You can put the roll function anywhere in your message and the result will be substituted. For verity, a log of the rolls as processed is attached to the end of the message.

 

EXAMPLE FUNCTIONS:

ro11[d20 attack,1d20]

ro11[damage,(1d4+2)*5]

ro11[fudge,4df]

ro11[1d12,1d12]

ro11[1d100,1d100]

ro11[1d10000,1d10000]

ro11[harp,1d%o]

ro11[rmlow,1d%l]

ro11[rmhi,1d%h]

ro11[open total, 4d4:]

ro11[open-1, 1d6;]

ro11[open highest, 4d6@]

ro11[hero,4d6b]

ro11[luck,5d6l]

ro11[savage normal,1d8w]

ro11[savage master,1d4x]

 

ACTUAL RESULTS:

d20 attack (1d20): 16

damage ((1d4+2)*5): 25

fudge (4df): 1

1d12 (1d12): 8

1d100 (1d100): 10

1d10000 (1d10000): 1895

harp (1d%o): 18

rmlow (1d%l): 74

rmhi (1d%h): 17

open total ( 4d4:): 8

open-1 ( 1d6;): 4

open highest ( 4d6@): 5

hero (4d6b): 11 STUN, 3 BODY

luck (5d6l): 0

savage normal (1d8w): 4

savage master (1d4x): 6

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...