Digital Paint Discussion Board
Digital Paint Community => Other Stuff => Topic started by: Apocalypse on August 21, 2008, 11:40:02 AM
-
Had some trouble with my scripts in mIRC this script should make it so when they say !joke it tells them one of the jokes in the file joke.txt this is the code
ON *:TEXT:*!joke*:#farmstarz:{ //say $read(C:\Bot\joke.txt) }
-
and what's the problem? was it working and it just stopped, or did it not work at all?
the beginning of the script looks correct, but i'm not to familiar with the ending. i've never tried to make a script like that.
-
It never worked the $read bit makes it read a random line from the text file found it on a guide here http://www.cyberarmy.net/library/article/1695
-
what does it say when you try to activate the script?
ok so i looked it over and here is what i found:
ON *:TEXT:!joke:#: {
$read(c:\BOT\joke.txt)
}
did you make the folder like it said to do?
-
It doesn't say anything when I activate. The text file I used Notepad ++ and just left them all on separate lines.
Folder is as shown
-
We've covered JOIN, but what about TEXT?
look at this script:
ON *:TEXT:!joke:#: {
$read(c:\BOT\joke.txt)
}
TEXT is followed by the text the command is waiting for, so when a user types !joke, the bot will tell a joke!
a new command here is $read. Let's look at how it works:
To get a random joke this is the easiest code, but the work behind it is fairly lengthy: go to your C drive and make a folder BOT, and create a notepad file called joke.txt. Then fill it with jokes, but make sure all the jokes start and finish on the same line! By itself, $read will read a random line from joke.txt, hence why you need the jokes starting and finishing on the same line. $read can be fine tuned to make it less random see the mIRC help file if you want to get more detail on it.
SAVE AND TEST!
-
Yeah that script won't work because I tried and it need to say what it is reading somehow I have a similar version for and alias that works.
/joke { //say $read(C:\Bot\joke.txt)}
I tried using in remotes
ON *:TEXT:*!joke*:#farmstarz:{alias /joke}But it doesn't work either
Edit: Changed the //say to msg so it now looks like this
ON *:TEXT:*!joke*:#farmstarz:{ //msg $chan $read(C:\Bot\joke.txt)
}
Edit: Script is now working will post working script later.
-
i want to see what the problem was.
BTW- say and msg do the same thing.
-
Turns out that I just ended up changing it back to
ON *:TEXT:*!joke*:#farmstarz:{ //msg $chan $read(C:\Bot\joke.txt)
}Problem was even though I could have sworn I did.... I never reloaded the script :-[
-
lol, nice.