This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

advertise tcl?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
S
Smartiees
Voice
Posts: 10
Joined: Sat Dec 15, 2007 2:15 pm

advertise tcl?

Post by Smartiees »

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: Select all

<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?
S
Sane
Voice
Posts: 19
Joined: Sun Nov 17, 2013 12:38 am
Location: #kl-channel@Rizon.net

Re: advertise tcl?

Post by Sane »

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: Select all

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
        }
}
Post Reply