| View previous topic :: View next topic |
| Author |
Message |
speedy Voice
Joined: 27 Feb 2007 Posts: 3
|
Posted: Tue Feb 27, 2007 11:09 am Post subject: !stats responce in chan |
|
|
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Feb 27, 2007 11:42 am Post subject: |
|
|
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:
- 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.
- You cannont have newlines in strings you send to the irc-server.
- 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 |
|
 |
et109 Voice

Joined: 25 Feb 2007 Posts: 7 Location: Pennsylavnia
|
Posted: Tue Feb 27, 2007 2:23 pm Post subject: !stats !logs problem |
|
|
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 |
|
 |
speedy Voice
Joined: 27 Feb 2007 Posts: 3
|
Posted: Thu Mar 01, 2007 1:26 am Post subject: |
|
|
| if it pisible he says channel in place of #channels without the # ? |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Mar 01, 2007 1:40 am Post subject: |
|
|
| puthelp "NOTICE $nick :http://myurl.com:8033l/[join [split $chan #]]" |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Thu Mar 01, 2007 2:51 pm Post subject: |
|
|
| 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
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 |
|
 |
|