Jump to content

Recommended Posts

Posted

need some help with this

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 182, 49, 192, 124)
$Label1 = GUICtrlCreateLabel("0", 112, 16, 50, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Good = ControlGetText("[Name] SBot v1.44 (C)2008,2009 by bot-cave.net","","[CLASS:Static; INSTANCE:153]")
While 1
If $Good = "Field" Then
GUICtrlSetData($Label1 ,"" & + 1)
EndIf
WEnd

i been trying to mkae it so when it get the controlgettext = That then

Make the label go From 0 To 1 then Form 1 To 2 And So On

But i Can seem to get it working can some one please help me get it going

TY

Best Regards Dragon10660

Posted (edited)

How about reading it for the old value before trying to increment it?

GUICtrlSetData($Label1, Number(GuiCtrlRead($Label1)) + 1)

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

can i also make it so it only does the +1 once then when the controlgettext comes bac do the +1 again

no just +1 all the way to infinity ?

Add a Global flag variable that is set to True when you get a match and increments the field. Then it stays true until the text no longer matches, when it gets set to False again. You only increment the field when it changes from False to True, not for as long as it is True.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

Add a Global flag variable that is set to True when you get a match and increments the field. Then it stays true until the text no longer matches, when it gets set to False again. You only increment the field when it changes from False to True, not for as long as it is True.

:)

problem is that the text stays for more than 1min some times more

so i dunno if that would work

Posted

problem is that the text stays for more than 1min some times more

so i dunno if that would work

What difference would that make? Are you afraid the computer will get bored and quit paying attention? :)

If your script has other things to do in the mean time, put the check in an AdLib function.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted (edited)

Play with the examples in the help file else there are many examples if you search. :)

You will learn so much more quicker that way.

Edited by bo8ster

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

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
  • Recently Browsing   0 members

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