Jump to content

New Code Help


 Share

Recommended Posts

Hi, this is a new code i made. Its for some game called shimlar. All i want it to is continiously click two spots on the screen until it sees 'select a stat to Raise: STR DEX NTL WIS VIT ALL' and when it see that, i want it to click the spot wher WIS is. It does all that correctly, clicks the proper spots and everything but the problem in it wont read the 'select a stat to Raise: STR DEX NTL WIS VIT ALL' when it shoes up. it just continues to click the original two spots. i tried just ****If 'select a stat to Raise: STR DEX NTL WIS VIT ALL' then*** didnt work, i also tried *****if ControlGetText("Shimlar - Service Pack 3 Internet Explorer" ,'select a stat to Raise: STR DEX NTL WIS VIT ALL',"1"**** i also tried, the and i'm dont know how it works _IEClickLinkByText works, everytime i tried it gave me error. I'm new to this please help

while 1

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

WinWait("Shimlar - Service Pack 3 Internet Explorer","")

If Not WinActive("Shimlar - Service Pack 3 Internet Explorer","") Then WinActivate("Shimlar - Service Pack 3 Internet Explorer","")

WinWaitActive("Shimlar - Service Pack 3 Internet Explorer","")

MouseMove(784,199)

MouseDown("left")

MouseUp("left")

Sleep(4000)

MouseMove(843,221)

MouseDown("left")

MouseUp("left")

Sleep(4000)

if WinGetText("Shimlar - Service Pack 3 Internet Explorer" ,'select a stat to Raise: STR DEX NTL WIS VIT ALL' ) Then

MouseMove(725,308)

MouseDown("left")

MouseUp("left")

Sleep(4000)

endif

Wend

Link to comment
Share on other sites

Welcome to the forums! :think:

First off, please use the code tags when you are posting any code.

Next, I would take your Opt's out of your loop, we dont need to run those over and over.

Also, I replaced the 3 lines you were using the move the mouse and click, with one line.. that utilizes MouseClick (read about it in the help file).

Now, to narrow down the problem... lets see if you are even getting the text from the window...

Try running this and see what the console outputs (you must run the script using the SCITE editor, so we can watch the console output.)

Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 0)

WinWait("Shimlar - Service Pack 3 Internet Explorer", "")
WinActivate("Shimlar - Service Pack 3 Internet Explorer", "")
WinWaitActive("Shimlar - Service Pack 3 Internet Explorer", "")

While 1
    MouseClick("left",784,199,1,0)
    Sleep(4000)
    MouseClick("left",843,221,1,0)
    Sleep(4000)
    $text = WinGetText("Shimlar - Service Pack 3 Internet Explorer", "")
    ConsoleWrite($text&@CRLF)
WEnd
Edited by Simucal
AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

Hey, Thanx for code change works pretty much same. I ran the new script and got on output. After running it it showed a bunch of repeeated:

http://www.shimlar.com/game.php

?

http://www.shimlar.com/game.php

Done

??

??

Dont think its getting anything out or the website. I ran the same code with the wingettext line cahanged to $text = ControlGetText("Shimlar - Service Pack 3 Internet Explorer","","") and that outputted a bunch of :

Shimlar - Service Pack 3 Internet Explorer

Thanx for your help, is there any other way to get text from this page?

Link to comment
Share on other sites

OMG, i feel retarted, should've experimented before i asked for help. Anyways i found a simple solution to my problem :think: , PIXELS :( solved problem

code:

Opt("WinWaitDelay", 100)

Opt("WinTitleMatchMode", 4)

Opt("WinDetectHiddenText", 1)

Opt("MouseCoordMode", 0)

WinWait("Shimlar - Service Pack 3 Internet Explorer", "")

WinActivate("Shimlar - Service Pack 3 Internet Explorer", "")

WinWaitActive("Shimlar - Service Pack 3 Internet Explorer", "")

PixelSearch(469,260,777,323, 524806)

If Not @error Then

MouseClick("left",642,295,1,0)

sleep(4000)

endif

While 1

MouseClick("left",784,199,1,0)

Sleep(4000)

MouseClick("left",843,221,1,0)

Sleep(4000)

PixelSearch(469,260,777,323, 524806,0,1)

If Not @error Then

MouseClick("left",642,295,1,0)

endif

wend

Edited by Wumbo
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...