Writefile line override


I wan’t to create a command for subscribers to suggest games on subday with writefile:
(writefile sub.txt, true, (echo) (sender))
It works fine, but every time it creates new line, f.e.:
gamename subscriber1
gamename subscriber1
is it possible to get variable to override each line when same person suggest/using command again?


Change the true part in the variable to false, true would make it append a new line while false will overwrite it.


If I read the original request correctly, “override each line when the same person suggest/using command again.” Does this mean the following:

Bob requests DaggerGame

Bob DaaggerGame

Frank requests DoggerGame


Bob DaggerGame
Frank DoggerGame

Frank requests BadgerGame


Bob DaggerGame
Frank BadgerGame

That is, the entry for “Frank” is replaced as “Frank” already requested a game and “Bob” stays there?


With false it creates only 1 line in file, no matter how many people used command:

(writefile test.txt, false, (echo) (sender))

chatter: !test game
Chatter2: !test gamename
chatter: !test gamename
Chatter2: !test gamename222

test.txt: gamename222 Chatter2


Yes, exactly.


This would require some sort of custom script. Sorry for misunderstanding your first question.


Then. yes, a custom script has to be developed if one single output file is desired that updates based on the request. If multiple output files can be created, that is one per user, that would be fine via a !addcom custom command.

I would ask what the total desire here is. Is it to allow subscribers to create a list of games that they want to see played, only one game allowed of course per subscriber, and are you manually viewing/manipulating the list?


Yes, each month new list - i roll games that will be played on stream on randomizer (how many depends of request) .
Currently using http://streampoll.tv but it request login+permissions from users (and sometimes buggy).
With bot and chat i think must be much easier for users.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.