mIRC Home    About    Download    Register    News    Help

Print Thread
#156971 21/08/06 04:13 AM
Joined: Dec 2005
Posts: 22
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2005
Posts: 22
Im a father of 2 children so dont have much time to learn advanced stuff so any help is appreciated.

Im trying to make something for a help channel is own.

Basically its like a channel reminder.

I want to be able to add news that gets stored in order and it advertises in the channel say every 20 minutes. Like if there is 5 bits of news 1,2,3,4,5 it will /msg the $chan number 1 after 20 minutes then the next 20 minutes it will message number 2 then number 3. Goes in order then starts over again.

For e.g

1. Please make sure you have understood the rules and regulations, if you wish to clarify the rules please visit ww.www.com

20 minutes later

2. If you need help, please ask in the channel and refrain from messaging operators.

3. ... etc etc

so i basically need it to store the events in like a file that stores in order. I only need commands such as !add ... text here ( it will add in order ) !remove #1 or #2 etc so it removes by the number stored and !latest to see the last piece of news added. Also only operators can use the !add and !remove command. Any help would be greatly appreciated.

Last edited by spirit_cro; 21/08/06 04:15 AM.
#156972 21/08/06 05:21 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on op:text:!add*::{
  $iif(!$2,.msg $nick Nothing to add,.write help.txt $2-)
}
on op:text:!remove*:*:{
  $iif($2 !isnum,.msg $nick Usage !remove <number>,.write -d $+ $2 help.txt)
}
on me:*:join:#:{
  var %a = 1, %b = $nick(#,0,o)
  while %a <= %b {
    .auser -a op $nick(#,%a,o)
    inc %a
  }
  .play $chan help.txt 1200
}
on *:op:#:{
  .auser -a op $opnick
}
on *:serverop:#:{
  .auser -a op $opnick
}
on op:part:#:{
  .ruser op $nick
}
on *:kick:#:{
  .ruser op $knick
}
on op:quit:{
  .ruser op $nick
}
on op:nick:{
  .ruser op $nick
  .auser -a op $newnick
}
 

#156973 21/08/06 07:44 AM
Joined: Dec 2005
Posts: 22
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2005
Posts: 22
Thanks alot i appreciate it, any idea how i can get it to store the information in help.txt in a sequence. i.e.

(1) text here
(2) text here
(3) text here

And .msg $chan Each sequence 20 minutes apart.

Because the way it is now it messages 1,2,3,4,5 all at once.

#156974 21/08/06 07:58 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Sorry, use the script I provided, but change
Code:
 .play $chan help.txt 1200 
to
Code:
 .play $chan help.txt 1200000 

#156975 22/08/06 12:53 AM
Joined: Dec 2005
Posts: 22
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2005
Posts: 22
The commands work fine, its just it will .play the whole help.txt document every 20 minutes where as im trying to get it to play sections of the help.txt document every 20 minutes in order from 1-5 not the whole thing at once. when you use
!add text here ... it will add it but im trying to make it add in some sort of sequence
i.e if i was to type !add For all your scripting needs try www.mirc.com

it would add to the help.txt like this

(1) For all your scripting needs try www.mirc.com

Then if i was to add another one !add The best search engine is www.google.com
it would display like this

(2) The best search engine is www.google.com

Im trying to get it to play each number per 20 minutes. So if the time is 1pm at 1.20pm it will play (1) then at 1.40 it will play (2) etc

Any help is appreciated.

#156976 22/08/06 03:11 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Code:
alias readhelp {
  /inc %help.line
  if (%help.line > $lines(help.txt)) /set %help.line 1
  /msg $iif($1, $1, [color:Blue]#channel[/color]) $read(help.txt,%help.line)
  .timer 1 300 /readhelp $1
}


Use /readhelp <channel>, where <channel> is the channel you'd like it to advertise to. The channel in blue is a default channel when none has been specified.


-KingTomato

Link Copied to Clipboard