Sign in to follow this  
Followers 0
Zarox

Help on various things

4 posts in this topic

#1 ·  Posted (edited)

#1

Func Fight()
    ;$oIE = _IEAttach ("Pet me") 
    $sText = _IEPropertyGet($oIE,"innertext")   
    while StringRegExp($sText, 'You have killed a') = 0   
        $oForms = _IEFormGetCollection ($oIE,0)
        $oElement = _IEFormElementGetCollection($oForms,0)   
        _IEAction($oElement,"click")
        $sText = _IEPropertyGet($oIE,"innertext")           
    WEnd
    _IELoadWait ($oIE)
    if StringRegExp($sText, 'You have killed a') then
        $oForms = _IEFormGetCollection ($oIE,0)
        $oElement = _IEFormElementGetCollection($oForms,4)
        _IELoadWait ($oIE)
        _IEAction($oElement,"click")
        _IELoadWait ($oIE)
    elseif StringRegExp($sText, 'Pet not showing up') then
        _IELinkClickByIndex ($oIE, 0)
        _IELoadWait ($oIE)     
        KillMonster()
        _IELoadWait ($oIE)
        fight()
        _IELoadWait ($oIE)
    EndIf
EndFunc

How would I make line 4, have both 'You have killed a' and 'Pet not showing up'. I couldn't find an way to incorporate "or"?

#2

I was wondering if anyone knew how to put a working clock into the GUI in AutoIt.

#3

$var is displayed onto the gui, then when the script is repeated, we get another $var of the same name, is there anyway to keep adding the "$var"s and keeping it displayed up-to-date no the gui

Thanks,

Zarox

Edited by Zarox

Share this post


Link to post
Share on other sites



#1: A bar | is used as or in regular expressions.

while StringRegExp($sText, 'You have killed a|Pet not showing up') = 0oÝ÷ Ø*.ÖÞÊ¡j÷­£
Ú¦êr¢êìyªÜªàºg§²Ø§jëh×6while StringRegExp($sText, '(You have killed a)|(Pet not showing up)') = 0

Share this post


Link to post
Share on other sites

#1 Thank you for that solution. I am testing it right now, as the glitch that it fixed doesn't have all the time.

#2 A clock that takes the time off your computer but stays consistent with the current time by adding one second every second. Also a Timer would work.

#3 I would like it to pull a number off a website with the IE fuctions and then store it as $var, then grab the same $var again but it willl be a different number. Then add those together and display then on the GUI.

Share this post


Link to post
Share on other sites

#2 A clock that takes the time off your computer but stays consistent with the current time by adding one second every second. Also a Timer would work.

Look up TimerInit, TimerDiff, _Now, _NowCalc, and/or _NowTime.

#3 I would like it to pull a number off a website with the IE fuctions and then store it as $var, then grab the same $var again but it willl be a different number. Then add those together and display then on the GUI.

#include <IE.au3>

$var = 0    ;initialize your desired variable
$url = "yourUrlHere"
$oIE = _IECreate($url, 1)
;--------------------------------------------------
;get your number somehow...not enough info provided
;returns the number as $number
;--------------------------------------------------
$var += $number
;do something about displaying it

Be a little more specific and provide more info/code if that doesn't give you enough ideas. :whistle:


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

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  
Followers 0