mIRC Home    About    Download    Register    News    Help

Print Thread
#245515 24/04/14 01:15 AM
Joined: Apr 2014
Posts: 3
X
Xati Offline OP
Self-satisified door
OP Offline
Self-satisified door
X
Joined: Apr 2014
Posts: 3
Hey i was making an automated bot for a question game, i was wondering if anyone could help me with a delay command so the answers aren't said instantly? So far it's just looking like this
on *:TEXT:*What is 72+4:#: { msg $chan 76 }

There are over 900 questions so it would need to be able to have a delay on each would something like

on *:TEXT:*What is 72+4:#: {.timer 1 1 msg $chan 76 }

work? I tried it but i would have to change the id value on every single one which wouldn't be too good, if anyone can help thank you a lot!

Xati #245522 24/04/14 03:12 AM
Joined: Apr 2014
Posts: 33
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
Why not use $calc


on 1:TEXT:*!math*:#:{
/describe $chan gets out his abacus at $nick $+ 's Request
/var %solution $calc($2-)
/msg $chan the solution to $2- is %solution
}


Xati #245523 24/04/14 10:54 AM
Joined: Mar 2014
Posts: 52
P
Babel fish
Offline
Babel fish
P
Joined: Mar 2014
Posts: 52
timer 1 1
would be 1 second i guess

@bl968 i think he isnt using calc because questions can be made of words too :p

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Then it would just be
Code:
on *:text:What is*:#: { msg # $calc($3-) }

Even if other mathematical questions use words instead of numbers, there's no point in making a command for 74 + 2 for instance.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Xati #245532 24/04/14 04:14 PM
Joined: Apr 2014
Posts: 3
X
Xati Offline OP
Self-satisified door
OP Offline
Self-satisified door
X
Joined: Apr 2014
Posts: 3
I think i solved it but not sure, would i be able to use { .timermsg 1 $rand(1,3) msg $chan } for a message being sent with a random number of seconds between 1 - 3? I've tried it and worked for one question/answer but not sure if it works for several, Sorry to ask such obvious questions!
This is what it looks like

Code:
on *:TEXT:*Quotes - "It is during our darkest moments that we must focus to see the light.":#: { .timermsg 1 $rand(1,3) msg $chan Aristotle Onassis }

Last edited by Xati; 24/04/14 04:14 PM.
Xati #245547 25/04/14 01:15 AM
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
It would work for several.
The problem is you have over 900 questions and that means you have to write over 900 lines on TEXT event aswell.

Solution is put the questions and answer into file.txt with recognized pattern for script to read and parse.
After that, you can load the file into hashtable and I guess script would be less than 20 lines.

e.g.,
Code:
<question 1>:<answer 1>
<question 2>:<answer 2>
.....

or

<question 1>
<answer 1>
<question 2>
<answer 2>
....



Link Copied to Clipboard