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.
Help for those learning Tcl or writing their own scripts.
Salim
Voice
Posts: 2 Joined: Sun Apr 27, 2008 5:42 am
Post
by Salim » Sun Apr 27, 2008 5:46 am
Hey, im trying to make a script which downloads a file depending what the user writes eg. '!stats someone' would get a certain file eg
http://server.tld/stats.php?stats=someone . Heres what I got until now and I dont have a clue why it isnt working.
Code: Select all
package require http
bind pub 0 !stats getfile
proc getfile {nick host hand chan text} {
set user [lindex $text 0]
set x [::http::geturl http://server.tld/stats.php?export=$user]
foreach pasta [split [::http::data $x] \n] {puthelp "privmsg $c :$pasta"}
::http::cleanup $x
}
Sincerely,
Salim
Last edited by
Salim on Sun Apr 27, 2008 12:04 pm, edited 1 time in total.
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Sun Apr 27, 2008 11:07 am
Would "someone" happen to contain characters such as {[]}" within it?
First off, you can't use list commands on strings:
really should be
Secondly, I assume you've checked user privileges - that the user issuing the command is properly identified as a user with the +0 flag...
Third, do you get any error messages on your console or such?
NML_375
DragnLord
Owner
Posts: 711 Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA
Post
by DragnLord » Sun Apr 27, 2008 11:52 am
having a bind flag of "0" means the person already has to have that flag in the bot's userlist, binds do not automatically give flags
Salim
Voice
Posts: 2 Joined: Sun Apr 27, 2008 5:42 am
Post
by Salim » Sun Apr 27, 2008 12:03 pm
Changed the line and the flag to '-' and it works now.
Thanks :>