Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how 2 read id #s from a text file
#1
Im trying to make it so the macro logs ids to a text file from my site and checks to see if its logged the same one or not..

the text looks like this

873625
746352
634869
385736
as it logs the ids

but i need it to look in the text file to see if it done logged the id and if so skip and look again

this is the code

str n=htm("TD" " [] [] [] " "" win("Window" "#32770") 0 135 0x21 0 10)

str s.getfile("$desktop$\id.txt")

int i=find(s n)

if i = -1
,mes("Done logged")
else
,_s=n; _s.setfile("$desktop$\id.txt" -1 -1 1)
,mes("Logged")


I have tried and tired to get this to work and to work with the info that was posted here How 2 read information on a file

and still dont work it only reads the first line in the test file and thats it..

Can someone help me here??
#2
maybe should be
if i != -1 ;;if found

also replace find to findw. It finds whole word.

also, str n=htm(...) usually is not used. n will be a number that is different each time and it isn't an id.
#3
i will try that and see what i can get as for

str n=htm("TD" " [] [] [] " "" win("Window" "#32770") 0 135 0x21 0 10)

the index of it 135 will change as it goes down the list and log the id of that index
#4
Not sure how your file works but if the 135 changes this may or may not work.

str n=htm("TD" " [] [] [] " "" win("Window" "#32770") 0 * 0x21 0 10)
#5
that dont seem to work..

Here what im trying to do i have a website and i want the online users ids or names to be logged and if they have done been logged not to log them again..

this is way the str n = (place of user name or id on my site ) so i can make one for each index on the site where the username id is and this way it can log or skip them
#6
I think this should work, when you have n

str s.getfile("$desktop$\id.txt")

int i=findw(s n)

if i != -1
,mes("Done logged")
else
,_s=n; _s.setfile("$desktop$\id.txt" -1 -1 1)
,mes("Logged")

but I don't know where you get n.
#7
The code im working on aint done. I well have to make it so it will log the IDs And maybe even the IPs auto but for now i have to change the str n = () on my own..
But it should log and skip even with me changing it and its not.. Like this i toke it right from this site it should log your username and it dont..

The str n = came from your member list its about the same as i want to log but mine is the online users..

str n=htm("A" "Gintaras" "" win("Quick Macros Forum • Members - Windows Internet Explorer" "IEFrame") 0 55 0x21 10)

str s.getfile("$desktop$\id.txt")

int i=findw(s n)

if i != -1
,mes("Done logged")
else
,_s=n; _s.setfile("$desktop$\id.txt" -1 -1 1)
,mes("Logged")


and this is what it logged here..
In the id.txt
49024700
49025132
78558020
49025564
49025996
49026428
49026860


Forum Jump:


Users browsing this thread: 1 Guest(s)