SoftCode Despository

Softcode...

While the mush softcode is in a state of flux during the preparations for transition to 6th edition, my intention will be to store a copy (in pretty format) on or linked to this page. Basically a backup in case of data loss or an unexpected absence by myself. It's always been my aim to make the code open source, so as each coding project is completed I'll smarten up the presentation and post it on the actual mush website.

Code on website with URLs

Meetme System -- http://cm2051.dune.net/softcode/meetme

New Voting System -- http://cm2051.dune.net/softcode/voting

In Progress

Working on dice for now


 * 1) dice rolling commands for 6th edition                               #
 * 2) +1d3                                                                #
 * 3) +3d6                                                                #
 * 4) +3d6/CHA   cha                                                      #
 * 5) +3d6/OCV   ocv (or omcv)                                            #
 * 6) +3d6/PERC  nnn                                                      #
 * 7) +3d6/XXXX  nnn (generic skill check)                                #
 * 8) +m3d6      nnn                                                      #
 * 9) +m3d6/OCV  nnn/ocv                                                  #
 * 1) +m3d6      nnn                                                      #
 * 2) +m3d6/OCV  nnn/ocv                                                  #


 * 1) Also requires existence of some CM @functions                       #
 * 2) 1D6                                                               #
 * 3) ND6                                                               #
 * 4) ND6BODY                                                           #
 * 5) ND6STUN                                                           #
 * 1) ND6BODY                                                           #
 * 2) ND6STUN                                                           #


 * 1) rolls a 1D3 - will take +1d3 or +1/2d6 as command. Regexp required.  #
 * 2) syntax: +1d3                                                         #
 * 3)         +1/2d6                                                       #
 * 1) syntax: +1d3                                                         #
 * 2)         +1/2d6                                                       #

&CMD_1D3 Dice6E1 = $^(\+1/2D6|\+1D3)$:

@remit loc(%#) = [ansi(hr,***)] %B [ansi(hw,%N)] rolls %B [switch(%0,+1D3,1D3,1/2 D6)] %B and gets %B [@HC(div(add(setr(0,1D6),1),2))] %B \(Body = [ansi(hc,ND6BODY(0|%q0))]\)

@set Dice6E1/CMD_1D3=regexp


 * 1) rolls a characteristic roll for STR, DEX, CON, INT, or EGO using the   #
 * 2) value of the characteristic. Regexp required.                          #
 * 3) syntax: +3d6/STR     -- also DEX, CON, INT, EGO                    #
 * 1) syntax: +3d6/STR     -- also DEX, CON, INT, EGO                    #
 * 1) syntax: +3d6/STR     -- also DEX, CON, INT, EGO                    #

&CMD_3D6_CHR Dice6E1 = $^\+3d6/(STR|DEX|CON|INT|EGO) (.+)$:

@select [isint(%2)] [setq(0,ND6STUN(ND6(3)))] [setq(1,add(9,div(add(2,%2),5)))] [setq(2,sub(%q1,%q0))] =

0,{@pemit %# = Please enter an integer value for your [ucstr(%1)]},

{@remit loc(%#) = [ansi(hr,***)] [@HW(%N)] rolls 3D6 with [ucstr(%1)] of                    %B [@HY(%2)] getting [@HC(%q0)] which %B [switch(%q2,                            <0,                             [@HY(FAILS)] by [abs(%q2)],                             0,                             [@HG(MAKES)] Exactly,                             [@HG(MAKES)] by %q2                            ) ]  }

@set Dice6E1/CMD_3D6_CHR=regexp


 * 1) rolls a specified number of 3d6 and reports on the totals              #
 * 2) syntax: +m3d6 nnn     - input limited to 1-12                          #
 * 1) syntax: +m3d6 nnn     - input limited to 1-12                          #
 * 1) syntax: +m3d6 nnn     - input limited to 1-12                          #

&CMD_3D6_MULT Dice6E1 = $+m3d6 *:

@select [and(isint(%0),gte(%0,1),lte(%0,12))] =

0, {@pemit %# = Please enter an integer between 1 and 12 %B for the number of 3D6 to roll. },

{@remit loc(%#) = [ansi(hr,***)] %B [ansi(hw,%N)] rolls %0 x 3D6 and %B gets [ansi(hc,iter(lnum(%0),ND6STUN(ND6(3)),,%B))] }


 * 1) rolls a specified number of 3d6 against an OCV and reports on DCVs.    #
 * 2) syntax: +m3d6/OCV nnn/                                            #
 * 1) syntax: +m3d6/OCV nnn/                                            #
 * 1) syntax: +m3d6/OCV nnn/                                            #

