This will currently let you test up to 10 changes (additions or subtractions), but I’m certain this idea can be expanded upon to include more options and a better user interface.
This code is free for community use, as a thank you to all the people who continue to inspire with all their hard work, dedication, and artistry.
@JimD please feel free to test this out, will ya?
*title Fairmath Testing: Basic Edition
*author Carlos H. Romero Jr.
*create strength 75
*create agility 50
*create intel 25
*create nameofstat ""
*create nameofstat2 0
*create numberoftests 1
*create compile ""
*create compile0 ""
*create compile1 0
*create compile2 0
*create compile3 0
*create compile4 0
*create compile5 0
*create compile6 0
*create compile7 0
*create compile8 0
*create compile9 0
*create compile10 0
*create change ""
*create change1 0
*create change2 0
*create change3 0
*create change4 0
*create change5 0
*create change6 0
*create change7 0
*create change8 0
*create change9 0
*create change10 0
*create counter 1
*create operator ""
*create operator1 ""
*create operator2 ""
*create operator3 ""
*create operator4 ""
*create operator5 ""
*create operator6 ""
*create operator7 ""
*create operator8 ""
*create operator9 ""
*create operator10 ""
*label main
Sample variables and values:
Strength: ${strength}
*line_break
Agility: ${agility}
*line_break
Intel: ${intel}
What variable do you want to manipulate with Fairmath?
*fake_choice
#Strength
*set nameofstat "strength"
#Agility
*set nameofstat "agility"
#Intel
*set nameofstat "intel"
#Modify the value of...
Modify the value of...
*fake_choice
#Strength
Enter a value between 1 and 100
*input_number strength 1 100
*goto main
#Agility
Enter a value between 1 and 100
*input_number agility 1 100
*goto main
#Intel
Enter a value between 1 and 100
*input_number intel 1 100
*goto main
*if {nameofstat} >= 0
*if {nameofstat} <= 100
*goto main2
*else
That variable either does not exist or is outside the valid testing range (1 to 100). Returning to the main menu.
*goto main
*else
That variable either does not exist or is outside the valid testing range (1 to 100). Returning to the main menu.
*goto main
*label main2
How many times do you want to test?
*line_break
Enter a number from 1 to 10.
*input_number numberoftests 1 10
*temp many_whelps_handle_it ""
*temp actualtesting numberoftests
*set many_whelps_handle_it "@{actualtesting ${compile1}|${compile2}|${compile3}|${compile4}|${compile5}|${compile6}|${compile7}|${compile8}|${compile9}|${compile10}}"
You have chosen to test a number of [b]${numberoftests}[/b] times.
*label testloop
*if actualtesting > 0
(${counter}) Fairmath.
*choice
#Add a change
*set operator "operator"&counter
*set {operator} "+"
*set compile "change"&counter
Valid ranges are from 1 to 100.
*input_number {compile} 1 100
*set actualtesting -1
*set counter +1
*goto testloop
#Subtract a change
*set operator "operator"&counter
*set {operator} "-"
*set compile "change"&counter
Valid ranges are from 1 to 100.
*input_number {compile} 1 100
*set actualtesting -1
*set counter +1
*goto testloop
*elseif actualtesting = 0
*page_break
*goto break
*else
*page_break
*goto break
*label break
*set counter 1
*label break2
*set compile "compile"&counter
*set operator "operator"&counter
*set change "change"&counter
*if counter < (numberoftests +1)
*if counter > 1
*set compile0 "compile"&(counter-1)
*if {operator} = "+"
*if counter < 2
*set {compile} ({nameofstat} %+ {change})
*set counter +1
*goto break2
*if counter >= 2
*set {compile} ({compile0} %+ {change})
*set counter +1
*goto break2
*if {operator} = "-"
*if counter < 2
*set {compile} ({nameofstat} %- {change})
*set counter +1
*goto break2
*if counter >= 2
*set {compile} ({compile0} %- {change})
*set counter +1
*goto break2
*else
*goto final
*label final
Final results:
*line_break
*set nameofstat2 {nameofstat}
$!{nameofstat}: originally ${nameofstat2}.
[b]Change Tracker:[/b]
*line_break
*if change1 > 0
${operator1}${change1}
*if change2 > 0
, ${operator2}${change2}
*if change3 > 0
, ${operator3}${change3}
*if change4 > 0
, ${operator4}${change4}
*if change5 > 0
, ${operator5}${change5}
*if change6 > 0
, ${operator6}${change6}
*if change7 > 0
, ${operator7}${change7}
*if change8 > 0
, ${operator8}${change8}
*if change9 > 0
, ${operator9}${change9}
*if change10 > 0
, ${operator10}${change10}
[b]Results Tracker:[/b]
*line_break
*if compile1 > 0
${compile1}
*if compile2 > 0
, ${compile2}
*if compile3 > 0
, ${compile3}
*if compile4 > 0
, ${compile4}
*if compile5 > 0
, ${compile5}
*if compile6 > 0
, ${compile6}
*if compile7 > 0
, ${compile7}
*if compile8 > 0
, ${compile8}
*if compile9 > 0
, ${compile9}
*if compile10 > 0
, ${compile10}