Hello,
I have a trigger that fires off when the first line of an item identification comes up, and launches a script that I hoped would write the information to a file, up until a blank line. Here's what I'm using:
Here's the error I'm getting:
The file is created, but remains empty. I'm guessing it's a problem with reading in output from the world. What's the best way to pipe that data into a file?
I have a trigger that fires off when the first line of an item identification comes up, and launches a script that I hoped would write the information to a file, up until a blank line. Here's what I'm using:
item_list = io.open("itemlist.txt", "a")
repeat
line = io.read()
item_list:write(line)
until line == ""
item_list:close()Here's the error I'm getting:
Run-time error
Immediate execution
[string "Trigger: "]:5: bad argument #1 to 'write' (string expected, got nil)
stack traceback:
[C]: in function 'write'
[string "Trigger: "]:5: in main chunkThe file is created, but remains empty. I'm guessing it's a problem with reading in output from the world. What's the best way to pipe that data into a file?