My character roller

Scripts and support for your favorite MUD client.
Shaiith
Sojourner
Posts: 33
Joined: Tue Feb 15, 2005 2:07 pm

My character roller

Postby Shaiith » Fri Jul 10, 2009 12:32 pm

With the advent of restat, this isn't that useful unless you're rolling a warrior type and want 4 perfects (yes it is possible, it will take you approximately 3 weeks of nonstop 24/7 rolling though). I fully acknowledge that my rolling for a 100 elf caster str instead of accepting a 97 is of fairly marginal benefit. (I'll also likely lose an inventory slot versus restat as I probably won't have a 59 dex). I've left name generation and stat boosting manual.

There are a lot of comments throughout the code, it's written for tintin++ 1.99.6, but it should be fairly portable. I've commented out all the logging that I do by default as you may not want that (it doesn't slow down performance, but your filesystem or data gathering may be different.

If you have questions feel free to ask, I'm probably going to clean up the code a bit as I just tossed this together last night.


Code: Select all

#nop Character Roller by Sservis.  Copyright 2009.  All rights reserved.
#nop
#nop You're able to specify things like, give me any character that can be
#nop increased to 3 perfects, 1 mighty.  I prefer to do the swapping and
#nop boosting manually as the knowledge that a caster mighty int is at
#nop least 90 (as opposed to the generic assumption that mighty is at least
#nop 88).  The code just pauses the rolling process and keeps the
#nop connection alive when a match is found, change the found_match alias
#nop if you want to do swaps and such yourself.
#nop
#nop This version has all logging disabled, find the #nop #log and
#nop #nop #line items and remove the #nop to enable.
#nop
#nop I also have not implemented auto-reconnection.  Change the
#nop start_roller alias if you connect with something other than #session



#nop Settings, you shouldn't need to change anything outside this area

#nop The selection variables are defined at the end of this file.  The
#nop choices at the various prompts will be made automatically.  See the
#nop definitions to clarify what to put in.

#var race_selection grey;

#var class_selection inv;

#nop align_selection should be L, N, C, G, E if only one dimension is
#nop needed for the specific race/class.  If both are needed it should be
#nop LG, NN, CE, etc.
#var align_selection L;

#var home_selection Waterdeep;

#var gender_selection male;

#var change the default password to something else.
#var password XXXXXX;

#nop stats_accept is a list of lists. Each one specifies a minimum stat
#nop acceptance level.  If rolled stats match any of these, the character
#nop will be accepted.
#nop
#nop An item {{1}{0}{2}{0}{0}{0}{0}{0}} specifies that any character with
#nop at least one perfect or higher and two mighty or higher (includes the
#nop perfect counted on the perfect check)
#nop                 p  h  m  g  f  a  m  b
#var stats_accept {
                   {{3}{3}{3}{3}{4}{0}{0}{0}}
                   {{2}{3}{3}{4}{0}{0}{0}{0}}
                   {{2}{2}{4}{0}{0}{0}{0}{0}}
                   {{1}{3}{4}{0}{0}{0}{0}{0}}
                  };

#nop nothing should need to be changed below here




#nop tintin++ specific settings, these may not be needed, but it's what I use.
#config log plain;
#config {command echo} off;
#config {packet patch} 1;
#config {wordwrap} off;
#split 1;





#nop actions to drive the rolling process, the work takes place in
#nop check_stats.  Listed in order of encounter in rolling.
#act {^Please enter your term type (<CR> ansi, '?' help):} {#cr};
#act {^Do you wish to create a new character? Y/N} {Y};
#act {^Your selection} {${race_${race_selection}}};
#act {^Class selection menu} {${class_${class_selection}}};
#act {^Alignment Selection} {${align_${align_selection}}};
#act {^Hometown Selection} {${home_${home_selection}}};
#act {^Strength:        %1 Power:           %2} {register_stat str %1; register_stat pow %2};
#act {^Dexterity:       %1 Intelligence:    %2} {register_stat dex %1; register_stat int %2};
#act {^Agility:         %1 Wisdom:          %2} {register_stat agi %1; register_stat wis %2};
#act {^Constitution:    %1 Charisma:        %2} {register_stat con %1; register_stat cha %2};
#act {^To swap stats: enter the first stat name folowed by the second stat} {check_stats};
#act {^Is your character Male or Female} {$gender_${gender_selection}};
#act {^Do you understand and agree with these conventions} {Y};
#act {^You wish to be known as %1 (Y/N)} {#var name {%1};Y};
#act {^Please enter a password for} {$password};
#act {^Please retype password} {$password;Y};
#act {^*** PRESS RETURN:} {#cr;1;score;att;check str;check agi; check dex; check con; check pow; check int; check wis; check cha;quit;Yes;0};
#nop #act {^Score information for} {#log o {${race_selection}_${class_selection}_${name}}};





