How do I add a command that gives a random response?
I tried doing it from a text file (https://pastebin.com/Y9ELqQVv), but it’s only reading the first line. The txt file is located in /plugins and the command is (readfilerand ./addons/stardewtip.txt).
I also tried to add it the way the documentation said, “!addcom !ball (readfilerand ./addons/stardewtip.txt)” but when I try to use the command, it says “undefined”.
Any help would be appreciated!
It’s actually fairly easy. All I did was use the random js as a foundation, and changed a few things to make it it’s own script. If you would like, I can make the script for you with the random responses you want.
@Spoks You do not need the path, if the file is in ./addons:
addcom randfile (readfilerand randfile) [05-17-2017 @ 00:46:59.710 MDT] [MUTED] @IllusionaryBot, command !randfile has been created! randfile [05-17-2017 @ 00:47:01.335 MDT] [MUTED] Are randfile [05-17-2017 @ 00:47:02.386 MDT] [MUTED] You randfile [05-17-2017 @ 00:47:03.299 MDT] [MUTED] There randfile [05-17-2017 @ 00:47:04.097 MDT] [MUTED] How
illusion% ls -l randfile
-rw-rw-r-- 1 illusion illusion 30 May 17 00:47 randfile
illusion% cat randfile
@Spoks I see the documentation is incorrect and will fix that as well. Sorry for the confusion.
@Spoks Sounds good! Just let me know what you want the command to call the random tip to be and I’ll get to work.
I have completed the script for you. Your command to call the random tip is as stated in your original message where it is !ball. I included instructions on how/where to install the scrips in the file. Tested it on my bot and everything works fine, however should something not work, let me know. Download is here: https://app.box.com/s/sa0iihndos4i1v5jat7onrtm2btquusp
And just in case any antivirus gets tripped (doubt it would, but you never know) https://www.virustotal.com/en/file/b811d960820879f95fb3e9005cb9af8e371831c0403b078f6e73faed276b1e0b/analysis/1495173264/