Jump to content

Error!


Recommended Posts

opt("MouseCoordMode", 0)
Global $Paused
HotKeySet("{ESC}", "TogglePause")
$url = "http://www.darkthrone.com/recruiter/index.dt?session=";dont know rest of url
$ObjIE = ObjCreate ("InternetExplorer.Application")
With $ObjIE
    .Visible = True
    .Navigate ($url)
    .width = 800
    .height = 600
    Do
        Sleep(50)
    Until .ReadyState = 4
EndWith
While 1
    With $ObjIE
        Do
            Sleep(50)
        Until .ReadyState = 4
    EndWith
    $theText = $ObjIE.document.body.innerText
    If StringInStr($theText, "You have been recruited into the army of") Or StringInStr($theText, "Due to players using automated programs which hurt our site, refreshing has been disabled") Then
        If StringInStr($theText, "You have been recruited into") And  StatusbarGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "Done") Then
            MouseClick("Left", 325, 418, 1)
        ElseIf StringInStr($theText, "Due to players using automated programs which hurt our site, refreshing has been disabled") And StatusbarGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "Done") Then
            MouseClick("Left", 330, 510, 1)
        EndIf
    EndIf
WEnd
Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc  ;==>TogglePause

There is my code and here is the error!

Posted Image

Any help?

Link to comment
Share on other sites

Thats because you use a mouseclick to change the url, then the text does not belong to the object defined. Try this:

Global $Paused
HotKeySet("{ESC}", "TogglePause")
$url = "http://www.darkthrone.com/recruiter/index.dt?session=";dont know rest of url
$ObjIE = ObjCreate ("InternetExplorer.Application")
browse_to($ObjIE ,$url)

While 1
    With $ObjIE
        Do
            Sleep(50)
        Until .ReadyState = 4
    EndWith
    $theText = $ObjIE.document.body.innerText
    If StringInStr($theText, "You have been recruited into the army of") Or StringInStr($theText, "Due to players using automated programs which hurt our site, refreshing has been disabled") Then
        If StringInStr($theText, "You have been recruited into") And  StatusbarGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "Done") Then
            browse_to($ObjIE ,"Dont know the url");<== New url to browse to
        ElseIf StringInStr($theText, "Due to players using automated programs which hurt our site, refreshing has been disabled") And StatusbarGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "Done") Then
            browse_to($ObjIE ,"Dont know the url");<== New url to browse to
        EndIf
    EndIf
WEnd


Func browse_to($ObjIE,$url)
    if Isobj($ObjIE) then
        With $ObjIE
            .Visible = True
            .Navigate ($url)
            .width = 800
            .height = 600
            Do
                Sleep(50)
            Until .ReadyState = 4
        EndWith
    Endif
Endfunc
Link to comment
Share on other sites

Well im going to tick you off by saying that the url is random each time. Which is no lie. Im going to do this whatever it takes.

<{POST_SNAPBACK}>

As the url is random, you can retrieve it from the $theHTML = $ObjIE.document.body.innerHTML or simpler:

You know the location of the link, move your mouse to there and read the link from the status bar :(

This can be done

Link to comment
Share on other sites

The status bar option is out, the url wont show. So that no go. I looked into the source and found something complex.

<h4 style="color: #DDDDDD">248 / 350 clicked today</h4>

<script language="javascript">

var myGlobalThis = this;

var pret = false;

img_ready = new Image();

img_not_ready = new Image();

img_ready.src = "http://www.darkthrone.com/templates/default/images/buttons/recruit1.gif";

</script>

<form name="pibm" action="recruitloop.dt" method="get">

<input type="hidden" name="session" value="">

<input type="hidden" name="alliance" value="-1">

<input type="hidden" name="ticket" value="415786">

<input type="image" style="border=0px;" name="nextimg" id="nextimg" onclick="return validate();" src="http://www.darkthrone.com/templates/default/images/buttons/recruit2.gif">

</form>

<script language="javascript">

function ready() {

pret = true;

img_not_ready.src = document.getElementById("nextimg").src;

document.getElementById("nextimg").src = img_ready.src;

}

function validate() {

if (pret) {

document.getElementById("nextimg").src = img_not_ready.src;

}

return pret;

}

setTimeout("myGlobalThis.ready()", 1500);

</script>

<h2>You have been recruited into the army of althfel</h2>

<h3>althfel is a level 37 Undead Fighter</h3>

<h4>You have just increased althfel's population to 8418.</h4>

<img src="/images/defaultavatars/2.jpg" width="200" height="200"><br><br>

I really want to do this, i know it can be done! It has to be!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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