| View previous topic :: View next topic |
| Author |
Message |
zee Voice
Joined: 05 Jan 2006 Posts: 6
|
Posted: Fri Jan 06, 2006 9:31 pm Post subject: echo to chan |
|
|
This is from http://www.tclscript.com/egghttp_tut.shtml egghttp tutorial.
I'm getting it working exept that i can't echo the result to #chan.
| Code: | set url "http://www.blah..."
set thechan "#mychannel"
if {![info exists egghttp(version)]} {
putlog "egghttp.tcl was NOT successfully loaded."
putlog "egghttp_example.tcl has not been loaded as a result."
} else {
proc your_callbackproc {sock} {
global url
set headers [egghttp:headers $sock]
set body [egghttp:data $sock]
regsub -all "\n" $body "" body
regsub -all -nocase {<br>} $body "<br>\n" body
regexp {a <b>(.*)</b> b} $body - served
# putserv "PRIVMSG $thechan : $served"
putlog "Website '$url' has served $served people so far."
}
bind pub - "!digg" digg
proc digg {nick uhost hand chan arg} {
global url
set sock [egghttp:geturl $url your_callbackproc]
return 1
}
putlog "egghttp_example.tcl has been successfully loaded."
}
|
The putserv "PRIVMSG $thechan : $served" doesn't work, but putlog does. what im doing wrong here ? |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Jan 06, 2006 9:59 pm Post subject: |
|
|
Change:
| Code: | | # putserv "PRIVMSG $thechan : $served" |
to:
| Code: | | puthelp "PRIVMSG $thechan :$served" |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
zee Voice
Joined: 05 Jan 2006 Posts: 6
|
Posted: Fri Jan 06, 2006 10:30 pm Post subject: |
|
|
I tryed puthelp before, but its still does nothing.
At the same time it puts putlog, wich works... |
|
| Back to top |
|
 |
zee Voice
Joined: 05 Jan 2006 Posts: 6
|
Posted: Sat Jan 07, 2006 9:52 am Post subject: |
|
|
| Code: | set url "http://www.inflow.freesitedirect.com/randquote.php"
set thechan "#inflow"
bind pub - !digg digg
proc digg {nick uhost hand chan arg} {
global url
set sock [egghttp:geturl $url your_callbackproc]
return 1
}
proc your_callbackproc {sock} {
global url
set headers [egghttp:headers $sock]
set body [egghttp:data $sock]
regsub -all "\n" $body "" body
regsub -all -nocase {<br>} $body "<br>\n" body
regexp {cc is <b>(.*)</b> end} $body - served
putlog "$served"
}
putlog "egghttp_example.tcl has been successfully loaded." |
ROFLMAO this is so screwed, even putting the variable $thechan in putlog screws up everything.
Still it can't puthelp/serv |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sat Jan 07, 2006 10:03 am Post subject: |
|
|
| Did you realise that you didn't global thechan yet? |
|
| Back to top |
|
 |
zee Voice
Joined: 05 Jan 2006 Posts: 6
|
Posted: Sat Jan 07, 2006 10:19 am Post subject: |
|
|
| thnx |
|
| Back to top |
|
 |
|