Topic changer

Moderator: GeekShed.Net Staff

Topic changer

Postby Kraziee » Mon Sep 06, 2010 6:23 pm

I want to set a timer for this so it update every day at clock let say every 12h

Code: Select all

menu channel,status,nicklist {   
  .Topic
  ..Random Topic: /Topic # $read(topic.txt)
  ..Enable Random Topic:.enable #Autotopic on on | 
  ..Disable Random Topic:.disable #autotopic off |
  ..View Topics In File:run $findfile($mircdir,Topic.txt,1)
  ..Add A topic: set %newtopic $$?="What is your topic?" | write Topic.txt %newTopic | 
}

#autoTopic off
on *:text:!Topic:#: {
  if ($nick isop $chan) {
    .topic $chan $read(Topic.txt)
    .notice $nick Done.
  }
}
on 1:text:!Addtopic *:#: {
  if ($2) {
    msg $chan Added Topic: $2-
    write topic.txt $2-
  }
  else {
  .notice $nick Please write the topic after !Addtopic | halt }
}
#autotopic End

#autoTopic off
#autoTopic End
Kraziee
 
Posts: 3
Joined: Mon Sep 06, 2010 6:21 pm

Re: Topic changer

Postby GrimReaper » Mon Sep 06, 2010 6:49 pm

You could add to it

Code: Select all
on *:START: { timer $+ topic 0 43200 topic #channelname $read(topic.txt) }


That will update the topic of a certain channel every 12 hours.
GrimReaper
 
Posts: 73
Joined: Wed Oct 28, 2009 4:34 pm
Location: In your router, Resetting your connection.

Re: Topic changer

Postby Kraziee » Mon Sep 06, 2010 6:51 pm

awsome! :D
Kraziee
 
Posts: 3
Joined: Mon Sep 06, 2010 6:21 pm

Re: Topic changer

Postby Kraziee » Tue Sep 07, 2010 7:09 pm

seem to not work :s dont know why...

where sould i put this?
Code: Select all
on *:START: { timer $+ topic 0 43200 topic #channelname $read(topic.txt) }


i pasted it under
Code: Select all
#autoTopic off
on *:text:!Topic:#: {
Kraziee
 
Posts: 3
Joined: Mon Sep 06, 2010 6:21 pm

Re: Topic changer

Postby GrimReaper » Tue Sep 07, 2010 7:19 pm

Where you have
Code: Select all
on *:text:!Topic:#: {
  if ($nick isop $chan) {
    .topic $chan $read(Topic.txt)
    .notice $nick Done.
  }
}


You could add it into there like,
Code: Select all
on *:text:!Topic:#: {
  if ($nick isop $chan) {
    .topic $chan $read(Topic.txt)
    .notice $nick Done.
    .timer $+ topic 0 43200 topic #channelname $read(topic.txt)
  }
}
GrimReaper
 
Posts: 73
Joined: Wed Oct 28, 2009 4:34 pm
Location: In your router, Resetting your connection.


Return to Script help

Who is online

Users browsing this forum: No registered users and 9 guests

cron