Jump to content
Sign in to follow this  
Sardith

FileReadLine

Recommended Posts

Sardith

See below

Edited by Sardith

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites
PaulIA

$file = FileOpen("test.cfg", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf


While 1
    $Name1 = FileReadLine($file, 1)
    If $Name1 = "" Then
    Sleep(100)
    Else
    ToolTip($Name1, 0,0)
EndIf
Wend

FileClose($file)
I think you lost me as to what you wanted to do with this. This isn't the real code, is it? You'll never exit the while/wend loop with this. Can you be more specific about what you're trying to do?


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites
mikehunt114

If you want to do what's inside your while loop for all 20 lines, why not use a for loop:

For $i=1 To 20
    $Name = FileReadLine($file, $i)
    If $Name = "" Then
    Sleep(100)
    Else
    ToolTip($Name, 0,0)
EndIf
Next

Something like that?

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites
Sardith

Thanks mike hunt. First time i've tryed to do anything like this =).

$file = FileOpen("C:\Program Files\KRU\Dark Ages\Aeonium\Friendlist.cfg", 0)
$hWnd = WinGetHandle("Darkages");Name of the programs' title
$Message = "Looking for Group."



For $i=1 To 20
    ToolTip("", 0,0)
    $Name = FileReadLine($file, $i)
    If $Name = "" Then
    Sleep(100)
    Else
ControlSend($hWnd, "", "", "{ESC}+")
sleep(30)
ControlSend($hWnd, "", "", "{LSHIFT}+'")
sleep(50)
ControlSend($hWnd, "", "", $Name)
sleep(100)
ControlSend($hWnd, "", "", "{ENTER}")
sleep(40)
ControlSend($hWnd, "", "", $Message)
sleep(100)
ControlSend($hWnd, "", "", "{ENTER}")
Sleep(100)
sleep(1000)
EndIf
Next

While 1
    Sleep(100)
    WEnd

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites
mikehunt114

Ok, what you want is something along these lines then:

$file = FileOpen("C:\Program Files\KRU\Dark Ages\Aeonium\Friendlist.cfg", 0)
$hWnd = WinGetHandle("Darkages")
$Message = "Looking for Group."

If $file = -1 Then
    Exit
Else
    For $i = 1 to 20
        Dim $Array[20]
        $Array[$i] = FileReadLine($file, $i)
        if not $Array[$i] = "" Then
            ControlSend($hWnd, "", "", "{ESC}+")
            sleep(30)
            ControlSend($hWnd, "", "", "{LSHIFT}+'")
            sleep(50)
            ControlSend($hWnd, "", "", $Array[$i])
            sleep(100)
            ControlSend($hWnd, "", "", "{ENTER}")
            sleep(40)
            ControlSend($hWnd, "", "", $Message)
            sleep(100)
            ControlSend($hWnd, "", "", "{ENTER}")
            Sleep(100)
        EndIf
    Next
EndIf

Edit: Yeah what you got there looks like it will do the trick :whistle: But wth is your while loop doing there at the end?

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites
mikehunt114

Thanks mike hunt. First time i've tryed to do anything like this =).

While 1
    Sleep(100)
    WEnd
I just wanted to know what you were doing with that, I don't see it in your code now though. Are you still having problems?

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites
Sardith

It's working great. Thanks again. That was in there, as I was progressing with the code.


[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites
mikehunt114

It's working great. Thanks again. That was in there, as I was progressing with the code.

Great :whistle:


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites
Sardith

I need a little help with the gui, I want to take what I enter into the inputs, and use that as the needed info for directory/friendlist. Any help would be great.

For $i=1 To 20
$Directory= GUICtrlRead($CharName)
$Spam = GUICtrlRead($Message)
$file = FileOpen("C:\Program Files\KRU\Dark Ages\" & $Directory & "\" & "Friendlist.cfg", 0)
    $Name = FileReadLine($file, $i);Reads all the friends on your list, 1-20.
    If $Name = "" Then; If there's not a name anywhere in the 1-20. Ie. 1. Sardith 2."" 3. Shynd    Deals with blanks
    Sleep(100)
    Else
_SendWhisper($hWnd, $name, $Spam) ; Sends it to the friends that exist on your friends list.
sleep(100)
EndIf
Next
oÝ÷ Ù«­¢+Ø(Ì´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´(Õѽ%ÐYÉÍ¥½¸è̸ȸĸÄȡѤ(ÕÑ¡½ÈèMÉ¥Ñ ((MÉ¥ÁÐչѥ½¸è(%MÁ´ÌäíÌÉ¥¹Ìäí̱¥ÍÐ(´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´((í%¹±ÕÌ(¥¹±Õ±ÐíU%
½¹ÍѹÑ̹ÔÌÐì((í5­Ì¥Ðͼ¥ÐÌäíÌÁÕÍ°¹½Ð͹¥¹ÍÁ´½¸ÍÑÉнѡÁɽɴ)±½°ÀÌØíAÕÍôÀ(((íMÑÌå½ÕÈ¡½Ñ­ä)!½Ñ-åMÐ ÅÕ½Ðíí%9MIQôÅÕ½Ðì°ÅÕ½ÐíMÁ´ÅÕ½Ðì¤((íÕ¤¹µ)U%
ÉÑ ÅÕ½ÐíÉ­ÌMÁµµÈÅÕ½Ðì°ÈäÜ°ÈÔà°´Ä°´Ä°´Ä¤((í5¥¸½5à½
±½Í)U%MÑ=¹Ù¹Ð ÀÌØíU%}Y9Q}
1=M°ÅÕ½ÐíMÁ¥±Ù¹ÑÌÅÕ½Ðì¤)U%MÑ=¹Ù¹Ð ÀÌØíU%}Y9Q}5%9%5%i°ÅÕ½ÐíMÁ¥±Ù¹ÑÌÅÕ½Ðì¤)U%MÑ=¹Ù¹Ð ÀÌØíU%}Y9Q}IMQ=I°ÅÕ½ÐíMÁ¥±Ù¹ÑÌÅÕ½Ðì¤((íMÑÑÝ¡¸É¸$)U%MÑMÑÑ¡M]}M!=¤((í=ÁÑ¥½¹Ì)=ÁÐ ÅÕ½ÐíU%
½½É5½ÅÕ½Ðì°Ä¤)=ÁÐ ÅÕ½ÐíU%IÍ¥é5½ÅÕ½Ðì°Ä¤)=ÁÐ ÅÕ½ÐíU%=¹Ù¹Ñ5½ÅÕ½Ðì°Ä¤(((í%¹ÁÕÑÌÝ¥Ñ Õ¹Ñ¥½¹Ì½1°)U%
Ñɱ
ÉÑ1° ÅÕ½Ðí¹ÑÈå½ÕÈ¡ÉÑȹµèÅÕ½Ðì°ÄÀ°ÐÀ¤(ÀÌØí
¡É9µôU%
Ñɱ
ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°ÄÀ°ØÀ°ÈÀÀ°ÈÀ¤)U%
Ñɱ
ÉÑ1° ÅÕ½Ðí5ÍÍå½ÔݹÐѼÍÁ´èÅÕ½Ðì°ÄÀ°ÄÐÀ¤(ÀÌØí5ÍÍôU%
Ñɱ
ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°ÄÀ°ÄØÀ°ÈÀÀ°ÈÀ¤)U%
Ñɱ
ÉÑ1° ÅÕ½Ðí%¹ÍÉÐôMÁ´É¥¹Ìäí̱¥ÍÐÅÕ½Ðì°äаÈÐÔ°ÄÔÀ°Ä̤((í5¥¸½5à½
±½Íչѥ½¹Ì)Õ¹MÁ¥±Ù¹ÑÌ ¤((M±Ð(
ÍU%}
QI1%ôÀÌØíU%}Y9Q}
1=M((á¥Ð((
ÍU%}
QI1%ôÀÌØíU%}Y9Q}5%9%5%i((
ÍU%}
QI1%ôÀÌØíU%}Y9Q}IMQ=I((¹M±Ð()¹Õ¹(((íÑÌÑ¡¡¹±½É­Ì(ÀÌØí¡]¹ô]¥¹Ñ!¹± ÅÕ½ÐíÉ­ÌÅÕ½Ðì¤í9µ½Ñ¡ÁɽɵÌÌäìѥѱ((í5ÍÍå½ÔݹÐѼ͹((()]¡¥±Ä)%ÀÌØíAÕÍôÄQ¡¸í
¡­Ì¥å½Ô¡¥ÐÑ¡¡½Ñ­ä()½ÈÀÌØí¤ôÄQ¼ÈÀ(ÀÌØí¥ÉѽÉäôU%
ÑɱI ÀÌØí
¡É9µ¤(ÀÌØíMÁ´ôU%
ÑɱI ÀÌØí5Íͤ(ÀÌØí¥±ô¥±=Á¸ ÅÕ½ÐíèÀäÈíAɽɴ¥±ÌÀäÈí-ITÀäÈíɬÌÀäÈìÅÕ½ÐìµÀìÀÌØí¥ÉѽÉäµÀìÅÕ½ÐìÀäÈìÅÕ½ÐìµÀìÅÕ½ÐíÉ¥¹±¥ÍйÅÕ½Ðì°À¤($ÀÌØí9µô¥±I1¥¹ ÀÌØí¥±°ÀÌØí¤¤íI̱°Ñ¡É¥¹Ì½¸å½Õȱ¥ÍаĴÈÀ¸(%ÀÌØí9µôÅÕ½ÐìÅÕ½ÐìQ¡¸ì%Ñ¡ÉÌäí̹½Ð¹µ¹åÝ¡É¥¸Ñ¡Ä´ÈÀ¸%¸Ä¸MÉ¥Ñ È¸ÅÕ½ÐìÅÕ½Ðì̸M¡å¹±ÌÝ¥Ñ ±¹­Ì(M±À ÄÀÀ¤(±Í)}]¡¥ÍÁÈ ÀÌØí¡]¹°ÀÌØí¹µ°ÀÌØíMÁ´¤ìM¹Ì¥ÐѼѡɥ¹ÌÑ¡Ðá¥Íн¸å½ÕÈÉ¥¹Ì±¥Íи)ͱÀ ÄÀÀ¤)¹%)9áÐ((ÀÌØíAÕÍôÀìMѽÁÌ¥ÐÑÈ͹¥¹Ñ¡µÍÍѼ±°å½ÕÈÉ¥¹Ì¸)ÕÍС¥ÐÑ¡¡½Ñ­äѼÉÕ¸¥Ð¥¸¸)M±À ÄÀÀ¤)¹%)]¹()Õ¹MÁ´ ¤(%ÀÌØíAÕÍôÀQ¡¸(ÀÌØíAÕÍôÄ(±Í(ÀÌØíAÕÍôÀ(¹%)¹Õ¹()Õ¹=¹Õѽ%Ñá¥Ð ¤(í¥±
±½Í ÀÌØí¥±¤)¹Õ¹((ììììììììììììììììììììììììììììììììììììììììììììììììììììììììììììììì(ìììììììììììììììììììììììììììììììììììììììììììììììììììììììììììììì((íM¡å¹ÌäíÌÁ½ÍÐ5ÍÍ¡]¡Ñ̹¤)Õ¹}5­1½¹ ÀÌØí1½]½É°ÀÌØí!¥]½É¤(IÑÕɸ ¥Ñ=H ÀÌØí!¥]½É¨ÁàÄÀÀÀÀ°   ¥Ñ9 ÀÌØí1½]½É°Áᤤ)¹Õ¹()Õ¹}-åÌ ÀÌØí¡]¹°ÀÌØí­å̤(%%ÀÌØí¡]¹±ÐìôÀ=ÈMÑÉ¥¹1¸ ÀÌØí­å̤ôÀQ¡¸($%MÑÉÉ½È ´Ä¤($%IÑÕɸ±Í(%¹%($($ÀÌØí­åÌôMÑÉ¥¹UÁÁÈ ÀÌØí­å̤($($ÀÌØí­åÌôMÑÉ¥¹IÁ± ÀÌØí­åÌ°ÅÕ½ÐìäØìÅÕ½Ðì°
¡È ÁáÀ¤¤($ÀÌØí­åÌôMÑÉ¥¹IÁ± ÀÌØí­åÌ°ÅÕ½ÐíøÅÕ½Ðì°
¡È ÁáÀ¤¤($ÀÌØí­åÌôMÑÉ¥¹IÁ± ÀÌØí­åÌ°ÅÕ½Ðì´ÅÕ½Ðì°
¡È Áá   ¤¤($ÀÌØí­åÌôMÑÉ¥¹IÁ± ÀÌØí­åÌ°ÅÕ½ÐìôÅÕ½Ðì°
¡È Áá   ¤¤($ÀÌØí­åÌôMÑÉ¥¹IÁ± ÀÌØí­åÌ°ÅÕ½Ðíí9QIôÅÕ½Ðì°
¡È Áᤤ($ÀÌØí­åÌôMÑÉ¥¹IÁ± ÀÌØí­åÌ°ÅÕ½ÐííQ ôÅÕ½Ðì°
¡È Áà䤤($ÀÌØí­åÌôMÑÉ¥¹IÁ± ÀÌØí­åÌ°ÅÕ½ÐííM
ôÅÕ½Ðì°
¡È ÁàŤ¤($ÀÌØí­åÌôMÑÉ¥¹IÁ± ÀÌØí­åÌ°ÅÕ½ÐííÕôÅÕ½Ðì°
¡È ÁàÜФ¤($ÀÌØí­åÌôMÑÉ¥¹IÁ± ÀÌØí­åÌ°ÅÕ½ÐííÄÉôÅÕ½Ðì°
¡È Áàݤ¤($ÀÌØí­åÌôMÑÉ¥¹IÁ± ÀÌØí­åÌ°ÅÕ½ÐííM!%QôÅÕ½Ðì°ÅÕ½Ðì¬ÅÕ½Ðì¤($(%1½°ÀÌØí¤°ÀÌØíÉÐ(%1½°ÀÌØíÍ¡¥Ñ½Ý¸ô±Í($(%½ÈÀÌØí¤ôÄQ¼MÑÉ¥¹1¸ ÀÌØí­å̤($%%MÑÉ¥¹5¥ ÀÌØí­åÌ°ÀÌØí¤°Ä¤ôÅÕ½Ðì¬ÅÕ½ÐìQ¡¸($$%±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíA½ÍÑ5ÍÍÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡]¹°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÁàÄÀÀ°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÁàÄÀ°ÅÕ½Ðí±½¹ÅÕ½Ðì°ÁàÀÀÉÀÀÀĤ($$%±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíA½ÍÑ5ÍÍÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡]¹°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÁàÄÀÀ°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÁàÄÀ°ÅÕ½Ðí±½¹ÅÕ½Ðì°ÁàÐÀÉÀÀÀĤ($$$ÀÌØíÍ¡¥Ñ½Ý¸ôQÉÕ($$%M±À Ĥ($$%
½¹Ñ¥¹Õ1½½À($%±Í($$$ÀÌØíÉÐô±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½Ðí5ÁY¥ÉÑÕ±-äÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°Í¡MÑÉ¥¹5¥ ÀÌØí­åÌ°ÀÌØí¤°Ä¤¤°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°À¤($$%%%ÍÉÉä ÀÌØíÉФQ¡¸($$$%±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíA½ÍÑ5ÍÍÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡]¹°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÁàÄÀÀ°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°Í¡MÑÉ¥¹5¥ ÀÌØí­åÌ°ÀÌØí¤°Ä¤¤°ÅÕ½Ðí±½¹ÅÕ½Ðì°}5­1½¹ Ä°ÀÌØíÉÑlÁt¤¤($$$%M±À Ĥ($$$%±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíA½ÍÑ5ÍÍÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡]¹°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÁàÄÀÄ°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°Í¡MÑÉ¥¹5¥ ÀÌØí­åÌ°ÀÌØí¤°Ä¤¤°ÅÕ½Ðí±½¹ÅÕ½Ðì°}5­1½¹ Ä°ÀÌØíÉÑlÁt¤¬ÁáÀÀÀÀÀÀÀ¤($$$%M±À Ĥ($$%¹%($%¹%($%%ÀÌØíÍ¡¥Ñ½Ý¸Q¡¸($$%±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíA½ÍÑ5ÍÍÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡]¹°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÁàÄÀÄ°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÁàÄÀ°ÅÕ½Ðí±½¹ÅÕ½Ðì°ÁáÀÉÀÀÀĤ($$%M±À Ĥ($$$ÀÌØíÍ¡¥Ñ½Ý¸ô±Í($%¹%(%9áÐ($(%IÑÕɸQÉÕ)¹Õ¹()Õ¹}M¹QáÐ ÀÌØí¡]¹°ÀÌØíÍÑȤ(%%ÀÌØí¡]¹ôÀ=ÈMÑÉ¥¹1¸ ÀÌØíÍÑȤôÀQ¡¸($%MÑÉÉ½È ´Ä¤($%IÑÕɸ(%¹%($(%½ÈÀÌØí¤ôÄQ¼MÑÉ¥¹1¸ ÀÌØíÍÑȤ($%±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíA½ÍÑ5ÍÍÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡]¹°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÁàÄÀÈ°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°Í¡MÑÉ¥¹5¥ ÀÌØíÍÑÈ°ÀÌØí¤°Ä¤¤°ÅÕ½Ðí±½¹ÅÕ½Ðì°À¤($%M±À Ĥ(%9áÐ)¹Õ¹()Õ¹}]¡¥ÍÁÈ ÀÌØí¡]¹°ÀÌØí¹µ°ÀÌØíÍÑȤ(%%ÀÌØí¡]¹ôÀ=ÈMÑÉ¥¹1¸ ÀÌØíÍÑȤôÀ=ÈMÑÉ¥¹1¸ ÀÌØí¹µ¤ôÀQ¡¸($%MÑÉÉ½È ´Ä¤($%IÑÕɸ(%¹%($(%}-åÌ ÀÌØí¡]¹°ÅÕ½ÐííM
ô¬ÅÕ½ÐìµÀì
¡È Áᤤ(%M±À ÔÀ¤(%}M¹QáÐ ÀÌØí¡]¹°ÀÌØí¹µ¤(%M±À Ĥ(%}-åÌ ÀÌØí¡]9°ÅÕ½Ðíí9QIôÅÕ½Ðì¤(%M±À ÌÀ¤(%}M¹QáÐ ÀÌØí¡]¹°ÀÌØíÍÑȤ(%M±À ÌÀ¤(%}-åÌ ÀÌØí¡]¹°ÅÕ½Ðíí9QIôÅÕ½Ðì¤)¹Õ¹((

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×