| View previous topic :: View next topic |
| Author |
Message |
Smartiees Voice
Joined: 15 Dec 2007 Posts: 10
|
Posted: Sun May 20, 2012 8:12 am Post subject: advertise tcl? |
|
|
is there any advertise tcl like this if we add a advertise with long one txt length then bot convert that long message length into two msgs for example like this?
| Code: | <Bot>first really long line
<bot>second really long line |
like this? at the same time bot complete msg into two line???
is there anyone have that type of code or script or anyone can make? |
|
| Back to top |
|
 |
Sane Voice
Joined: 17 Nov 2013 Posts: 19 Location: #kl-channel@Rizon.net
|
Posted: Fri Nov 22, 2013 10:37 am Post subject: Re: advertise tcl? |
|
|
The following script below is just like any other TCL script with the exception that you would add the advertisements you want the bot to say in an 'advertisements'.txt file (you need to create it) which you would put in the same location as the 'advertisement'.tcl file; which is the 'scripts' folder. To change the waiting time between each advertisement line you need to edit the 'utimer' (in seconds). So lets say you want your bot to go through and post the advertisements to the target channel every hour you'd need change the 'utimer' to: 'utimer 3600'. And you would type '!adverts on/off' in the target channel to turn the script on or off. Replacing '#CHANNEL' with yours.
advertisements.tcl
| Code: | bind pub - !adverts inputadverts
proc inputadverts { nick host hand chan text } {
global advertsonoff id
if { $text == "on" } {
set advertsonoff 1
adverts
}
if { $text == "off" } {
clearqueue all
set advertsonoff 0
}
}
proc adverts { } {
global advertsonoff
set advertstxt "scripts/advertisements.txt"
set advertstxt [open $advertstxt r]
set advertsread [split [read $advertstxt] \n]
close $advertstxt
putquick "PRIVMSG #CHANNEL :[lindex $advertsread [rand [llength $advertsread]]]"
if {$advertsonoff == 1} {
utimer 3600 adverts
}
} |
|
|
| Back to top |
|
 |
|