Skip to content

Instantly share code, notes, and snippets.

@Wunkolo
Last active December 29, 2015 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wunkolo/7699917 to your computer and use it in GitHub Desktop.
Save Wunkolo/7699917 to your computer and use it in GitHub Desktop.
var gathers = [].slice.call(document.querySelectorAll('input[class="redbutton anybutton"]'));
var main = document.querySelector("#super-container").insertBefore(document.createElement('div'),document.querySelector("#super-container").children[5]);
main.id = "grab";
for (var i = 0; i < gathers.length; i++)
{
var posturl = "main.php?p=gather&action=" + gathers[i].value.toLowerCase();
gathers[i].parentNode = "";
$.ajax({
url: posturl,
type: 'POST',
dataType: 'html',
data: {
gather : Math.floor(1+Math.random() * 11)
},
success: function(data)
{
var dom = document.createElement('div');
dom.innerHTML = data;
var tips = [].slice.call(dom.querySelectorAll('a[rel*="includes/itemajax.php"]')).map(function(i){return i.rel});
for (var i = 0; i < tips.length; i++)
{
$.ajax({
url: tips[i],
type: 'POST',
dataType: 'html',
success: function(data)
{
var tip = document.createElement('div');
tip.id = "tip";
tip.style.width = "267px";
tip.style.height = "130px";
tip.style.margin = "1em";
tip.style.borderRadius = "6px";
tip.style.border = "1px solid #000000";
tip.innerHTML += data;
main.appendChild(tip);
}
});
};
}
});
};
#################################################################################################################
#################################################################################################################
http://flightrising.com/main.php?p=gather&gather=2
http://flightrising.com/main.php?p=gather&action=catch&gather=2
<form method="post" action="main.php?p=gather&action=catch">
<div style="margin-top:5px; width:209px; margin-left:auto; margin-right:auto;">Gathering Location:</div>
<div style="width:209px; margin-left:auto; margin-right:auto;">
<select style="width:209px; font-size:11px;" class="input_reg" name="gather">
<option value="2" selected="selected">Plague</option>
<option value="1">Earth</option>
<option value="3">Wind</option>
<option value="4">Water</option>
<option value="5">Lightning</option>
<option value="6">Ice</option>
<option value="7">Shadow</option>
<option value="8">Light</option>
<option value="9">Arcane</option>
<option value="10">Nature</option>
<option value="11">Fire</option>
</select>
</div>
<div style="margin-top:5px; margin-left:auto; margin-right:auto; background-image:url(images/bars/large_back.png); height:10px; width:209px; position:relative;">
<div style="width:0px; overflow:hidden; position:relative; background-image:url(images/bars/large_energy.png); height:10px; z-index:1; background-size:209px 10px;"></div>
</div>
<div style="width:209px; margin-left:auto; margin-right:auto; text-align:center;">0 / 650 exp</div>
<div style="position:absolute; width:219px; left:0px; bottom:0px; text-align:center;"><input type="submit" value="Catch" class="redbutton anybutton"></div>
</form>
//get tool tip of collected item
//get <a> element with the "clue" class and get its "reL" element
//use the 'rel' element as the url for this request and it will return the html of the tooltip.
//Use this to get all items document.querySelectorAll('a[rel*="includes/itemajax.php"]')
var tips = [].slice.call(document.querySelectorAll('a[rel*="includes/itemajax.php"]')).map(function(i){return i.rel})
$.ajax({
url: "includes/itemajax.php?id=4&tab=food",
type: 'POST',
dataType: 'html',
async: false,
success: function(data)
{
console.log(data)
}
});
position: absolute; width: 275px; left: 776px; z-index: 99999; top: 189px; box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.5); display: block;
//Gathers items and such
$.ajax({
url: "main.php?p=gather&action=fish",
type: 'POST',
dataType: 'html',
data: {
gather : '2'
},
async: false,
success: function(data)
{
console.log(data)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment