i have a problem concerning the usage of an if-condition, when i am trying to use the +-sign from a substring.
i have a variable which has "3W6+3" as its content. Now i am trying to break down the string to get the number of dices, what kind of dice i use and the bonus.
Code: Select all
[h: tmpstring='3W6+3']
[r,count(length(tmpstring),''),CODE:{
[h: stringval=substring(tmpstring,roll.count,roll.count+1)]
[h,if(stringval=='W'),CODE:{
[h: wuerfelanzahl=substring(tmpstring,0,roll.count)]
[h: wuerfelarts=roll.count+1]
}]
[r,if(stringval=='+'),CODE:{
[r: cpass=roll.count]
};
{}]
}]