egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

advertise tcl?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Smartiees
Voice


Joined: 15 Dec 2007
Posts: 10

PostPosted: Sun May 20, 2012 8:12 am    Post subject: advertise tcl? Reply with quote

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
View user's profile Send private message
Sane
Voice


Joined: 17 Nov 2013
Posts: 19
Location: #kl-channel@Rizon.net

PostPosted: Fri Nov 22, 2013 10:37 am    Post subject: Re: advertise tcl? Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber