Jump to content

error on _adf.ly autoit script


Recommended Posts

HI !

I am creating very basic autoit script for autoclick _adf.ly skip AD button

here is my code:

#include <IE.au3>
$oIE = _IECreate ("http://adf.ly/2AbvJ")
_IEImgClick ($oIE, "skip_ad_button", "Skip Ad")

here is debugg report that i get

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\adfly.au3"    
--> IE.au3 V2.4-0 Error from function _IEImgClick, $_IEStatus_InvalidValue (Invalid mode: skip ad)
>Exit code: 0    Time: 79.029

here is DebugBar v5.4.1 info

<IMG id=skip_ad_button alt="Skip Ad" src="/images/skip_ad/en.png" height=39>
Edited by whiteegg
Link to comment
Share on other sites

Do you read the small sentences at the bottom of the page? Here a enlargement:

Dafür fallen 4,99 EUR für jede Abo-periode (eine Woche) inkl. 19% MwSt. Abgerechnet über Handy Rechnung

Edit: Sorry. Didn't checked, that the ads are changing and that there is a "Skip"-button on the upper right corner.

Edited by forumer100

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Auf Englisch bitte?

Personally, this is someone trying to get a bunch of people to code something with an example ad.fly so he can get a lot of ad impressions while the code is being worked on.

But that's just me.

Besides... isn't it against ad.fly's TOS to bot past the advert link?

Regardless: From the help file...

_IEImgClick ( ByRef $o_object, $s_linkText [, $s_mode = "src" [, $i_index = 0 [, $f_wait = 1]]] )

$o_object Object variable of an InternetExplorer.Application, Window or Frame object

$s_linkText Text to match the content of the attribute specified in $s_mode

$s_mode [optional] specifies search mode

src = (Default) match the url of the image

name = match the name of the image

alt = match the alternate text of the image

$i_index [optional] If the img text occurs more than once, specify which instance you want by 0-based index

$f_wait [optional] specifies whether to wait for page to load before returning

0 = Return immediately, not waiting for page to load

1 = (Default) Wait for page load to complete before returning

Your syntax is wrong.

_IEImgClick ($oIE, "/images/skip_ad/en.png", "src")
Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Auf Englisch bitte?

First, translation of this is: "In English please?".

Second, my post quoting a german page was targeted towards the OP, who appearently speaks german.

Third, If YOU want to know the content, ... GOOGLE is your friend. :)

BTW, you should alter your username to blue_dragon. ;)

Edit: Sorry. Didn't checked, that the ads are changing and that there is a "Skip"-button on the upper right corner.

Edited by forumer100

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Hi,

I'm sorry I haven't replied sooner: I have only just seen this topic! As a matter of fact, I just finished a script for this, you can download it here!

The application will simply ask you for the URL on adf.ly, it will check that the link is on adf.ly, and if it is approx. 8 seconds latter you will receive a MsgBox with this 'ad free' link, which will also be copied to your clipboard. During the 5 seconds wait period, extra Internet Explorer windows may pop up due to the advertisements on adf.ly, but normally the advertisements don't generate any new windows and you don't see anything!

There is an 'About' item in the tray menu which I would like you to click on. Just bare in mind that two message dialogs can't be shown at once, so you will have to click on 'About', and then dismiss any message dialogs that are visible!

As for the code, well there's nothing somebody else couldn't do, so here it is:

#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
; Don't pause automatically when the tray icon is clicked
Opt("TrayAutoPause", 0)
; Don't show the default tray menu
Opt("TrayMenuMode", 1)
; Set on event mode for the tray menu
Opt("TrayOnEventMode",1)
; Add an Exit option to the tray menu and link it to a function
TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "_Exit")
; Add an About option to the tray menu and link it to a function
TrayCreateItem("About")
TrayItemSetOnEvent(-1, "_About")
; Create varible that holds the title to all windows
Global $title = "adf.ly Ad Skipper by Andy @ Drewscyberworld"
; Register an error handler if there are any unexpected errors
_IEErrorHandlerRegister()
; Create GUI with Internet capabilities, but dont show it!
$oIE = _IECreateEmbedded ()
GUICreate("adf.ly Autoclicker", 2, 2, 2, 2)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
; Ask the user to input there Adf.ly shortened link
While 1
    $adlink = InputBox($title, "Enter a URL from adf.ly below:")
    ; Check the URL provided is valid
    If StringInStr($adlink, "adf.ly") = 0 Then
        ; If the URL that has been provided isn't adf.ly
        If MsgBox(0x4, $title, "Error. The URL you provided doesn't seem to be from adf.ly!" & @CRLF & "Do you want to enter a new URL?") = 7 Then Exit
    Else
        ; If the URL that has been provided is adf.ly
        ExitLoop
    EndIf
