runescape Auto login

By ttyler333 Last update Nov 8, 2009 — Installed 724 times.
// ==UserScript==
// @name            runescape Auto login
// @description     Automatically logins in to runescape if Firefox remembers your password.
// @include http://*.runescape.com/*
// @include https://*.runescape.com/*
// @include http://runescape.com/*
// @include http://www.runescape.com
// ==/UserScript==
// Configured for runescape by Tyler

var timer = 1000;
var timo, maySubmit = true;
var form = document.forms.namedItem('login_form');
var uid = form.elements.namedItem('username');
var pw = form.elements.namedItem('password');

function postwith (to,p) {
  var myForm = document.createElement("form");
  myForm.method="post" ;
  myForm.id="login_form" ;
  myForm.action = to ;
  for (var k in p) {
    var myInput = document.createElement("input") ;
    myInput.setAttribute("name", k) ;
    myInput.setAttribute("value", p[k]);
    myForm.appendChild(myInput) ;
  }
  document.body.appendChild(myForm) ;
  myForm.submit() ;
  document.body.removeChild(myForm) ;
}
//replace testuser123 with your runescape username
//replace testpassword with your runescape password 
//sorry but this is the only way i could get it to work. I will Release the next version once i get it to work so you dont have to worry about your password security!
//This script is secure still because runescapes the only thing that can see your username and password
postwith('https://secure.runescape.com/m=weblogin/login.ws',{username:'testuser123',password:'testpassword',mod:'www',ssl:'0',dest:'title.ws'})

function doSignIn() {
	if(uid.value.length && pw.value.length) {
		form.submit();
	} else { 
		window.setTimeout(doSignIn, timer);
	}
}

doSignIn();