mIRC Home    About    Download    Register    News    Help

Print Thread
#212811 05/06/09 02:39 PM
Joined: Mar 2008
Posts: 33
S
starr Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2008
Posts: 33
I'm very new at scripting and have reached a stop. I'm trying to create a game that asks random questions. The chatter would type in !q and a random question would appear on the screen. I don't know how to make random text appear. Any help would be appreciated.

starr #212812 05/06/09 02:52 PM
Joined: Mar 2006
Posts: 396
T
Pan-dimensional mouse
Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 396
/help $read
/help $readini


[02:16] * Titanic has quit IRC (Excess Flood)
The_JD #212983 12/06/09 07:41 PM
Joined: Mar 2008
Posts: 33
S
starr Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2008
Posts: 33
I put my questions in a text file. Then I put this code in the script file:
ON *:TEXT:*!q*:#: {
if (%Mona == on) {
msg $chan $nick $+ : this question is for you: //echo $read(questions.txt)
}
}

it's still not working...any help would be appreciated

starr #212984 12/06/09 07:44 PM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
ON *:TEXT:*!q*:#: {
if (%Mona == on) {
msg $chan $nick $+ : this question is for you: $read(questions.txt)
}
}

For this to work you will need a variable named %mona that == on. And you will need a questions.txt file in the $scriptdir with lines of text in it.

This will read a random line from the text file.

DJ_Sol #212985 12/06/09 08:05 PM
Joined: Mar 2008
Posts: 33
S
starr Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2008
Posts: 33
ok..last question I added the variable. I am not sure where to save the text file to...how do I find that directory...and thank you for your patience with a new scripter

starr #212987 12/06/09 09:23 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Enter
Code:
//echo $scriptdir
and it will show you the path where you should put your text file.


Link Copied to Clipboard