WEnd
; Go to the adf.ly URL
_IENavigate($oIE, $adlink)
; Let the page load for 1 second
Sleep(1000)
; Show a ballon from the tray icon, counting down
For $i = 5 To 1 Step -1
    TrayTip($title, "Skiping the ad in: " & $i & " seconds!", 1, 1)
    Sleep(1000)
Next
; The 'Skip Ad' link should be available to click now...
; So click the image based on it's src, and wait for the page to load
_IEImgClick($oIE, "http://adf.ly/images/skip_ad/en.png")
; Tell the user that the ad button has been clicked.
; (Also to give the page chance to load because of a bug in previous function)
TrayTip($title, "'Skip Ad' button clicked!", 1, 1)
; Get the currect URL location of the browser
$adfreeURL = _IEPropertyGet($oIE, "locationurl")
; Put the URL on the clipboard
ClipPut($adfreeURL)
; Provide the user with the URL the picture gave us.
MsgBox(0, $title,"Congratulations! Here is your add free URL: (Which has also been copied to your clipboard)" & @CRLF &  $adfreeURL)
; Exit the program
Exit

; Function to show information about the application
Func _About()
    MsgBox(0, $title, "My name is Andy G, and I wrote this utility! I created this application because a considerable about of people have want a program that does the following... " & @CRLF & @CRLF & "This program will automatically find the location of any adf.ly URL, by visiting the link you input and automatically cliking the 'Skip Ad' button after 5 seconds. It will provide the final link in a message box, but it will also put the link on your clipboard! Obviously the whole process will take approx. 8 seconds, during which new windows may popup. These windows are related to the advertisements on adf.ly and are not dealt with in this release!" & @CRLF & @CRLF &   "If you find any bugs on in this application you can email 'drew@drewscyberworld.net'! Similarily, you can show your support by dropping me a line on that email. Unfortunately, I do not have any pages regarding this application on my website currently!" & @CRLF & @CRLF & "I can not be held responsible for any loss of data or viruses. It is actually against adf.ly's TOS to use such a bot, so use this program at your own will, I can not be held responsible for any action taken against you by anyone for using this application!")
EndFunc
; Function to terminate the application
Func _Exit()
    If MsgBox(0x4, $title, "Are you sure you want to exit the application? It will exit automatically at the end of it's job.") = 6 Then Exit
    EndFunc

Hope That Helps,

Andy

May I also add that I only wrote the script quickly for another member from a different forum, so it's not as polished up as it could be, and I don't know whether I'll be releasing updates or not! The problem I've got is: I need to stay legitimate, and I'm already very busy, so I don't know how long it will be available to download in that location either! Therefore, I don't mind if you redistribute the program, but I would at least download it now whilst you definitely can. I might be that I actual create a web page on my personal website about it, etc. - I just don't know...

Edited by DjATUit
Link to comment
Share on other sites

Thanks for this help...

Hope this help is better:

#include <IE.au3>
$oIE = _IECreate("http://adf.ly/2AbvJ")
Sleep(2000)
$oObject = _IEGetObjById($oIE, "countdown")
Do
    $countdown = _IEPropertyGet($oObject, "innertext")
Until $countdown = 0
Sleep(1000)
$oObject = _IEGetObjById($oIE, "skip_button")
_IEAction($oObject, "click")

or

#include <IE.au3>
#include <INet.au3>
#include <String.au3>
$s_URL = "http://adf.ly/2AbvJ"
$sHTTP = _INetGetSource($s_URL)
$aURL = _StringBetween($sHTTP,"var url = '","';")
$oIE = _IECreate($aURL[0])
Edited by forumer100

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

