Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (input ==~ 'ni[0-9]+') {
- int counter = 1
- def maxNumber = input.replaceAll('[^0-9]', '');
- if (maxNumber == null) {
- return;
- }
- int intMaxNumber = maxNumber.toInteger();
- if (intMaxNumber>=40) {
- ui.informationMessage(ui.frame, "You've reached the limit!");
- } else {
- counter = 1
- def firstChild = node.createChild();
- firstChild.icons.add("full-" + counter);
- c.select(firstChild);
- while (counter++<intMaxNumber) {
- def lastChild = node.createChild();
- int decs = counter / 10;
- int ones = counter % 10;
- if (decs > 0) {
- lastChild.icons.add("full-" + decs);
- }
- lastChild.icons.add("full-" + ones);
- }
- }
- }
Add Comment
Please, Sign In to add comment