| View previous topic :: View next topic |
| Author |
Message |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Fri Mar 23, 2007 12:09 am Post subject: ascii file player help... |
|
|
i made this my self but when i type: !ascii test it wont msg the channel any thing.. dose any one know what it could be?
| Code: |
set ascii_dir "scripts/db/ascii"
bind pub - "!ascii*" proc:ascii
proc proc:ascii {nick uhost handle chan arg} {
global botnick ascii ascii_msg asciifile
set ascii_msg [ascii]
set asciifile [lindex $arg 0]
putserv "PRIVMSG $chan :[ascii]"
}
proc ascii {} {
global ascii_dir ascii_file
set asciifile $ascii_file
set file [open "$ascii_dir/$ascii_file" r]
set data [split [read $file] \n]
close $file
}
|
|
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Mar 23, 2007 1:07 am Post subject: |
|
|
Post the results of ".set errorInfo". _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Fri Mar 23, 2007 1:39 am Post subject: |
|
|
| Alchera wrote: | | Post the results of ".set errorInfo". |
This is all i get:
| Code: |
<sdays> .set errorInfo
<Evi1Bot> [10:35] #sdays# set errorInfo
<Evi1Bot> Currently:
|
|
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Fri Mar 23, 2007 9:52 am Post subject: |
|
|
The ascii proc returns nothing, it just opens a file and catchs data, but nothing is returned.
Try this:
| Code: | set ascii_dir "scripts/db/ascii"
bind pub - "!ascii*" proc:ascii
proc proc:ascii {nick uhost handle chan arg} {
global botnick ascii ascii_msg asciifile
set ascii_msg "[ascii]"
set asciifile [lindex $arg 0]
putserv "PRIVMSG $chan :[ascii]"
}
proc ascii {} {
global ascii_dir ascii_file
set asciifile $ascii_file
set file [open "$ascii_dir/$ascii_file" r]
set data [read -nonewline $file]
close $file
return "[split $data \n]"
} |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Fri Mar 23, 2007 10:10 am Post subject: |
|
|
ok that works but i want it to play it like mirc dose /play #channel test.txt
i want to changs this:
<sdays> !ascii test.txt
<Evi1Bot> test test1 test2
to:
<Evi1Bot> test
<Evi1Bot> test1
<Evi1Bot> test2 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Mar 23, 2007 11:40 am Post subject: |
|
|
I guess you mean 'test' as a complete line?
| Code: | set ascii_dir "scripts/db/ascii"
bind pub - !ascii proc:ascii
proc proc:ascii {nick uhost handle chan arg} {
set asciifile [lindex [split $arg] 0]
foreach l [ascii $asciifile] {
puthelp "PRIVMSG $chan :$l"
}
}
proc ascii f {
global ascii_dir
if {![file exists $ascii_dir/$f]} {return ""}
set file [open "$ascii_dir/$f" r]
set data [split [read $file] \n]
close $file
set data
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
KaL-eL Voice
Joined: 15 Sep 2007 Posts: 3
|
Posted: Sat Sep 15, 2007 10:00 am Post subject: |
|
|
is it possible to make a delay between those lines? if possible, how can I do it?  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Sep 15, 2007 4:35 pm Post subject: |
|
|
| KaL-eL wrote: | is it possible to make a delay between those lines? if possible, how can I do it?  |
Create your own queue but IMO puthelp should be slow enough. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
KaL-eL Voice
Joined: 15 Sep 2007 Posts: 3
|
Posted: Sun Sep 16, 2007 6:53 pm Post subject: |
|
|
actually i want my bot to read those lines in a 6-7 sec. delay. should I use sth else instead of puthelp? what is your suggestion  |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Sun Sep 16, 2007 8:31 pm Post subject: |
|
|
You can try this script and create your own delayed queue with this.
| Quote: |
Queues
This is a utility for script developers. It allows you to create more queues so that you aren't limited by just three queues.
|
Download the script from:
http://barkerjr.net/pub/irc/eggdrop/Scripting/scripts/queues.tcl.tar.bz2 _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
KaL-eL Voice
Joined: 15 Sep 2007 Posts: 3
|
Posted: Mon Sep 17, 2007 11:20 am Post subject: |
|
|
thank you very much and pardon me if I haven't searched enough  |
|
| Back to top |
|
 |
|