Zmud roller, May 2018

Scripts and support for your favorite MUD client.
Inama
Sojourner
Posts: 877
Joined: Wed Sep 15, 2010 8:45 pm

Zmud roller, May 2018

Postby Inama » Wed May 30, 2018 9:05 pm

Scroll to the bottom, updated version, progress information and better handling keeping connection live till you discover its stopped.

You type roll with your minimum stat requirements. For example if you want four 100s, for a blackguard, they have minimum wisdom 50, and int 40, you'd type:
roll 40 50 100 100 100 100
This will give some false positives, it only check if you're 12 or more away from target, bonuses to stats add up to 12.
Lilithelle

Code: Select all

#alias roll {
#T+ Roller
#var num %concat( %-1, " 0 0 0 0 0 0 0 0")
#var num %subregex( @num, "\s+", "|")
#var temp ""
#forall @num {#var temp %additem( %rightback( %concat( "00", %i), 3), @temp)}
#var temp %rightback( %sort( @temp), 31)
}
#CLASS {Roller} {disable}
#TRIGGER {^Strength:%s(%d)%sPower:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  }
#TRIGGER {^You may choose to reroll your character at this time.} {
  #var num %sort( @num)
  #var output 0
  #loop 8 {#add output %max( %eval( %concat( %item( @temp, %i), "-", %item( @num, %i))), 0)}
  #say @output short of target.
  #if (@output > 12) {yes} {
    #t- Roller
    #alarm -180 {pow cha}
    #temp {^Accepting these stats.} {#untrigger -180}
    }
  }
#TRIGGER {^Your basic stats:} {#var num ""}
#TRIGGER {^Dexterity:%s(%d)%sIntelligence:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  }
#TRIGGER {^Agility:%s(%d)%sWisdom:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  }
#TRIGGER {^Constitution:%s(%d)%sCharisma:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  }
#CLASS 0
Last edited by Inama on Tue Jul 10, 2018 4:26 am, edited 1 time in total.
Inama
Sojourner
Posts: 877
Joined: Wed Sep 15, 2010 8:45 pm

Re: Zmud roller, May 2018

Postby Inama » Fri Jun 22, 2018 2:33 am

I worked out a way to cut and paste this into zmud on the command line, each of these 8 things has to be entered on a separate command line.

Code: Select all

#class {roller} {disable}

Code: Select all

#TRIGGER {^Strength:%s(%d)%sPower:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  } {roller}

Code: Select all

#TRIGGER {^You may choose to reroll your character at this time.} {
  #add NoRolls 1
  #var num %sort( @num)
  #var output 0
  #loop 8 {#add output %max( %eval( %concat( %item( @temp, %i), "-", %item( @num, %i))), 0)}
  #say @output short of target.
  #if (@output < @time) {
    #var time @output
    #var StatsMin %subchar( @num, "|", " ")
    }
  #if (@output > 12) {yes} {
    #t- Roller
    #alarm -180 {
      pow cha
      #echo swapping power and charisma
      }
    #temp {^Accepting these stats.} {#untrigger -180}
    }
  } {roller}

Code: Select all

#TRIGGER {^Your basic stats:} {#var num ""} {roller}

Code: Select all

#TRIGGER {^Dexterity:%s(%d)%sIntelligence:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  } {roller}

Code: Select all

#TRIGGER {^Agility:%s(%d)%sWisdom:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  } {roller}

Code: Select all

#TRIGGER {^Constitution:%s(%d)%sCharisma:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  } {roller}

Code: Select all

#ALIAS roll {
  #untrigger -180
  #T+ Roller
  #var num %concat( %-1, " 0 0 0 0 0 0 0 0")
  #var num %subregex( @num, "\s+", "|")
  #var temp ""
  #forall @num {#var temp %additem( %rightback( %concat( "00", %i), 3), @temp)}
  #var temp %rightback( %sort( @temp), 31)
  #var NoRolls {0}
  #var time {800}
  #status Rolls: @NoRolls Closest: @StatsMin Difference: @time
  }
Inama
Sojourner
Posts: 877
Joined: Wed Sep 15, 2010 8:45 pm

Re: Zmud roller, May 2018

Postby Inama » Tue Jul 10, 2018 4:38 am

Paste each of these 9 code snippets into the command line, one at a time.

Code: Select all

#class {roller} {disable}

Code: Select all

#TRIGGER {^Your basic stats:} {#var num ""} {roller}

Code: Select all

#TRIGGER {^Agility:%s(%d)%sWisdom:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  } {roller}

Code: Select all

#TRIGGER {^Constitution:%s(%d)%sCharisma:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  } {roller}

Code: Select all

#TRIGGER {^Dexterity:%s(%d)%sIntelligence:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  } {roller}

Code: Select all

#TRIGGER {^Strength:%s(%d)%sPower:%s(%d)} {
  #var num %additem( %rightback( %concat( "00", %1), 3), @num)
  #var num %additem( %rightback( %concat( "00", %2), 3), @num)
  } {roller}

Code: Select all

#TRIGGER {^Accepting these stats.} {
  #untrigger +180
  #status ""
  #t- Roller
  } {roller}

Code: Select all

#TRIGGER {^You may choose to reroll your character at this time.} {
  #add NoRolls 1
  #var num %sort( @num)
  #var output 0
  #loop 8 {#add output %max( %eval( %concat( %item( @temp, %i), "-", %item( @num, %i))), 0)}
  #say @output short of target.
  #if (@output < @time) {
    #var time @output
    #var StatsMin %subchar( @num, "|", " ")
    }
  #if (@output > 12) {yes} {
    #echo Character rolling complete.
    #untrigger +180
    #alarm +180 {cha pow}
    }
  } {roller}

Code: Select all

#ALIAS roll {
#untrigger +180
#T+ Roller
#var num %concat( %-1, " 0 0 0 0 0 0 0 0")
#var num %subregex( @num, "\s+", "|")
#var temp ""
#forall @num {#var temp %additem( %rightback( %concat( "00", %i), 3), @temp)}
#var temp %rightback( %sort( @temp), 31)
#var NoRolls {0}
#var time {800}
#status Rolls: @NoRolls Closest: @StatsMin Difference: @time
}
User avatar
Razhak
Sojourner
Posts: 1
Joined: Tue Oct 09, 2018 4:07 pm

Re: Zmud roller, May 2018

Postby Razhak » Tue Oct 09, 2018 4:08 pm

Does the order of the numbers matter? like 40 50 100 100 100 100 or 100 100 100 100 40 50
Inama
Sojourner
Posts: 877
Joined: Wed Sep 15, 2010 8:45 pm

Re: Zmud roller, May 2018

Postby Inama » Wed Jun 10, 2020 5:34 am

Pretty sure it does not, I sort them before using them.

Return to “MUD Client Help”

Who is online

Users browsing this forum: No registered users and 1 guest