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 

echo to chan

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


Joined: 05 Jan 2006
Posts: 6

PostPosted: Fri Jan 06, 2006 9:31 pm    Post subject: echo to chan Reply with quote

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


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

PostPosted: Fri Jan 06, 2006 9:59 pm    Post subject: Reply with quote

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


Joined: 05 Jan 2006
Posts: 6

PostPosted: Fri Jan 06, 2006 10:30 pm    Post subject: Reply with quote

I tryed puthelp before, but its still does nothing.

At the same time it puts putlog, wich works...
Back to top
View user's profile Send private message
zee
Voice


Joined: 05 Jan 2006
Posts: 6

PostPosted: Sat Jan 07, 2006 9:52 am    Post subject: Reply with quote

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


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Jan 07, 2006 10:03 am    Post subject: Reply with quote

Did you realise that you didn't global thechan yet?
Back to top
View user's profile Send private message
zee
Voice


Joined: 05 Jan 2006
Posts: 6

PostPosted: Sat Jan 07, 2006 10:19 am    Post subject: Reply with quote

thnx
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