RPTools.net

Discussion and Support

Skip to content

It is currently Sat Jul 22, 2017 1:43 pm 






Reply to topic  [ 1 post ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Kobold
 
Joined: Sat Dec 05, 2009 12:00 pm
Posts: 1
 Post subject: Exalted Die Roller
PostPosted: Sat Dec 05, 2009 12:11 pm 
I am new to Maptools so I apologize for any stupid questions. Based on some others work here I have customized a dice roller for Exalted:

Code:
[h: inputString="numDice|1| How many dice to roll?|TEXT"]
[h: inputString2 = "difficulty|7|Enter Difficulty|TEXT"]
[h: status=input(inputString,inputString2)]
[h: abort(status)]

[h: diceArray='[]']
[h: i=0]
[h, while(i <numDice), CODE:{
    [h: theRoll=1d10]
    [h: diceArray=json.append(diceArray,theRoll)]
    [h: i=i+1]
}]

[h: diceArray=json.sort(diceArray)]

[h: txtResult='']
[h: numSuccess=0]
[h: numFail=0]
[h: numFumble=0]

[count(json.length(diceArray)), CODE:{
    [h: thedie=json.get(diceArray,roll.count)]
    [h,IF((thedie >=difficulty )&&(thedie <10 )),CODE:{
        [h: numSuccess=numSuccess+1]
        [h: color='green']
    }]
    [h,IF(thedie ==10),CODE:{
        [h: numSuccess=numSuccess+2]
        [h: color='green']
    }]
    [h,IF(thedie ==1),CODE:{
        [h: numFumble=numFumble+1]
        [h: color='red']
    }]
    [h,IF((thedie>=2)&&(thedie<difficulty)), CODE:{
        [h: color='black']
        [h: numFail=numFail+1]
    }]
    <font color=[r: color]> [r: thedie] </font>
}]

[h,IF(numSuccess>0), CODE:{
    [h: txtResult=' Success!']
    [h: color='green']
}]

[h,IF((numFumble>0)&&(numSuccess==0)), CODE:{
    [h: txtResult=' BOTCHED!']
    [h: color='red']
}]

[h,IF((numFail>0)&&(numSuccess==0)&&(numFumble==0)), CODE:{
    [h: txtResult=' Failed!']
    [h: color='red']
}]

<font color=[r: color]>[r: txtResult] ([r: numSuccess])


I have two questions:

One, sometimes the font tags work and sometimes they don't even if I hardcode them. Guessing it might be some other setting somewhere. They worked while I was working on the script, but not the next day when I restarted Maptools.

Two, this is nice, but is there a way to make the whole thing a private roll? The answer might not be so much a code change but rolling in a different chat channel or such?


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 1 post ] 

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 post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





cron

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman