Quantcast

Jump to content


Photo

Any active programming forums?


  • Please log in to reply
4 replies to this topic

#1 JaneTheDog

JaneTheDog
  • 90 posts

Posted 17 April 2011 - 05:30 AM

So, I've tried to learn greasemonkey scripts and can now make my browser say 'hello world' to me....
But I want moar!

I want to make an autoclicker for a petpage, but I have put that in hold, because first I want an autoreplier for Luuux.com. :)
I think it's totally doable, I just don't know the right things.. So I need some help :)

#2 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 17 April 2011 - 06:05 AM

http://diveintogreasemonkey.org/
http://wiki.greasespot.net/Main_Page

Those are good places to start when it comes to greasemonkey.

If you have any specific questions if you get stuck on something just ask and somebody will try and help.

#3 JaneTheDog

JaneTheDog
  • 90 posts

Posted 17 April 2011 - 07:54 AM

Yes, I've read through diveintogreasemonkey.org, that helped quite a lot :)
I have sort of a script atm, but it isn't working..

// ==UserScript==// @name	Auto Comment
// @namespace	Auto Comment
// @description	Auto commenter for Luuux.com
// @include 	http://www.luuux.com/*
// ==/UserScript==

function sendclick(el){
var clickevent=document.createEvent("MouseEvents");
clickevent.initEvent("click", true, true);
el.dispatchEvent(clickevent);}

function spamtastic(){
var ray = ["i Like it","Thanks for sharing!","Cool","Nice","I want!"].sort(function() {return 0.5 - Math.random()});

ii=0;
function a(){
var mytxt=ray.pop();
var UIComposer=unsafeWindow["UIComposer"];
for(var i in UIComposer.instances){if(UIComposer.instances[i].root.className.indexOf("UIComposer_STATE_INPUT_DISABLED")==-1){ii++;
UIComposer.instances[i].setMessage(mytxt);UIComposer.instances[i].focusInput();UIComposer.instances[i].post();}}
if(ray.length<=1)
ray = ["Thanks for sharing","I like it","cool!","Nice <img src='http://www.neocodex.us/forum/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' />"].sort(function() {return 0.5 - Math.random()});
setTimeout(a,500);

}
a();

}


GM_registerMenuCommand("i like it",function(){spamtastic()});


I got most of the code from a facebook autocommenter..
So I'm not sure what everything does, and I'm a bit confused about the last line.
And the fact that I have two random lines. I guess I only need one, since I don't need to fill in a name or something.
I tried it on luuux.com but the comment box stays empty, so I'm definitely doing something wrong :p

#4 Neoquest

Neoquest
  • 1760 posts


Users Awards

Posted 17 April 2011 - 06:25 PM

What would the code be for a greasemonkey script to visit links with a varied time delay like 1000-2000 ms? I'm also just trying this out so I fail, could anyone help me out?

#5 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 18 April 2011 - 02:47 AM

What would the code be for a greasemonkey script to visit links with a varied time delay like 1000-2000 ms? I'm also just trying this out so I fail, could anyone help me out?


Look up XMLHttpRequest (or GM_XmlHttpRequest) and setTimeout.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users