PDA

View Full Version : Looking for Tutorials on writing Grease Monkey Scripts for Neopets



Graff
02-03-2013, 04:09 PM
I'm looking for some sort basic tutorials on how to code scripts for greasemonkey specifically for neopets. For example, I would like to be able to write a Lever of Doom auto lever puller from scratch.

Example:
// ==UserScript==
// name Lever of Doom
// namespace Cody Woolaver
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
// ==/UserScript==

/*
USE THIS AT YOUR OWN DECRESSION.
CHEATING IS AGAINST THE NEOPETS
TOS AND I WILL TAKE NO PERSONAL
RESPONSIBILITY IF YOUR ACCOUNT
GETS FROZEN DUE TO THIS PROGRAM.
*/

var MIN_WAIT = 2.1
var MAX_WAIT = 3.5

var AVATAR_URL = "[Only registered and activated users can see links]"
var HTML = document.body.innerHTML

function redirect(){document.getElementsByTagName('form')[1].submit()}

if (HTML.indexOf(AVATAR_URL) == -1){
var waitTime = MIN_WAIT + (Math.random() * (MAX_WAIT - MIN_WAIT))
window.setTimeout(redirect, waitTime * 1000)
}else{
alert("You got the avatar :O ... >> Your welcome >>")
}

set variables (times and avatar url)
if the avatar url is not present wait some time then redirect (this is the button press I assume)
otherwise, the avatar is there and you get a pop-up saying so.

Mainly these parts:
var HTML = document.body.innerHTML
function redirect(){document.getElementsByTagName('form')[1].submit()

Eventually I would like to be able to write my own bilge dice autoplayer, that's pretty much my goal.
If you have any experience I would really appreciate any help you can offer, so don't be afraid to post. Thanks!

Graff
02-09-2013, 10:33 PM
Bumping!