Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
COUNT TO 5 THEN REPEAT! HELP?
#1
Hi, I have a code that will repeat itself & keep getting the "str+ hwnd2" variable, which is recieved from an ACC Event Trigger which gets the text of a certain Item. What I have is this:

Trigger that recieves the text:

$a 140 0 0 "Button" 10024 "" "#32770" "";;this works fine to recieve the text I need.

Code inside that triggered function:
str+ hwnd2.getwintext(id(10024));;gets the text I want when function is triggered, & sets it to a global variable so i can use it in my rep loop whilst updating every repeat over the code in the macro below;; "Note , the text keeps changing every so often, so that's why it needs updated in the rep loop"

Code that i am having problems with:

rep
,str+ hwnd2
,goto g1
, g1
,_s.getwintext(id(10024 handleofparent))
,if(_s=hwnd2);; if _s=the updated global variable... then check again (this should tell if it changes) "Note , this is working fine"
,,goto g1
,else goto g2
, g2
,but+ id(10024 handleofparent);; HERE LIES MY PROBLEM, I WANT IT TO START COUNTING UNTIL IT REACHES 5 TIMES THAT THE GLOBAL VARIABLE HAS ,CHANGED, WHILST CHECKING THE GLOBAL VARIABLE, SOMETHING LIKE THE FOLLOWING:
,rep
,,str+ hwnd2
,,_s.getwintext(id(10024 handleofparent))
,,if(_s=hwnd2)
,,,RIGHT HERE I WANT IT TO START COUNT AT 1, THEN COUNT UP TO 5 THEN DO THE FOLLOWING WHEN COUNT REACHES 5 TIMES THAT THE GLOBAL ,,,VARIABLE HAS ,,,CHANGED/BEEN TRIGGERED:
#2
That post above was a little confusing I am guessing, seeing as how no reply's lol... here is a revised way of saying what I need, in a simpler way of putting it, like i should have done in the first place!:

I need to have a rep loop that gets the text from a counter that counts from ( 1 TO 10 ) & goes up by 1 every 2 minutes. I.E.:

1(waits 2 minutes)2(waits 2 minutes)3(waits 2 minutes):
Macro
Code:
Copy      Help
str SetCountInDlg
_s.getwintext(id(100 handlewin)) goto g1;; this is the text that counts up by 1 every 2 minutes on a window specified.
;g1
if(_s="3")
SetCountInDlg+1 ;; this should set the # 4 in My Dlg, but doesn't seem to work for me.

Simply I just want it to get the text, if it equals 1,2,3,4,5,6,7 ... just +1 onto the number it retrieves, then set the text in MY DIALOG.. I.E.

Macro
Code:
Copy      Help
if(_s="2")
,_s+1

The above code won't work right!
#3
convert string to int to do match
_s = "2"
int i = val(_s)
if(i = 2)
,i+1
_s = i
out _s
#4
Thank you bro, knew it was something simple... used to know it but forgot, now it clicked back... took 2 days for someone to reply, I'm glad you did

Thanks - Scott


Forum Jump:


Users browsing this thread: 1 Guest(s)