Deep Bot - Twitch Streamer Assistant
Deep Bot => Help/Support => Topic started by: Sizzles on June 21, 2017, 01:41:13 PM
-
So i am trying to get a command that will read a text file and check if @user@ is in the text file then if it is it will run a success command and it if isn't then i will run a fail command. Is this possible and how would i do it?
-
@if@[@readfile@[(name of text file).txt]||@user@||!successcommand||!failcommand]
You can also just whisper the user that the command isn't ready or they arent the person in the text file by replacing "!failcommand" (or whatever the failcommand you have is called) with /w @user@ You aren't on the list! Full example below.
@if@[@readfile@[supercoolguys.txt]||@user@||!successcommand||/w @user@ You aren't cool enough for this command!]
The issue however is that there isn't a way to search a @savelog@. So if you had a command that added people to a @savelog@ text file you wouldn't be able to search to see if they are within the file. There's no search function.
To remedy this you can have a command that makes a new txt file per user (Yeah, lots of text files...) and put in in a new folder. So in custom logs make a "coolguyslist" folder and then make the command below.
@savefile@[coolguylist/@user@.txt,@user@]
That makes a text file with the users name and checks to see if their name is inside it. From there you can run the @if@ command to check permissions.
-
The second command you suggested is more what i am looking for as it is like 20 viewers and adding more each day.
I did have it set up like @if@[@readfile@[Redeem\\Fluffcup\\Fluffs\\Fluffs.txt]||@user@||!redeempass3 @target@[1] @target@[2|50]||!redeemfluff @target@[1] @target@[2|50]] but as you said there is no search so that is why it wasn't working.
Could i just do @if@[@readfile@[Redeem\\Fluffcup\\Fluffs\\@user@.txt]||@user@||!redeempass3 @target@[1] @target@[2|50]||!redeemfluff @target@[1] @target@[2|50]] It is in a completely different file from my other @readfile@ stuff so it shouldn't interfere, correct? (currently not on computer to test)
-
Yeah as long as its in a different folder from any other @user@.txt type things you should be fine. The first half of your example should work fine, granted I cant confirm the rest without knowing what the targets are and all that. But yeah, that should get what you want.
-
Yeah thanks it worked perfectly. Kind of sucks that there has to be so many text files but guess it is a case of had to. Thanks again
-
You're welcome. Yeah it does indeed suck. Maybe eventually some search function could be added for @savelog@ files. Until then though at least it works for now. No