Variable help


#1

I dont have the software info as it belongs to a friend, but i was wondering if it was possible to make a command that would pic randomly between 2 responses?
e.g. !gender
Response- Boy or girl (picks one at random)


#2

Use the guide here. Do a search for readfile and readfilerand.


#3

@Auroris will i just create a new notepad document, or will i creat a new folder along side it? and how would i go about naming it so that it works?


#4

Sorry I took a while to respond.

You need to create a new file. Notepad++ is recommended, because stock Notepad does weird things sometimes. You’ll need to name the file something simple, and save it in the ./addons folder.


As an example, I have a !rekt command on my bot for stupid deaths. The command looks like this:
(readfilerand rekt.txt)
In my addons folder, I have that file called rekt.txt. The contents look like this:

(command snuggle)
(command corpsified)
(command murderised)

I have those three seperate commands set up with stuff, however you can put whatever you want in there. So long as that file is saved there, running (readfile) or (readfilerand) in the argument will pull this. You can update the file itself on the fly too, it’s read as called, not loaded into memory when the bot starts.


#5

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