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 

timed msg with txt.file

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


Joined: 23 Jun 2011
Posts: 106
Location: somewhere out there

PostPosted: Sat Jul 09, 2011 5:48 pm    Post subject: timed msg with txt.file Reply with quote

hi:)

i found a script :

Code:
# set this to the full location of the cmds file
set cmdsfile "/home/broken/botdir/scripts/cmds.txt"

# want the answer to come out in notice (0) or privmsg (1)?
set tellwho 1

# what channels do you want the script to work on?
# write "*" to disable.
set cmdschan "#kardelen"

#*******#
# BINDS #
#*******#

bind pub - 'cmds cmds

#************************#
# DO NOT EDIT UNDERNEATH #
#************************#

putlog "cmds.tcl $ver by tw|ster (Stian Holm) loaded ..."

proc cmds {nick uhost handle channel text} {
global cmdsfile tellwho cmdschan
   if {(([lsearch -exact [string tolower $cmdschan] [string tolower $channel]] != -1) || ($cmdschan == "*"))} {
      if {![file exists "$cmdsfile"]} {
         if {$tellwho} {
            putserv "privmsg $chan :.:error:. sorry, but i can't find the cmds file!"
         } else {
            putserv "privmsg $chan :.:error:. sorry, but i can't find the cmds file!"
         }
      return 0
      }
      if {![file readable "$cmdsfile"]} {
         if {$tellwho} {
            putserv "privmsg $chan :.:error:. sorry, but i'm not allowed to read that file!"
         } else {
            putserv "privmsg $chan :.:error:. sorry, but i'm not allowed to read that file!"
         }
      return 0
      }
      set cmds [open "$cmdsfile" r]
      while {![eof $cmds]} {
         set line [gets $cmds]
         if {$tellwho} {
            putserv "privmsg $chan :$line"
         } else {
            putserv "privmsg $chan :$line"
         }
      }
   close $cmds
   }
}

this script read txt.file and post msgs on channel with a channel trigger..

i want to add poems in a txt and when i triggered !poem on , i want to bot post poem's line one by one on a channel which i've set it. but it should post this poem's line with timing .

for example in every 90 seconds only post one line.but this line not random.if bot posts this line with random method poems will broken..

and when i triggered on channel !poem off it should be stop posting ..

i want to use that type of code for a Quran reader on channel .i already begun to creat txt files for that but today and all yesterday i made search in web for that type of code but i cant found it..

that code should post in timing periods on channel and should be read txt files line by line without random..and i have to get manage when start to read and when gonna get stop it.

i realy realy need that type of code... i try to edit and add somethings into code ...i readed all tcl coding programming infos on web pages but nope..

maybe i am too old for to understand that kinda things ..i can writes lil mirc scripting codes for my mirc but this is so different and i didnt get it realy i need yyour help..

thnx ...

_________________
Life iS Just a dReaM oN tHE wAy to DeaTh
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