Viewing paste LEAD1
made on Fri, 01 Nov 2013 13:42:50 -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(a,VOTES_LEADER_%qn)][setq(b,[name(%#)]_VOTED_LEADER)][ifelse([strmatch(%qn,-1)],{No one in the party by that name or #.},[ifelse([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_LEADER_*)][set(me,%qa:1)][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,%qa:[add(%qa,1)])][set(me,%qb:%qn)]%qv nominates [u(PARTY.MEMBER.NAME,%qn)].},{[setq(4,VOTES_LEADER_[u(%qb)])][setq(5,[u(%q4)])][set(me,%q4:[sub(%q5,1)])][set(me,%qb:%qn)]%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(a,VOTES_LEADER_%qn)]
 [setq(b,[name(%#)]_VOTED_LEADER)]
 [ifelse([strmatch(%qn,-1)],
  {
   No one in the party by that name or #.
  },
  [ifelse([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_LEADER_*)]
    [set(me,%qa:1)]
    [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,%qa:[add(%qa,1)])]
        [set(me,%qb:%qn)]
        %qv nominates [u(PARTY.MEMBER.NAME,%qn)].
       },
       {
        [setq(4,VOTES_LEADER_[u(%qb)])]
        [setq(5,[u(%q4)])]
        [set(me,%q4:[sub(%q5,1)])]
        [set(me,%qb:%qn)]
        %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