&CMD_3D6_MULT_OCV Dice6E1 = $+m3d6/ocv */*:

@select [between(setr(A,trim(%0)),1,12)] [isint(setr(B,trim(%1)))] =

0*, {@pemit %# = Please enter an integer between 1 and 12 %B for the number of 3D6 to roll. },

10, {@pemit %# = Please enter an integer for the DCV value},

{@remit loc(%#) = [ansi(hr,***)] %B [ansi(hw,%N)] rolls %0 x 3D6 \(OCV %qA\) %B hitting [ansi(hy,DCVs)]\: %B [ansi(hy,iter(lnum(%qA), sub(add(11,%qB),                                    ND6STUN(ND6(3))), null, %B )                           )                       ]     }


 * 1) rolls 3d6 against a ocv/omcv and reports on (M)DCV hit                 #
 * 2) Requires Regexp.                                                       #
 * 3) syntax: +3d6/OCV  ocv                                                  #
 * 4)         +3d6/OMCV omcv                                                 #
 * 1) syntax: +3d6/OCV  ocv                                                  #
 * 2)         +3d6/OMCV omcv                                                 #

&CMD_3D6_OCV Dice6E1 = $^\+3d6/(OCV|OMCV|ECV) (.+)$:

@select [isint(%2)] [setq(0,ND6STUN(ND6(3)))] =

0,{@pemit %# = Please enter an integer value for your [ucstr(%1)]},

{@remit loc(%#) = [ansi(hr,***)] [@HW(%N)] rolls 3D6 with %B [ucstr(%1)] of [@HY(%2)] %B getting [@HC(%q0)] %B [switch(%1,                            OCV,                             and hitting DCV,                             OMCV,                             and hitting DMCV,                             and hitting DMCV                            ) ]                    %B [@HY(sub(add(11,%2),%q0))] }

@set Dice6E1/CMD_3D6_OCV=regexp


 * 1) rolls 3d6 against a generic target skill. The skill name can include   #
 * 2) spaces. use underscores in the command syntax to represent spaces      #
 * 3) syntax: +3d6/SKILL_NAME                                   #
 * 1) syntax: +3d6/SKILL_NAME                                   #
 * 1) syntax: +3d6/SKILL_NAME                                   #

&CMD_3D6_OTHER Dice6E1 = $+3d6/* *:

@break match(STR DEX CON INT EGO OCV ECV OMCV PERC PERCEPTION SKILL,             ucstr(trim(%0))             ) = {@@ these switches to +3D6 are handled in other commands @@} ; @select [isint(setr(0,trim(edit(%1,-,%B,<,%B))))] [setq(1,ND6STUN(ND6(3)))] [setq(2,sub(%q0,%q1))] = 0, {@pemit %#= Invalid entry for your skill level. %B Please see +help for this command. },   {@remit loc(%#) = [ansi(hr,***)] [@HW(%N)] rolls 3D6 with %B [@HY(ucstr(edit(%0,_,%B)))] %B of [@HY(%q0-)] getting [@HC(%q1)] which %B [switch(%q2,                             <0,                              [@HY(FAILS)] by [abs(%q2)],                              0,                              [@HG(MAKES)] Exactly,                              [@HG(MAKES)] by %q2                             ) ]   }


 * 1) rolls a 3d6 perception (or unnamed skill) check. Requires Regexp.      #
 * 2) syntax: +3d6/PERC        nnn                                           #
 * 3)         +3d6/PERCEPTION  nnn                                           #
 * 4)         +3d6/SKILL       nnn                                           #
 * 1)         +3d6/PERCEPTION  nnn                                           #
 * 2)         +3d6/SKILL       nnn                                           #

&CMD_3D6_SKILL Dice6E1 = $^\+3d6/(PERC|PERCEPTION|SKILL) (.+)$:

@select [setq(0,regedit(%2,\(\[0-9\]\+\)\(-|<\),$1))] [isint(%q0)] [setq(1,ND6STUN(ND6(3)))] [setq(2,sub(%q0,%q1))] = 0, {@pemit %# = Invalid entry for your skill level. %B Please see +help for this command. },   {@remit loc(%#) = [ansi(hr,***)] [@HW(%N)] rolls 3D6 with a                      %B [switch(%1,                             PERC,                              perception,                              PERCEPTION,                              perception,                              skill                             ) ]                     %B of [@HY(%q0-)] getting [@HC(%q1)] which %B [switch(%q2,                             <0,                              [@HY(FAILS)] by [abs(%q2)],                              0,                              [@HG(MAKES)] Exactly,                              [@HG(MAKES)] by %q2                             ) ]   }

@set Dice6E1/CMD_3D6_SKILL=regexp
 * 1) rolls 3d6 and reports the total                                        #
 * 2) syntax: +3d6                                                           #
 * 1) syntax: +3d6                                                           #
 * 1) syntax: +3d6                                                           #

&CMD_3D6_SNGL Dice6E1 = $+3d6:

@remit loc(%#) = [ansi(hr,***)] [@HW(%N)] rolls 3D6 and %B gets [@HC(ND6STUN(ND6(3)))]