Viewing paste LEADFIN
made on Fri, 01 Nov 2013 14:43:59 -0400
Sane-itized version, click to copy:
&LEADER.CMD #3629=$leader *:@pemit %#={[setq(v,[u(char.name,%#)])][setq(n,[u(PARTY.MEMBER.REFERENCE,%0)])][setq(b,[name(%#)]_VOTED_LEADER)][ifelse([strmatch(%qn,-1)],{No one in the party by that name or #.},[ifelse([and(lte(u(voting),0),[u(is.leader,u(party.member.player,u(party.member.reference,%0)))])],{That person is already the leader.},{[ifelse([lte(u(voting),0)],{[wipe(me/*_VOTED_LEADER)][wipe(me/VOTES_FOR_*)][set(me,%qb:%qn)][set(me,voting:20)][set(me,voting.on:leadership)][oemit(me,%qv calls a vote on party leadership[c(44)] nominating [u(PARTY.MEMBER.NAME,%qn)].)][setq(t,0)]},{[ifelse(not(strmatch(u(voting.on),leadership)),{The party is not voting on that topic.  Right now[c(44)] the vote is about the topic of [u(voting.on)].},{[ifelse(eq(strlen(u(%qb)),0),{[set(me,%qb:%qn)][oemit(me,%qv nominates [u(PARTY.MEMBER.NAME,%qn)].)]},{[set(me,%qb:%qn)][oemit(me,%qv reconsiders and chooses to nominate [u(PARTY.MEMBER.NAME,%qn)].)]})]})]})]})])]}

Enter a target attribute, object reference and the mushcode.


$leader *:@pemit %#={
 [setq(v,[u(char.name,%#)])]
 [setq(n,[u(PARTY.MEMBER.REFERENCE,%0)])]
 [setq(b,[name(%#)]_VOTED_LEADER)]
 [ifelse([strmatch(%qn,-1)],
  {
   No one in the party by that name or #.
  },
  [ifelse([and(lte(u(voting),0),[u(is.leader,u(party.member.player,u(party.member.reference,%0)))])],
  {
   That person is already the leader.
  },{
  [ifelse([lte(u(voting),0)],
   {
    [wipe(me/*_VOTED_LEADER)]
    [wipe(me/VOTES_FOR_*)]
    [set(me,%qb:%qn)]
    [set(me,voting:20)]
    [set(me,voting.on:leadership)]
    [oemit(me,%qv calls a vote on party leadership[c(44)] nominating [u(PARTY.MEMBER.NAME,%qn)].)]
    [setq(t,0)]
   },
   {
    [ifelse(not(strmatch(u(voting.on),leadership)),
     {
      The party is not voting on that topic.  Right now[c(44)] the vote is about the topic of [u(voting.on)].
     },
     {
      [ifelse(eq(strlen(u(%qb)),0),
       {
        [set(me,%qb:%qn)]
        [oemit(me,%qv nominates [u(PARTY.MEMBER.NAME,%qn)].)]
       },
       {
        [set(me,%qb:%qn)]
        [oemit(me,%qv reconsiders and chooses to nominate [u(PARTY.MEMBER.NAME,%qn)].)]
       }
      )]
     }
    )]
   }
  )]
  })]
 )]
}

save as: imprettify (attempt to format for readibility):
Found this useful? Try MUSHcode Repeater
written by orcs.biz