Jump to content
Sign in to follow this  
scriptnub

Changing a script

Recommended Posts

scriptnub

#include <IE.au3>

#include <String.au3>

$oIE = _IECreate("http://www.immoral-attack.com")

MsgBox("", "", "Press for start.")

While 1

$oSubmit = _IEGetObjByName($oIE, "attack")

_IEAction($oSubmit, "click")

_IELoadWait($oIE)

$String = _StringBetween(_IEBodyReadHTML($oIE), '<CENTER><A href="', '">Continue Slaying Monsters</A></CENTER>')

If @error Then

ClipPut(_IEDocReadHTML($oIE))

MsgBox("", "", "Error")

Exit

EndIf

_IENavigate($oIE, "http://www.immoral-attack.com/" & $String[0])

WEnd

This script was made for me a long time ago and I love it, only thing that could make it better is if instead of making me open a new page when the script Errors it just lets me keep the same page up and keep going from where it left off. Hopefully someone can assist me in making these changes

thanks

Share this post


Link to post
Share on other sites
GEOSoft

Are you refering to the @Error after the _StringBetween() call? If so just remove the Exit otherwise tell us where you are getting the error that forces you to open a new page.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
scriptnub

Are you refering to the @Error after the _StringBetween() call? If so just remove the Exit otherwise tell us where you are getting the error that forces you to open a new page.

The error occurs when I have a security check for the game. Once that happens the script closes and I'm forced to open the script again. When i open the new script it opens a new IE page to start the process over

I'm wanting to start a new script without having to open a new IE page so I can use the page i'm already on

Edited by scriptnub

Share this post


Link to post
Share on other sites
DW1

Perhaps something like this?

#include <IE.au3>
#include <String.au3>
If WinExists("Immoral Attack") Then
    $oIE = _IEAttach("Immoral Attack")
Else
    $oIE = _IECreate("http://www.immoral-attack.com")
EndIf
MsgBox("", "", "Press for start.")
While 1
    $oSubmit = _IEGetObjByName($oIE, "attack")
    _IEAction($oSubmit, "click")
    _IELoadWait($oIE)
    $String = _StringBetween(_IEBodyReadHTML($oIE), '<CENTER><A href="', '">Continue Slaying Monsters</A></CENTER>')
    If @error Then
        ClipPut(_IEDocReadHTML($oIE))
        MsgBox("", "", "Error")
        Exit
    EndIf
    _IENavigate($oIE, "http://www.immoral-attack.com/" & $String[0])
WEnd

Share this post


Link to post
Share on other sites
scriptnub

Perhaps something like this?

#include <IE.au3>
#include <String.au3>
If WinExists("Immoral Attack") Then
    $oIE = _IEAttach("Immoral Attack")
Else
    $oIE = _IECreate("http://www.immoral-attack.com")
EndIf
MsgBox("", "", "Press for start.")
While 1
    $oSubmit = _IEGetObjByName($oIE, "attack")
    _IEAction($oSubmit, "click")
    _IELoadWait($oIE)
    $String = _StringBetween(_IEBodyReadHTML($oIE), '<CENTER><A href="', '">Continue Slaying Monsters</A></CENTER>')
    If @error Then
        ClipPut(_IEDocReadHTML($oIE))
        MsgBox("", "", "Error")
        Exit
    EndIf
    _IENavigate($oIE, "http://www.immoral-attack.com/" & $String[0])
WEnd

that did it... thank you

Share this post


Link to post
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
Sign in to follow this  

×