Author Topic: mIRC Scripting Problem  (Read 2831 times)

Apocalypse

  • Autococker
  • Posts: 1463
mIRC Scripting Problem
« on: August 21, 2008, 09: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
Code: [Select]
ON *:TEXT:*!joke*:#farmstarz:{ //say $read(C:\Bot\joke.txt) }

coLa

  • Autococker
  • Posts: 1178
Re: mIRC Scripting Problem
« Reply #1 on: August 21, 2008, 09:43:57 AM »
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.

Apocalypse

  • Autococker
  • Posts: 1463
Re: mIRC Scripting Problem
« Reply #2 on: August 21, 2008, 09:48:08 AM »
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

coLa

  • Autococker
  • Posts: 1178
Re: mIRC Scripting Problem
« Reply #3 on: August 21, 2008, 09:58:55 AM »
what does it say when you try to activate the script?

ok so i looked it over and here is what i found:

Quote
ON *:TEXT:!joke:#: {
  $read(c:\BOT\joke.txt)
}

did you make the folder like it said to do?

Apocalypse

  • Autococker
  • Posts: 1463
Re: mIRC Scripting Problem
« Reply #4 on: August 21, 2008, 10:02:27 AM »
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
« Last Edit: August 21, 2008, 10:34:24 AM by Apocalypse »

coLa

  • Autococker
  • Posts: 1178
Re: mIRC Scripting Problem
« Reply #5 on: August 21, 2008, 10:03:30 AM »
Quote
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!

Apocalypse

  • Autococker
  • Posts: 1463
Re: mIRC Scripting Problem
« Reply #6 on: August 21, 2008, 10:24:56 AM »
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.
Code: [Select]
/joke { //say $read(C:\Bot\joke.txt)}
I tried using in remotes
Code: [Select]
ON *:TEXT:*!joke*:#farmstarz:{alias /joke}But it doesn't work either
Edit: Changed the //say to msg so it now looks like this
Code: [Select]
ON *:TEXT:*!joke*:#farmstarz:{ //msg $chan $read(C:\Bot\joke.txt)
}
Edit: Script is now working will post working script later.
« Last Edit: August 21, 2008, 02:48:14 PM by Apocalypse »

coLa

  • Autococker
  • Posts: 1178
Re: mIRC Scripting Problem
« Reply #7 on: August 21, 2008, 10:01:43 PM »
i want to see what the problem was.

BTW- say and msg do the same thing.

Apocalypse

  • Autococker
  • Posts: 1463
Re: mIRC Scripting Problem
« Reply #8 on: August 22, 2008, 12:06:02 PM »
Turns out that I just ended up changing it back to
Code: [Select]
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  :-[

coLa

  • Autococker
  • Posts: 1178
Re: mIRC Scripting Problem
« Reply #9 on: August 22, 2008, 02:26:34 PM »
lol, nice.