PDA

View Full Version : Need a super simple script



CaptainNight
08-01-2015, 11:56 AM
I just posted this on Programming Help so sorry mods, feel free to delete this if its too much.

Ok so iv been playing the game "Chicken Smoothie" for a while now. Its a shitty petsite but im an addict so whatever.

Their events ALWAYS center on clicking banners that appear at the bottom of a page every 20 minutes. Basically, to get all the rare items and pets, you need to be on the site literally every 20 minutes to hit the banners. Its a gigantic pain in the ass and takes a LOT of just sitting at my computer with the tab open. You need to hit probably 150 banners to get all the things you want.

It can be any page. So if I just refresh the exact same page every 20 minutes, the banner will appear eventually at the bottom of the page in the same place. Clicking the banner just takes you to the prize-get link (unique every time). The banner does not "move" to a different page, its just random when you refresh anywhere.

You see banners like this on the bottom of a page after a refresh or two:

[Only registered and activated users can see links]

Clicking banner takes you here:

[Only registered and activated users can see links]

Then this message shows at the bottom of every page until the timer is up:

[Only registered and activated users can see links]

The banner does not appear 100% after every refresh. Its like, after the 20 min timer is up, you just refresh maybe 10 times and itll eventually show up on potentially EVERY page. Same place every time!

There is no capcha or thing that checks for human interaction. I usually just open the banner link in a new tab. I guess I could hardcode it to just only work on one page. You can even find the banner on the "got an item from the banner" page.

How can I automate this process??? I don't care if its through a duct tape bullshit like downloading an auto-refresher and an auto-clicker and somehow making it work? or if I could make a chrome plug-in?? I dunno.

Bat
08-01-2015, 12:25 PM
If you're fairly comfortable with JavaScript, then you could create a GreaseMonkey script that does what you need and leave it running on that page. Directly building your own extension (plugin) may be overkill, and I believe that Google has unauthorized extensions blocked in Chrome by default.

Here's the Chrome equivalent if you're interested: [Only registered and activated users can see links]

Gnorbu
08-01-2015, 12:30 PM
I think a greasemonkey or tampermonkey script could be optimal in your case but for that I need to take a look at the html. I don't use that site so I can't really help with that.
You could try a macro, though. I use the program "Easy macro recorder". It can record your mouseclicks.

iMacros is even easier to use but it's on firefox ^^

CaptainNight
08-01-2015, 01:55 PM
If you're fairly comfortable with JavaScript, then you could create a GreaseMonkey script that does what you need and leave it running on that page. Directly building your own extension (plugin) may be overkill, and I believe that Google has unauthorized extensions blocked in Chrome by default.

Here's the Chrome equivalent if you're interested: [Only registered and activated users can see links]

Issue is im not particularly comfortable with JS. I took a single python course like 2 years ago and I have fiddled with JS a few times since then. I can probably figure it out, but it will take me forever and probably not work :P

I already have tampermonkey so I suppose thats my best bet.

If anyone has any particular hints or bits of code I should look into, I would be super happy.. this really can't be that complicated but since I dont know JS..

If I were going to do this it would be something like:

- Go to X page

- See if the "timer message" is displayed

- If yes, wait 1 min and refresh

- If no, refresh every 3 seconds or something

- Follow banner link when it appears

- Repeat

Gnorbu
08-01-2015, 03:18 PM
Issue is im not particularly comfortable with JS. I took a single python course like 2 years ago and I have fiddled with JS a few times since then. I can probably figure it out, but it will take me forever and probably not work :P

I already have tampermonkey so I suppose thats my best bet.

If anyone has any particular hints or bits of code I should look into, I would be super happy.. this really can't be that complicated but since I dont know JS..

If I were going to do this it would be something like:

- Go to X page

- See if the "timer message" is displayed

- If yes, wait 1 min and refresh

- If no, refresh every 3 seconds or something

- Follow banner link when it appears

- Repeat

Does the banner always have the same link? If yes it would be easy!



