Autohotkey变量将变量作为变量而不是文本发送(+奖励问题)

时间:2018-08-02 20:35:46

标签: autohotkey

我正在为自己的代码而苦苦挣扎,我希望它读取一个文本文件,并在新文件中将每一行一一发送。问题是,当到达“ fileAppend”部分时,它会写上message1而不是message1的值。我需要这样做,因为文本文件可以有1条或更多行。

这是代码的一部分:

texte=source.txt

Loop, Read, %texte%
message%A_index% := A_LoopReadLine

chiff := 0 ; To keep count of how many lines have been sent
Loop
{
chiff++
message = message%chiff% ;each loop add 1 so it's message1, message2...
filedelete, chat.ogf ; start fresh
FileAppend, say %message%`n, chat.ogf ;thats the tricky part, it write message1 as a text instead of the message1 value. I understand why it does so but I can't figure how to fix it.
;
;Here's the code where it send the game a key to refresh the chat.ogf and send it to the in-game chat.
;
If (A_index = chiff) ; I got either an error about global variable, no variable, or unexpected symbole when I try to modify this.
    break
}

(A_index = chiff)用于在没有更多消息要发送但似乎它们不是同一种值时打破循环。 (我是编码的新手,我自己学习,所以我不知道我在说什么。)

深深感谢您的宝贵时间。如果它丢失了什么,请告诉我。

0 个答案:

没有答案