Jump to content

Need Help With Code


Recommended Posts

  • Moderators

No he will have to manually put that in every time.

You could just do:

$pokerWindow = InputBox("Input Room Title", "Poker Room Name", "", "", 100, 80)

Because it will change every time.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Replies 69
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Moderators

Oh, I tried it, but I don't know what "Sit Out" is. That's not in the title of anything I have. Just let him enter it in manually each time.

The input box should make it simple for him.

By the way: Most of your "Local" constants should be "Globals", he'll keep running into errors with out them.

Edited by ronsrules

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Ok, got a 500 mile round trip fiasco to do now. Good luck to you barry. Way to stick in there LxP, nice to see someone that takes the challenge by the 'ahem'!

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

'Sit Out' appears on the Poker window as hidden text.

Local variables are fine in this instance because the only variable that the function wants to access is $brainWindow, which is passed as a parameter anyway.

Link to comment
Share on other sites

  • Moderators

Good Job LxP!!

Quick question?

func _action($brainWindow)

    local $counter = 1

    while ($counter <= 100)
        local $id = "WindowsForms10.STATIC.app3" & $counter
        local $pos = controlGetPos($brainWindow, "", $id)
        if (isArray($pos) and $pos[0] = 464 and $pos[1] = 96 and $pos[2] = 80 and $pos[3] = 32) then _
            return controlGetText($brainWindow, "", $id)
        $counter = $counter + 1
    wEnd

    return ""

endFunc

Something tells me that this "WindowsForms10.STATIC.app3" eventually will be a "WindowsForms10.STATIC.app4 or 5" and so on, should there be an extra variable just incase 100 is reached to step one more? If so..... Should you put at least a Sleep(55) or Sleep(100) in there, just in case?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I'll pray to the Poker gods every night this week that the 3 in that control ID doesn't change -- it should be safe though because the 3 is part of the controls' class name as verified by WinGetClassList().

I set the loop to stop on 100 because there are no more than 100 controls on the window and if for some reason the counter does actually reach it, something has gone wrong and it won't find the control anyway.

As a result of this thread I'm working on a UDF that will find any control (regardless of class name) according to size and/or position in the window -- this will then be a non-issue.

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...