Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Logging all windows name into text file
#1
Hi, I was trying to log all windows that has different name, but same class into text file. below are my code

    del "$desktop$\PTBOTSYSTEM\LOGS\LOG.txt"
    str s1 s2 f
    f="$desktop$\PTBOTSYSTEM\LOGS\LOG.txt"

    s1.setfile(f)
    s2.getfile(f)
    int wz=win("OpenKore" "ConsoleWindowClass" "" 0x0 "style=0x14EF0000")
    str txt.getwintext(wz)
    int wz2=win("OpenKore" "ConsoleWindowClass" "" 0x0 "style=0x14EF0000")
    str txt2.getwintext(wz2)
    LogFile("######################" 0 "$desktop$\PTBOTSYSTEM\LOGS\LOG.txt")
    LogFile(" " 1 "$desktop$\PTBOTSYSTEM\LOGS\LOG.txt")
    LogFile("######################" 0 "$desktop$\PTBOTSYSTEM\LOGS\LOG.txt")
    LogFile("--------------------------------------------------------------------------------------------------" 0 "$desktop$\PTBOTSYSTEM\LOGS\LOG.txt")
    LogFile(txt.getwintext(wz) 0 "$desktop$\PTBOTSYSTEM\LOGS\LOG.txt")
    LogFile(txt.getwintext(wz2) 0 "$desktop$\PTBOTSYSTEM\LOGS\LOG.txt")
    LogFile("--------------------------------------------------------------------------------------------------" 0 "$desktop$\PTBOTSYSTEM\LOGS\LOG.txt")    
    run "$desktop$\PTBOTSYSTEM\LOGS\LOG.txt" "" "" "" 3


This is whats shows at the text file:

######################
5/27/2023 12:08:43 AM
 
######################
--------------------------------------------------------------------------------------------------
VV01X2:  B49 (39.94%), J38 (45.71%) : w21% : 134,178 pay_fild02 [route,attack,checkMonsters,route] - OpenKore
VV01X2:  B49 (39.94%), J38 (45.71%) : w21% : 134,178 pay_fild02 [route,attack,checkMonsters,route] - OpenKore
--------------------------------------------------------------------------------------------------

What I expected to see in text file:
Image Link

Pls help me, thanks.
#2
Code:
Copy      Help
ARRAY(int) a; int i
win("" "ConsoleWindowClass" "" 0x0 "style=0x14EF0000" a)
for i 0 a.len
,int w = a[i]
,outw w
,
#3
Hi, thanks for the help,

When I run it, the output shows perfectly:
Image link

however the text file shows front integer only:
Image Link

is there anyway to make the text file result same as the quick macro output?

Hi, I found the way, thanks a lot.


Forum Jump:


Users browsing this thread: 1 Guest(s)