#nop variables that help make the selections at the various menus
#nop home_* is not a complete list.
#var race_human a;
#var race_barb b;
#var race_drow c;
#var race_grey d;
#var race_dwarf e;
#var race_duergar f;
#var race_halfling g;
#var race_gnome h;
#var race_ogre i;
#var race_troll j;
#var race_half k;
#var race_illithid p;
#var race_yuan q;
#var race_orc r;

#var class_war a;
#var class_ran b;
#var class_pal d;
#var class_a-p e;
#var class_cle f;
#var class_dru h;
#var class_sha i;
#var class_nec k;
#var class_ele l;
#var class_bar p;
#var class_psi q;
#var class_enc r;
#var class_inv s;
#var class_bat t;
#var class_rog u;
#var class_ill v;
#var class_bat w;

#var align_LG {L;G};
#var align_LN {L;N};
#var align_LE {L;E};
#var align_NG {N;G};
#var align_NN {N;N};
#var align_NE {N;E};
#var align_CG {C;G};
#var align_CN {C;N};
#var align_CE {C;E};
#var align_L {L};
#var align_N {N};
#var align_C {C};
#var align_G {G};
#var align_E {E};

#var home_Waterdeep 1;
#var home_Calimport 11;
#var home_BaldursGate 14;

#var gender_male M;
#var gender_female F;



#var some calculation variables to aid the decision process
#var bad_cnt 0;
#var mundane_cnt 0;
#var average_cnt 0;
#var fair_cnt 0;
#var good_cnt 0;
#var mighty_cnt 0;
#var heroic_cnt 0;
#var perfect_cnt 0;

#nop these track the actual stat levels, register stat sets these
#var str 0;
#var dex 0;
#var agi 0;
#var con 0;
#var pow 0;
#var int 0;
#var wis 0;
#var cha 0;

#var bad     0;
#var mundane 1;
#var average 2;
#var fair    3;
#var good    4;
#var mighty  5;
#var heroic  6;
#var perfect 7;

#nop loop internal variables, habit to declare everything.
#var should_accept 0;
#var comp_list nop;
#var name nop;

#nop start the roller
#ali start_roller #SESSION roller torilmud.org 9999;

#nop sets the stat and *_cnt variables.
#ali register_stat {#var %1 ${%2};#math {%2_cnt} {${%2_cnt} + 1}};

