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 

ascii file player help...

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
sdays
Halfop


Joined: 21 Oct 2006
Posts: 98

PostPosted: Fri Mar 23, 2007 12:09 am    Post subject: ascii file player help... Reply with quote

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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Mar 23, 2007 1:07 am    Post subject: Reply with quote

Post the results of ".set errorInfo".
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
sdays
Halfop


Joined: 21 Oct 2006
Posts: 98

PostPosted: Fri Mar 23, 2007 1:39 am    Post subject: Reply with quote

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


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Fri Mar 23, 2007 9:52 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
sdays
Halfop


Joined: 21 Oct 2006
Posts: 98

PostPosted: Fri Mar 23, 2007 10:10 am    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Mar 23, 2007 11:40 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
KaL-eL
Voice


Joined: 15 Sep 2007
Posts: 3

PostPosted: Sat Sep 15, 2007 10:00 am    Post subject: Reply with quote

is it possible to make a delay between those lines? if possible, how can I do it? Rolling Eyes
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Sep 15, 2007 4:35 pm    Post subject: Reply with quote

KaL-eL wrote:
is it possible to make a delay between those lines? if possible, how can I do it? Rolling Eyes

Create your own queue but IMO puthelp should be slow enough.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
KaL-eL
Voice


Joined: 15 Sep 2007
Posts: 3

PostPosted: Sun Sep 16, 2007 6:53 pm    Post subject: Reply with quote

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 Confused
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Sun Sep 16, 2007 8:31 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
KaL-eL
Voice


Joined: 15 Sep 2007
Posts: 3

PostPosted: Mon Sep 17, 2007 11:20 am    Post subject: Reply with quote

thank you very much and pardon me if I haven't searched enough Rolling Eyes
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 -> Scripting Help 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