If each user-defined setting has to be linked to an action, I don't see how you can avoid hardcoding.
I meant having a long list of all the possible user settings and their associated actions, either directly in the script or in a data file.Perhaps hardcoding means the opposite of what I think it does?
To veer, when I use "hardcoding" I am usually referring to the difficulty of changing something and the skills and tools required. Thus in The Good Old Days, if something had to be changed in the source code and the code had to be compiled and linked before it would function then that was "hardcoded". The alternative was to stick something in a data file that would be read. The code would not have to change and an end user could usually edit the datafile. Fast forward. Since editing scripts is much simpler than compiling code, the term has morphed into something that is more based upon the question of where something is changed. If I want to do something to a list of items and each item is called out in the script, then I call that hardcoded. If I read that list from a datafile then it is not.I meant having a long list of all the possible user settings and their associated actions, either directly in the script or in a data file.
writeln("<input class='button' type='button' name='reset' value='Reset' onclick='document.relayform.reset();'>");
"<a href='" + __FILE__ + "'>Reset everything!</a>"
Does %2B work to encode it?
KoLmafia acts on URLs that it receives from the browser. How can it tell that the parameter the browser submitted came from a textarea?Unless I'm getting the wrong impression somewhere, I think mafia should be handling the contents of a textarea or text input differently than it does with the rest of text passed along as a parameter, and escaping the plus signs first.
import "htmlform.ash";
void main() {
write_header();
finish_header();
attr("id=\"copypasta\"");
write_textarea(fields["copypasta"],"copypasta","",100,30);
write_button("parseHistory","Load");
string h = fields["copypasta"];
for x from 0 to length(h)-1 {
print(char_at(h,x),"purple");
}
finish_page();
}
1 + 2 = 3
1 2 = 3