mIRC Home    About    Download    Register    News    Help

Print Thread
message + timer #156555 18/08/06 03:31 AM
Joined: Aug 2006
Posts: 24
A
AivarasB Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2006
Posts: 24
Hello, sorry for bad my english.
can u make a script like this:
I use command !add <text> (I add message into messages.txt)
then i write !enable ( and the bot ar reading random message of messages.txt in 15minutes after 15min he write other text from the messages.txt

Re: message + timer #156556 18/08/06 03:32 AM
Joined: Aug 2006
Posts: 24
A
AivarasB Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2006
Posts: 24
P.S bot writes text to the channel

Re: message + timer #156557 18/08/06 03:36 AM
Joined: Aug 2006
Posts: 24
A
AivarasB Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2006
Posts: 24
It is like information bot.

Re: message + timer #156558 18/08/06 03:37 AM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
Code:
alias -l _msg {
  if ($me ison $1) &amp;&amp; ($isfile($2-)) { msg $1 $read($2-,n) }
}
on *:part:#:{
  if ($nick == $me) { .timermsg $+ $cid $+ $chan off }
}
on *:text:!add ?*:#:{ write messages.txt $2- }
on *:text:!enable:#:{ .timermsg $+ $cid $+ $chan 0 900 _msg $chan messages.txt }

Re: message + timer #156559 18/08/06 03:42 AM
Joined: Aug 2006
Posts: 24
A
AivarasB Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2006
Posts: 24
thx it's cool but i need that he read messages from first to the last like from 1 until 50.

Re: message + timer #156560 18/08/06 03:47 AM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
Code:
alias -l _msg {
  inc %_msg_n
  if ($me ison $2) &amp;&amp; ($isfile($3-)) &amp;&amp; ($lines($3-) &lt;= %_msg_n) { msg $2 $read($3-,n,%_msg_n) }
  else { .timermsg $+ $1 $+ $2 off }
}
on *:text:!add ?*:#:{ write messages.txt $2- }
on *:text:!enable:#:{ .timermsg $+ $cid $+ $chan 0 900 _msg $cid $chan messages.txt }

Re: message + timer #156561 18/08/06 03:56 AM
Joined: Aug 2006
Posts: 24
A
AivarasB Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2006
Posts: 24
smt is wrong:
* /msg: insufficient parameters (line 3, script.ini)
-
* /msg: insufficient parameters (line 3, script.ini)
-
* Active timers:
* Timer msg1#mrc 900s delay _msg 1 #mrc messages.txt (Aitvaras)
-

Re: message + timer #156562 18/08/06 04:02 AM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
Try this:

Code:
alias -l _msg {
  inc %_msg_n
  if ($me ison $2) &amp;&amp; ($isfile($3-)) &amp;&amp; ($read($3-,%_msg_n) != $null) { msg $2 $v1 }
  else { .timermsg $+ $1 $+ $2 off }
}
on *:text:!add ?*:#:{ write messages.txt $2- }
on *:text:!enable:#:{ 
  unset %_msg_n
  .timermsg $+ $cid $+ $chan 0 900 _msg $cid $chan messages.txt 
}

Re: message + timer #156563 18/08/06 04:06 AM
Joined: Aug 2006
Posts: 24
A
AivarasB Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2006
Posts: 24
It works smile but when he writes all messages from messages.txt he stoped can u do that he dont stop and he repeat

Re: message + timer #156564 18/08/06 04:17 AM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
Code:
alias -l _msg {
  inc %_msg_n
  if ($me ison $2) &amp;&amp; ($isfile($3-)) &amp;&amp; ($read($3-,%_msg_n) != $null) { msg $2 $v1 }
  else { 
    if ($isfile($3-)) &amp;&amp; (%_msg_n &gt; $lines($3-)) {
      %_msg_n = 0
      .timer 1 0 _msg $1-
    }
    else { .timermsg $+ $1 $+ $2 off }
  }
}
on *:text:!add ?*:#:{ write messages.txt $2- }
on *:text:!enable:#:{ 
  unset %_msg_n
  .timermsg $+ $cid $+ $chan 0 900 _msg $cid $chan messages.txt 
}

Re: message + timer #156565 18/08/06 04:19 AM
Joined: Aug 2006
Posts: 24
A
AivarasB Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2006
Posts: 24
thx a lot bro respect 4 u

Re: message + timer #156566 18/08/06 04:53 AM
Joined: Aug 2006
Posts: 24
A
AivarasB Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2006
Posts: 24
hmm i need one more command when i write !list he noticed me all messages was added to messages.txt like this:
Messages added to my database:
bla bla bla
bla bla bla
bla bla bla

Re: message + timer #156567 18/08/06 06:33 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on *:text:!list:*:{
.play $nick messages.txt
}
 

Re: message + timer #156568 18/08/06 12:55 PM
Joined: Aug 2006
Posts: 24
A
AivarasB Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2006
Posts: 24
thx