This script sems to save the challenger i first challenged. and i can't seem to reset it. Does someone know how to reset this script?
function reloadChallengePage(){
//Acquire proper nation names via first links in challenge screen. var self = document.getElementsByClassName("nlink")[0].href.split("=")[1] var target = document.getElementsByClassName("nlink")[1].href.split("=")[1]
var nations = self + "+" + target; var specialty = "66" //hardcoded to youth rebellion. Check bottom of script for full list of values and their description var go = "+Go!+";
//Performs a post or get with the specified key/values. performPost(window.location, {nations:nations,speciality:specialty,go:go});
function performPost(path1, params, method1) {
//console.log(params); //alert(params); method1 = method1 || "post"; // Set method to post by default if not specified.
// The rest of this code assumes you are not using a library. // It can be made less wordy if you use one. var form = document.createElement("form"); form.setAttribute("method", method1); form.setAttribute("action", path1);
for(var key in params) { if(params.hasOwnProperty(key)) { var hiddenField = document.createElement("input"); hiddenField.setAttribute("type", "hidden"); hiddenField.setAttribute("name", key); hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField); } }
document.body.appendChild(form); form.submit(); }
}
window.onload = function () {
//See if there is a 'Round 1' and click it, then schedule a reload. var link = document.getElementsByClassName("next-round")[0]; if(link) { link.click(); //link.click(); setTimeout(reloadChallengePage,3600 + (Math.random() * 200)); //random reload time to avoid raising flags if Nationstates has certain measures in effect. }
How to reset this script?
This script sems to save the challenger i first challenged. and i can't seem to reset it. Does someone know how to reset this script?
function reloadChallengePage(){
//Acquire proper nation names via first links in challenge screen.
var self = document.getElementsByClassName("nlink")[0].href.split("=")[1]
var target = document.getElementsByClassName("nlink")[1].href.split("=")[1]
var nations = self + "+" + target;
var specialty = "66" //hardcoded to youth rebellion. Check bottom of script for full list of values and their description
var go = "+Go!+";
//Performs a post or get with the specified key/values.
performPost(window.location, {nations:nations,speciality:specialty,go:go});
function performPost(path1, params, method1) {
//console.log(params);
//alert(params);
method1 = method1 || "post"; // Set method to post by default if not specified.
// The rest of this code assumes you are not using a library.
// It can be made less wordy if you use one.
var form = document.createElement("form");
form.setAttribute("method", method1);
form.setAttribute("action", path1);
for(var key in params) {
if(params.hasOwnProperty(key)) {
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", key);
hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField);
}
}
document.body.appendChild(form);
form.submit();
}
}
window.onload = function () {
//See if there is a 'Round 1' and click it, then schedule a reload.
var link = document.getElementsByClassName("next-round")[0];
if(link) {
link.click();
//link.click();
setTimeout(reloadChallengePage,3600 + (Math.random() * 200)); //random reload time to avoid raising flags if Nationstates has certain measures in effect.
}
};