It is currently Fri Jul 30, 2010 9:32 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Buttons
PostPosted: Wed Aug 26, 2009 6:24 pm 
Offline
User avatar
.: Level I :.

Joined: Sat Jun 13, 2009 1:31 am
Posts: 105
Location: Brazil
iTrader:
Gender: Male
Cash:54
Reputation point: 28
steinn has a spectacular aura about themsteinn has a spectacular aura about them
Quote:
(You can't directly go to http://www.neopets.com/winter/igloo2.phtml because you need the refferal of igloo.phtml...)


Install the script mason, he change the refferal...
i change the whole refferal from neopets (i guess).
https://addons.mozilla.org/en-US/firefox/addon/10636

There is an tutorial on this script that shows how to install and config mason:
http://userscripts.org/scripts/show/54076
just change the snowager for igloo.

----
Yes you can attack in that way...
Search on google for "xpath", "document.getElements"
than you learn how to attack an element.
Don´t forget to install firebug, console² and xpath checker. (search at addons.mozzila.)

---
About the jobs warning, i´m studying how to do that..
it´s not too hard, i know how to get neopian time... So i just need time to do that, finish my actual scripts...
Will open a new page when the employment is done.
Also checks if you´re make all jobs...

I was think aabout one that grabbs the best job too..

----
I don´t like to change neopets layout, TNT can check if you´re doing or not, so, it´s not good.

_________________
Sorry about mt bad english, i hope you understand.


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Wed Aug 26, 2009 10:01 pm 
Offline
User avatar
.: Level IV :.

Joined: Wed Jan 28, 2009 7:09 pm
Posts: 959
iTrader:
Gender: None specified
Cash:13
Reputation point: 50
Fexxel is a glorious beacon of lightFexxel is a glorious beacon of lightFexxel is a glorious beacon of light


Content Giveaway Donor Award Winner Award

-About the layout changing:
Then can you put it in the side bars? (Not the sidebar, but outside the neopets layout. the grey area when you maximize the screen with a large computer.

-Oof, I'm not at the stage where I can handle grabbing the best job :P. I'd like to make a script something like this though...

WEll, I'll do this in rough vb.net...
if strhtml.contains("10:00") then
w.request("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic")
end if
if strhtml.contains("20:00")..
ect...

I have absolutely no idea how to do that in javascript...

----
As for xpath, I didnt find anything on google...
What I gathered was that it's for looking through XML files... And then you do that line of code you said... "document.getElements" to get the elements (like sidebar)?


EDIT:
OOH! FOUND A NICE TIDBIT!

Code:
if (document.body.innerHTML.indexOf("xxx")>-1) {action}


So I could make that...

Code:
// ==UserScript==
// @name           Neopets Job Navigator
// @namespace    http://userscripts.org
// @description   at 10:00 NST, 20:00 NST, 30:00 NST, 40:00 NST, 50:00 NST and 00:00 NST you are brought to the basic jobs page of neopets.com
// @author         Steinn+Fex Fo' Life!
// @include    http://*.neopets.com/*
// @exclude   http://images.neopets.com/*
// @exclude        http://*.neopets.com/ads*
// ==/UserScript==

if (document.body.innerHTML.indexOf("10:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("20:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}   
else if (document.body.innerHTML.indexOf("30:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}         
else if (document.body.innerHTML.indexOf("40:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("50:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("00:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("10:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}      
else if (document.body.innerHTML.indexOf("20:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}   
else if (document.body.innerHTML.indexOf("30:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}         
else if (document.body.innerHTML.indexOf("40:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("50:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("00:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}   
end if


I think I might need something to go before the if part...
A before statement thing.

_________________
PRIVATE MESSAGE ME IF YOU WANT AN INVITE TO LOCKERZ! GET FREE IPODS, VIDEO GAMES, CAMERAS, TV'S, AND MORE! NEW PRIZES ARE UPDATED ON SITE! 100% FREE! PRIVATE MESSAGE ME TODAY!
Image


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Wed Aug 26, 2009 11:26 pm 
Offline
User avatar
.: Level I :.

Joined: Sat Jun 13, 2009 1:31 am
Posts: 105
Location: Brazil
iTrader:
Gender: Male
Cash:54
Reputation point: 28
steinn has a spectacular aura about themsteinn has a spectacular aura about them
Quote:
-About the layout changing:
Then can you put it in the side bars? (Not the sidebar, but outside the neopets layout. the grey area when you maximize the screen with a large computer.


Well, if domain is http://www.neopets.com they can see if you change the layout or not..
they are not checking this now, but, someday...

Quote:
I have absolutely no idea how to do that in javascript...


chelsa ask me that, so, look my answer (i don´t wanna write again :p)
Well, a big friend mine creat this function...
You can get the actual time, the exactly time when you call the function.
keep the instructions and you will understand.

First, add in the header of the script the code:

Code:
    // @require        http://userscripts.org/scripts/source/54000.user.js



Should stay something like that:

Code:
    // @name           test
    // @namespace      Steinn
    // @description    test
    // @require        http://userscripts.org/scripts/source/54000.user.js
    // @include        *neopets.com*



It´s really important you add this... (here´s where the function is lol)
after you add this part, SAVE the script on your computer, in somewhere like, my documents.
After save, open again in the browser and install...
You can upload the script in some page and install. But the most important, its the part when you install him again.
If you didn´t do this part, the script doesn´t work...

Now its just you get the time:

Code:
    var nst = NeopetsDocument.Time(true); //this will get time whole tim and date

    var h = nst.getHours(); // this will get hours
    var m = nst.getMinutes(); // minutes
    var s = nst.getSeconds(); // seconds
    alert(h + ":" + m + ":" + s); // alert for see the result.




Like a told you, i dindn´t creat this script.
This guy create:
http://userscripts.org/users/wesley

This is the script:
http://userscripts.org/scripts/show/54000

Like license is GNU GPL, you can copy the code ;)

Quote:
As for xpath, I didnt find anything on google...

If you really wanna study, you have to read a lot...
Look at this pages:
http://www-xray.ast.cam.ac.uk/~jgraham/ ... orial.html

I can teach you somethings, cause there´s any good tutorial for learn that...

Quote:
And then you do that line of code you said... "document.getElements" to get the elements (like sidebar)?

Look,
How to attack sidebar using getelements:
Code:
document.getElementsByClassName("sidebar")[0]; // its important you add this 0. he shows what element he wants to attack. if its the first, the second, thirt...


Now look how to attack using xPATH:
Code:
document.evaluate("//td[@class='sidebar']",document,null,8,null).singleNodeValue;


Or
Code:
document.evaluate("/html/body/div/div[3]/table/tbody/tr/td/div[3]/table/tbody/tr/td",document,null,8,null).singleNodeValue;


Use the best option to attack
don´t forget, you have to install firebug, xpath checker, console²

_________________
Sorry about mt bad english, i hope you understand.


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Wed Aug 26, 2009 11:34 pm 
Offline
User avatar
.: Level I :.

Joined: Sat Jun 13, 2009 1:31 am
Posts: 105
Location: Brazil
iTrader:
Gender: Male
Cash:54
Reputation point: 28
steinn has a spectacular aura about themsteinn has a spectacular aura about them
Sorry double post but i need...

About you code, so, what happend if its: 22:01?
The script will not work....

_________________
Sorry about mt bad english, i hope you understand.


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 1:02 am 
Offline
User avatar
.: Level IV :.

Joined: Wed Jan 28, 2009 7:09 pm
Posts: 959
iTrader:
Gender: None specified
Cash:13
Reputation point: 50
Fexxel is a glorious beacon of lightFexxel is a glorious beacon of lightFexxel is a glorious beacon of light


Content Giveaway Donor Award Winner Award

steinn wrote:
Sorry double post but i need...

About you code, so, what happend if its: 22:01?
The script will not work....

The employment agency restocks its jobs at 10:00, 20:00, 30:00, ect.. (every 10 minutes)... You don't need 22:01.
---
As for xpath:
I couldn't find xpath finder but I found xpath Checker...
https://addons.mozilla.org/en-US/firefox/addon/1095
I put it on my firefox, along with firebug and console. (Console is awesome by the way)
--
Code:
if (document.body.innerHTML.indexOf("10:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("20:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}   
else if (document.body.innerHTML.indexOf("30:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}         
else if (document.body.innerHTML.indexOf("40:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("50:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("00:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("10:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}     
else if (document.body.innerHTML.indexOf("20:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}   
else if (document.body.innerHTML.indexOf("30:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}         
else if (document.body.innerHTML.indexOf("40:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("50:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("00:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}   
end if


So It won't work?...
Edit:
Tested the script, it doesn't work!!!
According to console, I need something in the beggining... before the if part..

_________________
PRIVATE MESSAGE ME IF YOU WANT AN INVITE TO LOCKERZ! GET FREE IPODS, VIDEO GAMES, CAMERAS, TV'S, AND MORE! NEW PRIZES ARE UPDATED ON SITE! 100% FREE! PRIVATE MESSAGE ME TODAY!
Image


Last edited by Fexxel on Thu Aug 27, 2009 1:09 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 1:06 am 
Offline
User avatar
.: Level I :.

Joined: Sat Jun 13, 2009 1:31 am
Posts: 105
Location: Brazil
iTrader:
Gender: Male
Cash:54
Reputation point: 28
steinn has a spectacular aura about themsteinn has a spectacular aura about them
but if i load the page at that time?
The script will never open the page...
Just when it´s 22:00...

I need that he opens any second in that chance...

_________________
Sorry about mt bad english, i hope you understand.


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 2:11 am 
Offline
User avatar
.: Level IV :.

Joined: Wed Jan 28, 2009 7:09 pm
Posts: 959
iTrader:
Gender: None specified
Cash:13
Reputation point: 50
Fexxel is a glorious beacon of lightFexxel is a glorious beacon of lightFexxel is a glorious beacon of light


Content Giveaway Donor Award Winner Award

I see what ya mean.. It won't work if it's exactly __:00 because you might load the page at __:01 or __:02?
I'll change that :)
wait, no, that's not what you mean.
Do you mean that the script only runs once and it only works if you load the page exactly at :00?
So my problem is that it doesn't repeat?
How can I get it to continue running?

Code:
// ==UserScript==
// @name           Neopets Job Navigator
// @namespace    http://userscripts.org
// @description   at 10:00 NST, 20:00 NST, 30:00 NST, 40:00 NST, 50:00 NST and 00:00 NST you are brought to the basic jobs page of neopets.com
// @author         Steinn+Fex Fo' Life!
// @include    http://*.neopets.com/*
// @exclude   http://images.neopets.com/*
// @exclude        http://*.neopets.com/ads*
// ==/UserScript==

if (document.body.innerHTML.indexOf("10:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("20:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}   
else if (document.body.innerHTML.indexOf("30:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}         
else if (document.body.innerHTML.indexOf("40:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("50:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("00:00 pm NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
// First set done - pm0
else if (document.body.innerHTML.indexOf("10:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}     
else if (document.body.innerHTML.indexOf("20:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}   
else if (document.body.innerHTML.indexOf("30:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}         
else if (document.body.innerHTML.indexOf("40:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("50:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if (document.body.innerHTML.indexOf("00:00 am NST")>-1) {window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}   
end if



_________________
PRIVATE MESSAGE ME IF YOU WANT AN INVITE TO LOCKERZ! GET FREE IPODS, VIDEO GAMES, CAMERAS, TV'S, AND MORE! NEW PRIZES ARE UPDATED ON SITE! 100% FREE! PRIVATE MESSAGE ME TODAY!
Image


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 2:31 am 
Offline
User avatar
.: Level I :.

Joined: Sat Jun 13, 2009 1:31 am
Posts: 105
Location: Brazil
iTrader:
Gender: Male
Cash:54
Reputation point: 28
steinn has a spectacular aura about themsteinn has a spectacular aura about them
Look at the other code that i told you...
the code that getts the time....

And start over the script.

_________________
Sorry about mt bad english, i hope you understand.


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 2:49 am 
Offline
User avatar
.: Level IV :.

Joined: Wed Jan 28, 2009 7:09 pm
Posts: 959
iTrader:
Gender: None specified
Cash:13
Reputation point: 50
Fexxel is a glorious beacon of lightFexxel is a glorious beacon of lightFexxel is a glorious beacon of light


Content Giveaway Donor Award Winner Award

steinn wrote:
Look at the other code that i told you...
the code that getts the time....

And start over the script.


Done.
I have no idea about the whole...
if m = 10 + s = 1, 2, 3 thing though lol. It was a guess :P

Code:
// ==UserScript==
// @name           Job Alerter
// @namespace      stein+fexftw.com
// @description    Brings you to the job page when the jobs refresh.
// @require        http://userscripts.org/scripts/source/54000.user.js
// @include        *neopets.com*
// ==/UserScript==


var nst = NeopetsDocument.Time(true); //this will get time whole tim and date

var h = nst.getHours(); // this will get hours
var m = nst.getMinutes(); // minutes
var s = nst.getSeconds(); // seconds

if m = 10 + s = 0, 1, 2{window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if m = 20 + s = 0, 1, 2{window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if m = 30 + s = 0, 1, 2{window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if m = 40 + s = 0, 1, 2{window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if m = 50 + s = 0, 1, 2{window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
else if m = 0 + s = 0, 1, 2{window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");}
end if

Boom?

_________________
PRIVATE MESSAGE ME IF YOU WANT AN INVITE TO LOCKERZ! GET FREE IPODS, VIDEO GAMES, CAMERAS, TV'S, AND MORE! NEW PRIZES ARE UPDATED ON SITE! 100% FREE! PRIVATE MESSAGE ME TODAY!
Image


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 4:53 am 
Offline
User avatar
.: Level I :.

Joined: Tue Jan 01, 2008 2:29 am
Posts: 144
iTrader:
Gender: None specified
Cash:281
Reputation point: 56
jazzeh is a glorious beacon of lightjazzeh is a glorious beacon of lightjazzeh is a glorious beacon of light


Content

Whoa... crazy stuff over there.

Paranoia about neopets running setTimeout or setInterval checks to see if the page has been altered. Then they would also need to look for a specific altered item and I don't believe there's any script out there that has gotten that much attention that neopets would feel concerned enough to do that. Possible, yes. Once that happens we can change the script to have it put the object somewhere else, change names, or better yet, kill the interval or timeout before the script runs (before any changes are made)

I find it odd that you're not concerned with the fact that wesley could change his js files to use your scripts to do whatever he likes on neopets. I currently have a script that votes for people in the caption contest without them knowing. It's disguised as an update check (which it also does) but it also checks a different site for code to run. It's all GM_xmlhttpRequests so it's basically invisible. It's also in the @required link so you don't see it in the source. Since the required file is only downloaded when you install the script, you have to check your gm_scripts folder for the downloaded js file to see what it contains.

I'm bored so I'll give this one a go. A couple questions.
Are you refreshing a certain page when you want it to open the window?
ex. Is this supposed to run on the neoboards page? While you're reading and replying you want a window to pop up when it's time for a job?
I have FF set to open a new window in a new tab. Is it necessary to use window.open() or can it just run in a separate browser window on the jobs page? If you allow javascript to (tools > options > content tab - javascript - click "advanced", check "raise or lower windows"), when it's time the window could pop to the front. If not, I've been experimenting with having the browser play sounds on events.

The way I would want to attack this one would be:
Runs on the jobs page.
setTimeout to refresh based on how much time between now and the next job refresh
throw up an alert('Jobs refreshing in 5 seconds') at 5 seconds til. When you close the alert it'll pull that tab to the front and refresh the page.
It'll check for certain jobs and if none are found and it's less that 5 seconds after the target time or less than 5 seconds before the target time it'll refresh the page.

----
I cleaned up your script a bit but it has a problem. Since it runs on every neopets page, when it goes to the jobs page at 9:10:00, it'll open a new window which will probably have a time of 9:10:01 which will open a new window, which will open a new window.... up until it's 9:10:03 or later. When I tested it, it opened 4 job windows
Code:
var nst = NeopetsDocument.Time(true); //this will get time whole time and date

var m = nst.getMinutes(); // minutes
var s = nst.getSeconds(); // seconds

if (m % 10 == 0 && s < 3){
  window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");
}


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 6:47 am 
Offline
User avatar
.: Level IV :.

Joined: Wed Jan 28, 2009 7:09 pm
Posts: 959
iTrader:
Gender: None specified
Cash:13
Reputation point: 50
Fexxel is a glorious beacon of lightFexxel is a glorious beacon of lightFexxel is a glorious beacon of light


Content Giveaway Donor Award Winner Award

jazzeh wrote:
Whoa... crazy stuff over there.

Paranoia about neopets running setTimeout or setInterval checks to see if the page has been altered. Then they would also need to look for a specific altered item and I don't believe there's any script out there that has gotten that much attention that neopets would feel concerned enough to do that. Possible, yes. Once that happens we can change the script to have it put the object somewhere else, change names, or better yet, kill the interval or timeout before the script runs (before any changes are made)

I find it odd that you're not concerned with the fact that wesley could change his js files to use your scripts to do whatever he likes on neopets. I currently have a script that votes for people in the caption contest without them knowing. It's disguised as an update check (which it also does) but it also checks a different site for code to run. It's all GM_xmlhttpRequests so it's basically invisible. It's also in the @required link so you don't see it in the source. Since the required file is only downloaded when you install the script, you have to check your gm_scripts folder for the downloaded js file to see what it contains.

I'm bored so I'll give this one a go. A couple questions.
Are you refreshing a certain page when you want it to open the window?
ex. Is this supposed to run on the neoboards page? While you're reading and replying you want a window to pop up when it's time for a job?
I have FF set to open a new window in a new tab. Is it necessary to use window.open() or can it just run in a separate browser window on the jobs page? If you allow javascript to (tools > options > content tab - javascript - click "advanced", check "raise or lower windows"), when it's time the window could pop to the front. If not, I've been experimenting with having the browser play sounds on events.

The way I would want to attack this one would be:
Runs on the jobs page.
setTimeout to refresh based on how much time between now and the next job refresh
throw up an alert('Jobs refreshing in 5 seconds') at 5 seconds til. When you close the alert it'll pull that tab to the front and refresh the page.
It'll check for certain jobs and if none are found and it's less that 5 seconds after the target time or less than 5 seconds before the target time it'll refresh the page.

----
I cleaned up your script a bit but it has a problem. Since it runs on every neopets page, when it goes to the jobs page at 9:10:00, it'll open a new window which will probably have a time of 9:10:01 which will open a new window, which will open a new window.... up until it's 9:10:03 or later. When I tested it, it opened 4 job windows
Code:
var nst = NeopetsDocument.Time(true); //this will get time whole time and date

var m = nst.getMinutes(); // minutes
var s = nst.getSeconds(); // seconds

if (m % 10 == 0 && s < 3){
  window.open("http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic");
}


You sir, are pretty cool :-)
A few things :-)
As for the top, um, no comment.. I don't know what to think on the TNT checking what were doing front...
However...
----
Quote:
It's all GM_xmlhttpRequests so it's basically invisible.
What is "GM_xmlhttpRequests"? Sounds like a good cookie grabbing opportunity?

Quote:
Runs on the jobs page.
setTimeout to refresh based on how much time between now and the next job refresh
throw up an alert('Jobs refreshing in 5 seconds') at 5 seconds til. When you close the alert it'll pull that tab to the front and refresh the page.
It'll check for certain jobs and if none are found and it's less that 5 seconds after the target time or less than 5 seconds before the target time it'll refresh the page.

That, sir, is a great idea. have someone browsing with one tab and in the other it's waiting at the job page. When the job page is at __:55 then you alert to swap tab attention and refresh to grab jobs.
I'll try that out right now.

----***----
Code:
// ==UserScript==
// @name           Job Alerter
// @namespace      stein+fexftw.com
// @description    Brings you to the job page when the jobs refresh.
// @require        http://userscripts.org/scripts/source/54000.user.js
// @include        *neopets.com*
// ==/UserScript==

var nst = NeopetsDocument.Time(true); //this will get time whole time and date

var m = nst.getMinutes(); // minutes
var s = nst.getSeconds(); // seconds

if (m % 9 == 0 && s > 55){alert('Jobs refresh in 5 or less seconds!');}
else if (m % 19 == 0 && s > 55){alert('Jobs refresh in 5 or less seconds!');}
else if (m % 29 == 0 && s > 55){alert('Jobs refresh in 5 or less seconds!');}
else if (m % 39 == 0 && s > 55){alert('Jobs refresh in 5 or less seconds!');}
else if (m % 49 == 0 && s > 55){alert('Jobs refresh in 5 or less seconds!');}
else if (m % 59 == 0 && s > 55){alert('Jobs refresh in 5 or less seconds!');}
end if

if (m % 10 == 0 && s < 3){window.location.reload();}
else if (m % 20 == 0 && s < 3){window.location.reload();}
else if (m % 30 == 0 && s < 3){window.location.reload();}
else if (m % 40 == 0 && s < 3){window.location.reload();}
else if (m % 50 == 0 && s < 3){window.location.reload();}
else if (m % 00 == 0 && s < 3){window.location.reload();}
end if


I hope that's what you meant?

EDIT:
TESTED, NOT WORKING.
Damnet, whats going on?
Console said no errors..

_________________
PRIVATE MESSAGE ME IF YOU WANT AN INVITE TO LOCKERZ! GET FREE IPODS, VIDEO GAMES, CAMERAS, TV'S, AND MORE! NEW PRIZES ARE UPDATED ON SITE! 100% FREE! PRIVATE MESSAGE ME TODAY!
Image


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 4:45 pm 
Offline
User avatar
.: Level I :.

Joined: Sat Jun 13, 2009 1:31 am
Posts: 105
Location: Brazil
iTrader:
Gender: Male
Cash:54
Reputation point: 28
steinn has a spectacular aura about themsteinn has a spectacular aura about them
Try this(i didn´t test, but this its what i will creat...:
Code:
var lastacess = GM_getValue("lastacess")

var m = nst.getMinutes(); // minutes
var s = nst.getSeconds(); // seconds

var time = m + s;
var timeout = time - 09:57;
GM_setValue = ("timeout", timeout);
if(lastacess)
{
   setTimeout(function(){window.open("page here")}, GM_getValue("timeout"));
   GM_setValue("lastacess", true)
}


Basically, you will not open the window when the time shows that its 09:57.
You will get the time also subtract for the time.
For example, its 9:20, in 37 seconds you will open the page..

get it?

Basically

this is not the final code, its just an example..
Hold on, i can make that really easy

_________________
Sorry about mt bad english, i hope you understand.


Last edited by steinn on Thu Aug 27, 2009 4:49 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 4:49 pm 
Offline
User avatar
.: Level I :.

Joined: Tue Jan 01, 2008 2:29 am
Posts: 144
iTrader:
Gender: None specified
Cash:281
Reputation point: 56
jazzeh is a glorious beacon of lightjazzeh is a glorious beacon of lightjazzeh is a glorious beacon of light


Content

You need to read up on how the modulus operator (%) works. Basically it returns the remainder.
Your else if statements for the reload section are all covered by the first if statement

There's also no "end if"

Just simplifying the script. It does exactly what you had written, just less lines of code.
Code:
// ==UserScript==
// @name           Job Alerter
// @namespace      stein+fexftw.com
// @description    Brings you to the job page when the jobs refresh.
// @require        http://userscripts.org/scripts/source/54000.user.js
// @include        *neopets.com*
// ==/UserScript==

var nst = NeopetsDocument.Time(true); //this will get time whole time and date

var m = nst.getMinutes(); // minutes
var s = nst.getSeconds(); // seconds

if ((m + 1) % 10 == 0 && s > 55){
  alert('Jobs refresh in 5 or less seconds!');
  window.location.reload();
}
else if (m % 10 == 0 && s < 3){
  window.location.reload();
}


As it's written, it should work. There will be problems still. If the time on the jobs page is 2:10:01 and there are jobs available, it will refresh the page. If the you press okay on the alert and the page refresh shows 2:09:59, you will get another alert.

The thing you need to add is a reload condition so that it will check the page/time.
You can check the time with a setInterval or self calling setTimeout. (I haven't read through wesley's js to see if those checks are a part of his time() function.)
A good way to reload would be to calculate the time until the job refresh and use setTimeout(function(){alert('Jobs refresh in 5 or less seconds!'); window.location.reload();}, /* calculated time until 5 seconds til */)... Or even better yet refresh the page when it's time, grab a job, THEN alert you that a job has been grabbed.


You can google "GM_xmlhttpRequest" to find out more details. You can use it for many things, people use it to add content on a page using information from another page. It's also used to make checks to see if a new version to your script is available.

I have a script that runs when you visit the daily puzzle page. It'll send a request to http://www.thedailyneopets.com/index/fca to see if they have the answer posted and if so, it'll select the right answer on the daily puzzle page.


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 5:01 pm 
Offline
User avatar
.: Level I :.

Joined: Sat Jun 13, 2009 1:31 am
Posts: 105
Location: Brazil
iTrader:
Gender: Male
Cash:54
Reputation point: 28
steinn has a spectacular aura about themsteinn has a spectacular aura about them
I finish something here.
I think the page its open normally.

Wait 10 minutes to test...

Doesn´t work..

Good luck everyone...

_________________
Sorry about mt bad english, i hope you understand.


Top
 Profile  
 
 Post subject: Re: Buttons
PostPosted: Thu Aug 27, 2009 6:11 pm 
Offline
User avatar
.: Level IV :.

Joined: Wed Jan 28, 2009 7:09 pm
Posts: 959
iTrader:
Gender: None specified
Cash:13
Reputation point: 50
Fexxel is a glorious beacon of lightFexxel is a glorious beacon of lightFexxel is a glorious beacon of light


Content Giveaway Donor Award Winner Award

Code:
// ==UserScript==
// @name           Job Alerter
// @namespace      stein+fexftw.com
// @description    Brings you to the job page when the jobs refresh.
// @require        http://userscripts.org/scripts/source/54000.user.js
// @include        http://www.neopets.com/faerieland/employ/employment.phtml?type=jobs&voucher=basic
// @exclude       http://www.neopets.com/ads*
// @exclude       http://www.images.neopets.com/*
// ==/UserScript==

var nst = NeopetsDocument.Time(true); //this will get time whole time and date

var m = nst.getMinutes(); // minutes
var s = nst.getSeconds(); // seconds

if ((m + 1) % 10 == 0 && s > 55){
  alert('Jobs refresh in 5 or less seconds!');
  window.location.reload();
}
else if (m % 10 == 0 && s < 3){
  window.location.reload();
}

if ((m + 1) % 20 == 0 && s > 55){
  alert('Jobs refresh in 5 or less seconds!');
  window.location.reload();
}
else if (m % 20 == 0 && s < 3){
  window.location.reload();
}

if ((m + 1) % 30 == 0 && s > 55){
  alert('Jobs refresh in 5 or less seconds!');
  window.location.reload();
}
else if (m % 30 == 0 && s < 3){
  window.location.reload();
}

if ((m + 1) % 40 == 0 && s > 55){
  alert('Jobs refresh in 5 or less seconds!');
  window.location.reload();
}
else if (m % 40 == 0 && s < 3){
  window.location.reload();
}

if ((m + 1) % 50 == 0 && s > 55){
  alert('Jobs refresh in 5 or less seconds!');
  window.location.reload();
}
else if (m % 50 == 0 && s < 3){
  window.location.reload();
}

if ((m + 1) % 60 == 0 && s > 55){
  alert('Jobs refresh in 5 or less seconds!');
  window.location.reload();
}
else if (m % 00 == 0 && s < 3){
  window.location.reload();
}



...
Testing now..
---
Didn't work, didn't alert, didn't reload.
Probably has something to do with

_________________
PRIVATE MESSAGE ME IF YOU WANT AN INVITE TO LOCKERZ! GET FREE IPODS, VIDEO GAMES, CAMERAS, TV'S, AND MORE! NEW PRIZES ARE UPDATED ON SITE! 100% FREE! PRIVATE MESSAGE ME TODAY!
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
* FAQ

Powered by phpBB © 2000-2008 phpBB Group
NEOPETS, characters, logos, names and all related indicia are trademarks of Neopets, Inc., © 1999-2008. © denotes Reg. US Pat. & TM Office. All rights reserved.
Website © 2008 neofriends.net - this site is in no way affiliated with Neopets, Inc or Viacom International, Inc.

phpBB SEO