#nop handles the work of checking if the current stats are good enough.
#ali check_stats
{
  #nop log the stats to stats_<class> to ensure that I can audit my
  #nop rolling targets to ensure feasiblity.
  #nop #line log {stats_${class_selection}} {${perfect_cnt}${heroic_cnt}${mighty_cnt}${good_cnt}${fair_cnt}${average_cnt}${mundane_cnt}${bad_cnt}};

  #nop transform the counts from how many of exactly this stat to how many
  #nop of this stat or higher.
  #math {heroic_cnt}  {${heroic_cnt}  + ${perfect_cnt}};
  #math {mighty_cnt}  {${mighty_cnt}  + ${heroic_cnt}};
  #math {good_cnt}    {${good_cnt}    + ${mighty_cnt}};
  #math {fair_cnt}    {${fair_cnt}    + ${good_cnt}};
  #math {average_cnt} {${average_cnt} + ${fair_cnt}};
  #math {mundane_cnt} {${mundane_cnt} + ${average_cnt}};
  #math {bad_cnt}     {${bad_cnt}     + ${mundane_cnt}};

  #nop create a list for comparison to the goal lists
  #var comp_list {{$perfect_cnt}{$heroic_cnt}{$mighty_cnt}{$good_cnt}{$fair_cnt}{$average_cnt}{$mundane_cnt}{$bad_cnt}};

  #nop loop over the acceptance cases
  #forall {$stats_accept}
  {
    #var stats_tmp {&0};
    #var current_accept 1;

    #nop loop over the different stat levels (mighty or higher, etc)
    #loop {1 8}
    {
      #if {$stats_tmp[&&0]>$comp_list[&&0]} {#var current_accept 0} {#nop}
    };

    #if {$current_accept==1}
      {#var should_accept 1}
      {#nop}
  };

  #if {$should_accept==1}
    {found_match}
    {#cr};

  #nop reset for the next run
  #var perfect_cnt 0;
  #var heroic_cnt  0;
  #var mighty_cnt  0;
  #var good_cnt    0;
  #var fair_cnt    0;
  #var average_cnt 0;
  #var mundane_cnt 0;
  #var bad_cnt 0;
}

#nop handle that's called when a match is found, currently goes into
#nop zombie keepalive mode
#ali found_match {#ali check_stats #nop;#tick keepalive {\?} 60}

#nop used to stat the character so that I have a record of the exact stats
#ali check {checkpoints %1 100};

#nop start the roller
start_roller;
Harlindral group-says 'but, im very powerful'
kanenan
Sojourner
Posts: 227
Joined: Sat Oct 05, 2002 5:01 am
Location: BC
Contact:

Re: My character roller

Postby kanenan » Fri Jul 10, 2009 6:39 pm

<3 the manual swaps/adjusts + connection sustain!
stuff.
Shaiith
Sojourner
Posts: 33
Joined: Tue Feb 15, 2005 2:07 pm

Re: My character roller

Postby Shaiith » Fri Jul 10, 2009 10:37 pm

I'm an idiot to ascii slang. I'm not sure if <3 intimates that my choices were good or bad from your perspective. Anyway here's the rationale from mine.

Manual swaps are in as there's an advantage to doing it yourself. The bonuses have value 6, 4, and 2 (write a roller that rolls for an exact 65 or 75, then accept, apply bonuses, use checkpoints to see what it turned out to be, only takes 3 such characters). Knowing this and where a stat came from can be useful.

The elf con notch for rogues is 87. (75 + 12 = 87 on the nose, and it's possible to hit a 75 on the nose and know it for sure in two stats). Also, good + third bonus is enough to hit the notch even if the stat stays good.

The illithild last con notch is 92 (a mighty initially in pow or int + third bonus = guaranteed notch with only the third bonus, even though it'll often stay mighty)

The ogre last agi notch is 98 (last con notch below 100 is 99). Attempting to slightly boost a stat towards perfect but being willing to accept a slight imperfection affects the order in which you apply the bonuses. (Ogre warriors aren't taken to zones to tank, so maxcon and maxagi gear won't be used on them, so 99 is probably good enough)

The yuanti/drow/halfelf nontank con notch is 78 (fair = 76 or better + third bonus = guaranteed notch)

The human/gnome/orc nontank con notch is 74, (average + first and third bonus ensures the notch even if it stays average, no need to use first and second and get a fair)

There are a lot of these cases that you can exploit to get slightly better stats or to ensure that you hit your con notch (always a good thing) at a minimum cost.

These really only come into play when you're rolling for very hard stat combinations or you want to squeeze every last point out.

Also you might have a spare bonus or two and have a preferred place to put it. Automated logic can fail here as where might depend on what the other stats are (do you have extra con notches already for prot res fail, ok pump dex for inventory slots, if not pump con, etc)

All these special cases are highly dependant on specific race/class choice. Coding all the special cases is more work than reasoning them out if they occur.

The connection keepalive is not in as that is definitely client dependant as is loading scripts in the first place. Plus I didn't find a good method last night.


PS- Rolling is still worth it if you put in a lot of time, 350 useful points is not hard to beat.

edit: corrected ogre agi notch, if I'm quoting specific numbers they should be right
Last edited by Shaiith on Fri Jul 10, 2009 10:47 pm, edited 1 time in total.
Harlindral group-says 'but, im very powerful'
Shaiith
Sojourner
Posts: 33
Joined: Tue Feb 15, 2005 2:07 pm

Re: My character roller

Postby Shaiith » Fri Jul 10, 2009 10:43 pm

I just realized that I could say all of that much easier.

Automated bonuses (oops failed to hit targets when manual could have) and waiting for user bonuses (oops mud crash) cause more rolls per accepted characters in different ways. However user bonuses allow a potentially higher bound on stats (there is some sort of stat cap based on my data), even if just by 3 or 4 in your 5th best stat.

In any case, restat works for most people, so if you're bothering to roll today, my opinion is that you should be doing manual bonuses.
Harlindral group-says 'but, im very powerful'

Return to “MUD Client Help”

Who is online

Users browsing this forum: No registered users and 12 guests