Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
ZeroBudget
Newbie


Joined: 03 Aug 2006
Posts: 4

PostPosted: Thu Aug 03, 2006 12:33 am   

Auto-roller for Distant Lands
 
I'm kinda new to muds, and triggers in general, I have no Idea how to program them. I want to create an auto-roller for a Mud called Distant Lands (www.dl2.net)

The rolling screen looks like this(though it's much better spaced) :
STR INT WIS DEX CON CHR LCK
1) 13 11 11 9 9 12 11
2) 14 10 10 6 6 10 13
3) 14 10 15 11 10 16 14
4) 11 9 13 8 8 9 8
5) 13 9 12 14 7 12 10
6) 7 9 14 8 6 12 15

[Select 1-6, q to quit, h for help, or enter for more choices]:

Highest roll is 18 in each category. I use zMud version 7.04 currently. I can pick classes and races later. I would really like something I could copy and paste.

Thanks for any input you can offer!
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Thu Aug 03, 2006 12:54 am   
 
Can you say what you want to actually be done? We could assume that you want have it keep rolling until a certain set of numbers within range or of all 18s appears, but then that would be assuming.
Reply with quote
ZeroBudget
Newbie


Joined: 03 Aug 2006
Posts: 4

PostPosted: Thu Aug 03, 2006 12:56 am   
 
You got it right on the money, 16+ is usually suitable. I want it cause it took me almost two hours to get a decent roll last time... So I want it to keep rolling automatically till it finds a good roll, and then ask me what I want to do, accept it, or keep rolling.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Aug 03, 2006 2:53 am   
 
#CLASS autoroller
#TRIGGER {STR INT WIS DEX CON CHR LCK} {#VAR bestroll {0};#VAR bestrolltotal {0}}
#TRIGGER {(%d)~) (%d) (%d) (%d) (%d) (%d) (%d)} {#IF (%2 >= 16 & %3 >= 16 & %4 >= 16 & %5 >= 16 & %6 >= 16 & %7 >= 16) {#IF (%eval(%2 + %3 + %4 + %5 + %6 + %7) > @bestrolltotal) {#VAR bestroll {%1};#VAR bestrolltotal {%eval(%2 + %3 + %4 + %5 + %6 + %7)}}}}
#TRIGGER {~[Select 1-6, q to quit, h for help, or enter for more choices~]:} {#IF (@bestroll = 0) {#CR} {#IF (%prompt("y", %concat("Roll ", @bestroll, " was found to be suitable. Do you want to accept it [y/n]?")) = "y") {#SEND @bestroll} {#CR}}} "" {nocr|prompt}
#CLASS 0

You'll have to insert %s in the patterns where you expect multiple spaces.
_________________
Kjata
Reply with quote
ZeroBudget
Newbie


Joined: 03 Aug 2006
Posts: 4

PostPosted: Thu Aug 03, 2006 2:54 am   
 
cool, where in the code does that have to go, in the trigger statement, or in the #IF statements?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Aug 03, 2006 3:16 am   
 
Put any %s that are needed in the trigger patterns instead of the spaces. The patterns are what is inside the first set of curly braces after each #TRIGGER command, like:

STR INT WIS DEX CON CHR LCK

So, let's assume for example that between each attribute name there may be multiple spaces, the pattern would then look like:

STR%sINT%sWIS%sDEX%sCON%sCHR%sLCK
_________________
Kjata
Reply with quote
ZeroBudget
Newbie


Joined: 03 Aug 2006
Posts: 4

PostPosted: Thu Aug 03, 2006 12:29 pm   
 
Cool, I think I got it, Thanks very much!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net