mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2016
Posts: 15
D
Dan Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Nov 2016
Posts: 15
Hi guys,

I am finally getting around to developing a few bots in scripting and just need to know something . Is there a way to trigger a response regardless of the keyword? So to respond to literally anything the user initiates conversation with ? Maybe I am being dense and completely overlooking it! ?

Also, I am going to deliver a set piped,sequential set of messages to the user and want to ignore the user after all messages have been sent . I have read that it's possible, but say for example its possible to use a * for triggering the script with ANYTHING received as I mentioned above, how could I stop the sequence starting over again when the user sends the 2nd, 3rd, 4th response ? I hope I am making sense !


Last edited by Dan; 14/11/16 12:18 AM.
Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
This will trigger on any /msg or /query from a user, send them the lines of text, close the query window, then ignore them for an hour. Add more lines of text as needed. You can make the ignore permanent by removing the -u3600, or change the time which is in seconds.

Code:
on *:TEXT:*:?: {
  msg $nick Text line 1
  msg $nick Text line 2
  close -m $nick
  .timer 1 1 ignore -u3600 $nick
}

Joined: Nov 2016
Posts: 15
D
Dan Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Nov 2016
Posts: 15
Thanks so much for that mate, sorry for the delay lol . That script gets me half way there , here is my original script so I can explain exactly what I need...

on *:TEXT:hi:?:/msg $nick hello there | /timer 1 10 /msg $nick I will go ahead and send all of our project details | /timer 1 10 /msg $nick here comes the first one...www.google.com.. | /timer 1 10 /msg $nick next one up is www.someurl.com

As you can see,I need a wildcard trigger to start the chain of messages being sent , but then to ignore anything the user says from then on (so as not to restart the chain). Can I use the full stop for this somehow? To ignore the user DURING the delivery of the text lines (10 in total spanning roughly 2 minutes) And if so how should the text lines be formatted ?

Thanks in advance to anyone who can help smile

Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
Try this one. It'll send the contents of info.txt, one line every 5 seconds. The -m1 parameter tells the play command to only allow 1 request per user, even if they do a multi line flood of text. It's kind of redundant with the ignore command, but I like to be sure.

Code:
on *:TEXT:*:?:{
  .play -m1 $nick info.txt 5000
  close -m $nick
  .ignore -u600 $nick
}

Joined: Nov 2016
Posts: 15
D
Dan Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Nov 2016
Posts: 15
Awesome thank you ! That works great smile smile


Link Copied to Clipboard