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.

timed msg with txt.file

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
heartbroken
Op
Posts: 110
Joined: Thu Jun 23, 2011 11:15 pm
Location: somewhere out there

timed msg with txt.file

Post by heartbroken »

hi:)

i found a script :

Code: Select all

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