// ==UserScript==
// name Chicken Smoothie banner clicker
// namespace CS
[Only registered and activated users can see links]
// Description Description
// Match [Only registered and activated users can see links]*
[Only registered and activated users can see links]
// ==/UserScript==


window.onload = function(){

if ( document.documentElement.innerHTML.indexOf('wait at least') > -1){
window.setTimeout(refresh,60000);
// alert('recognized');
} else {
window.location.href = 'BANNERLINK';
}

}

function refresh(){
location.reload();
}



I can't really format with tabs here but basically you need to change "BANNERLINK" with the link of the banner.
But this only works if the banner has the same link every time.

Also there are these lines. To find out if the code can find the waiting text you should move the '//' Slashes to the upper line


window.setTimeout(refresh,60000);
// alert('recognized');

to

// window.setTimeout(refresh,60000);
alert('recognized');


If a window pops up, it can see the waiting line. Then change it back.

CaptainNight
08-01-2015, 07:39 PM
Gnorbu

Wow thanks!! Ill try to adapt this to what I need. It gives a great easy base at least haha. Ill even rep you ;3

Issue is the banner link is unique every time. here is a sample one:

[Only registered and activated users can see links]

The "token" portion is different each time and needs to be gotten from the banner directly. It does show up in the html of the page. This is why I need to keep refreshing the page until the banner actually shows itself rather than just refreshing the prize page.

Cuva
08-01-2015, 08:12 PM
Macro recorder is a nice program for that, is my own auto-BD player ;)

---------- Post added at 08:12 PM ---------- Previous post was at 08:11 PM ----------

I don't have the link but google knows all :P

Gnorbu
08-02-2015, 01:07 AM
Gnorbu

Wow thanks!! Ill try to adapt this to what I need. It gives a great easy base at least haha. Ill even rep you ;3

Issue is the banner link is unique every time. here is a sample one:

[Only registered and activated users can see links]

The "token" portion is different each time and needs to be gotten from the banner directly. It does show up in the html of the page. This is why I need to keep refreshing the page until the banner actually shows itself rather than just refreshing the prize page.

Can you right-click on that banner and click "inspect element"? It is usually the last option. And hopefully the image of that banner has an id.
Would you copy the whole body and insert it in a spoiler for me? :)

learningtoneopet1
08-02-2015, 09:17 AM
flytenyte
Are you at all familiar with ahk? If not, are you using a pc? I could throw something together real quick.

CaptainNight
08-02-2015, 10:38 AM
Gnorbu
Odd
Cuva
learningtoneopet1

rep for everyone as soon as I can give more haha! Thank you all a ton for the help. The script Odd made works :)

also Gnorbu I dont think it had an ID anyhow. Ill paste it here just so you can see.

<a href="/getgiveaway.php?id=3255&amp;token=bd3a0405-d0c9-46f0-b454-6c7afb4b8732"><img src="//static.chickensmoothie.com/trans.php?k=7A3F81A9076F3FEDDA8A80C465AEF5B7&amp;i=oTK-5hd6-GDEgY-4G6wfBA" alt="Click to claim your prize!" style="padding:8px; "></a>

lol im so glad I thought to ask clraik about this. Never fails to have awesome people willing to help fellow lazy asses exploit events, on any site ;D This happened way faster than I expected as well! Thank god I can actually get these banner items... seriously you need to trade in so many of these banner tokens to get the special pets. Basically need to be online 24/7 to get everything. These event pets trade SO well a month or two after the event because most people can only afford to get a few of them from the event itself and want the whole set.

CaptainNight
08-03-2015, 07:09 PM
In case anyone cares, this worked so well I managed to get every single pet in like a day and a half plus a few for trade fodder. The event is over now because I waited a bit too long to start, but anyhow :D Thanks a ton again. All my chicken smoothie events will go well after this.

Managed to get FOUR of these rare candy unicorns, 1 to keep, 1 to hold for later trades, and 2 i immediately traded for a ton of neat stuff.

[Only registered and activated users can see links]

Plus the full flavors set of ice cream squids

[Only registered and activated users can see links]