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 

!stats responce in chan

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


Joined: 27 Feb 2007
Posts: 3

PostPosted: Tue Feb 27, 2007 11:09 am    Post subject: !stats responce in chan Reply with quote

i need some help about the pub command !stats & log in a #chan

plz help me to solve the problem that my egg will responce on those triggers

### start script

bind pub - !logs logs_msg
proc logs_msg { nick uhost hand chan args } {
putserv "NOTICE $nick :Channel Logs can be read
http://myurl.com/~leader/logs/$chan"
return 0

}


bind pub - !stats stats_msg
proc stats_msg {nick uhost hand chan args } {
putserv "NOTICE $nick :Channel can be found on
http://myurl.com:8033l/$chan"
return 0

}

#### en script
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Feb 27, 2007 11:42 am    Post subject: Reply with quote

First off, it would be prefferable if you put your tcl-code inside a code-block.

Secondly, it would be helpful if you could provide some information on the actual malfunction of your script; ie. error-message, unexpected response, or such.

A few obvious issues however:

  1. Don't use "args" as a variable in a proc declaration unless you are fully aware of it's special characteristics. It does not behave as any other variable. Speciffically, it can accept an arbitrary number of arguments while any other variable-name may only take one.
  2. You cannont have newlines in strings you send to the irc-server.
  3. In this case, you would most likely be better off using "puthelp" rather than "putserv". Only use "putserv" for important things such as kicking/banning, opping, registering with Nickserv (if available)

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
et109
Voice


Joined: 25 Feb 2007
Posts: 7
Location: Pennsylavnia

PostPosted: Tue Feb 27, 2007 2:23 pm    Post subject: !stats !logs problem Reply with quote

this works okay here
Code:

   bind pub - !logs logs_msg
   bind pub - !stats stats_msg

   proc logs_msg { nick uhost hand chan text } {
       puthelp "NOTICE $nick :Channel Logs can be read at"
       puthelp "NOTICE $nick :http://myurl.com/~leader/logs/$chan"
     return 0
  }

   proc stats_msg {nick uhost hand chan text } {
      puthelp "NOTICE $nick :Channel stats can be found on"
      puthelp "NOTICE $nick :http://myurl.com:8033l/$chan"
      return 0
  }


The pub event handler takes <nick>< u@host> < handle> < channel> < text> as its arguments
Back to top
View user's profile Send private message
speedy
Voice


Joined: 27 Feb 2007
Posts: 3

PostPosted: Thu Mar 01, 2007 1:26 am    Post subject: Reply with quote

if it pisible he says channel in place of #channels without the # ?
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Thu Mar 01, 2007 1:40 am    Post subject: Reply with quote

puthelp "NOTICE $nick :http://myurl.com:8033l/[join [split $chan #]]"
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Thu Mar 01, 2007 2:51 pm    Post subject: Reply with quote

Code:
puthelp "NOTICE $nick :http://myurl.com:8033l/[string trimleft $chan "#"]"


I don't really see the point of turning a string into a list and then back to a string again Rolling Eyes

edit:

Code:
% set chan #moo
#moo
% string trimleft $chan #
moo
% join [split $chan #]
 moo


Another good reason why rosc's solution wouldn't work very well
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