First of all positive response from DjATUit and especially, from forumer100 :)

Mr.DjATUit complete his adfly tool which is better and i am using forumer100 1st code ...it is my requirement

And i am really thanks form Heart for this effort and coding.

Posted Image

Edited by whiteegg
Link to comment
Share on other sites

First of all positive response from DjATUit and especially, from forumer100 :)

Mr.DjATUit complete his adfly tool which is better and i am using forumer100 1st code ...it is my requirement

And i am really thanks form Heart for this effort and coding.

Posted Image

Whiteegg,

No problem, thank you for thanking me ;) ! After all, it is what this forum is about!

To be honest, I didn't really take that long on it because I only made it for a member on another forum who was too lazy to even attempt the program, so that's way it is not as good as it could be! Plus, I'm not a master at AutoIt or anything. AND, as I have already said, I am very busy at the minute without doing other people's work...

I don't quite get your comment on the second line though. Are you saying, my script looks better, and is more complete, but it doesn't meet all your requirements, so you are using forumer100's code? OR are you saying I need to complete my adfly tool, etc? Either way I don't mind, I'd just like to completely understand your comment! Sorry if I'm seeming a bit thick.

Kind Regards,

DjATUit

PS What is this obsession with German things? This is an English forum! Isn't it?

Link to comment
Share on other sites

PS What is this obsession with German things? This is an English forum! Isn't it?

Scroll back and read my edited posts. It was my negligence. Sorry about this.

But watch Your solution is only valid for english speaking countries.

There are other coutries/languages using "ADF.LY" out there.

Would be better to adapt my solution. :)

Edited by forumer100

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

I don't quite get your comment on the second line though. Are you saying, my script looks better, and is more complete, but it doesn't meet all your requirements, so you are using forumer100's code? OR are you saying I need to complete my adfly tool, etc?

No , No your code is very code and complete it is amazing complete application ... i am using autoit with multimedia Builder..that's why i prefer forumer100.....

using as application i will like your code ...by the why i am using your code

Thanks again you take time for this topic ....

Edited by whiteegg
Link to comment
Share on other sites

Scroll back and read my edited posts. It was my negligence. Sorry about this.

But watch Your solution is only valid for english speaking countries.

There are other coutries/languages using "ADF.LY" out there.

Would be better to adapt my solution. :)

Okay, fine. I just thought it was a bit weird, especially in the English section of this board!

I am aware that ADF.LY is available in languages other than English, but I'm sure other people are capable of figuring things like that out themselves, especially if they're speaking English!

Undoubtedly, your second solution using _INetGetSource(), is the best way to do such a thing, and I fully understand why whiteegg is using it - I even prefer it over my own application! I wish I could think about functions like that.

No , No your code is very code and complete it is amazing complete application

Good good, thanks for the comment. At least now I know what you meant! No offense, but I can see now why forumer100 is providing German solutions...
Link to comment
Share on other sites

Undoubtedly, your second solution using _INetGetSource(), is the best way to do such a thing, and I fully understand why whiteegg is using it - I even prefer it over my own application! I wish I could think about functions like that.

I assume, whiteegg will use my first solution. The _INetGetSource() solution is faster, but has the drawback that there is NO funding for ads to the shortcut owner.

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

I assume, whiteegg will use my first solution. The _INetGetSource() solution is faster, but has the drawback that there is NO funding for ads to the shortcut owner.

Oh, I did not think about the ads - this is probably why ADF.LY don't permit such applications. I wonder then, how legitimate your first solution, and my application actual is, because it does not skip the ad or anything?
Link to comment
Share on other sites

Oh, I did not think about the ads - this is probably why ADF.LY don't permit such applications. I wonder then, how legitimate your first solution, and my application actual is, because it does not skip the ad or anything?

I don't care about legitimation for this site (http://adf.ly/2AbvJ). Never seen/signed/clicked a legal notice of them. Perhaps, the owner of this shortcut signed something, but this is not my duty. If they want to protect there site, they should hide the javascript a little better. Or am I wrong? Opinions !

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...