| View previous topic :: View next topic |
| Author |
Message |
evotech Voice
Joined: 18 Feb 2011 Posts: 8
|
Posted: Wed Mar 23, 2011 10:12 am Post subject: on join bind help |
|
|
Hi, trying to get this script to work and send a notice on join. as far as i can tell it's according to the documentation.
| Code: |
bind pub - .streams cmd:stream
bind pub - !test cmd:test
bind pub - !whoburnedthehousedown
bind join - * cmd:stream
proc cmd:stream { nick uhost handle chan text } {
catch { exec cat /home/evotech/eggdrop/scripts/urls | perl /home/evotech/eggdrop/scripts/streams.pl } streams
putnotc $nick "$streams"
}
|
It works if called, but not on join, whats wrong with the 'bind join - * cmd:stream' line?
Probably something minor
thanks |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Wed Mar 23, 2011 10:39 am Post subject: |
|
|
Try | Code: | | bind join - "#* *!*@*" cmd:stream | What your missing is the channel and user mask part of the bind. _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Mar 23, 2011 1:59 pm Post subject: |
|
|
The bind is just fine, "*" is a wide enough mask to match pretty much anyone joining the channel. However, the argument list of cmd:stream does not match the required parameters of the join binding; it only passes on 4 (nickname, user@host, handle, and channel) while your cmd:stream proc has 5, as you already use it with pub bindings.
There are two fixes for this;
1. use a different proc for your join binding
| Code: | bind join - * join:stream
proc join:stream {nick host handle channel} {
catch {exec cat /home/evotech/eggdrop/scripts/urls | perl /home/evotech/eggdrop/scripts/streams.pl} streams
putnotc $nick $streams
} |
2. Make the last argument (text) optional by assigning it a default value:
| Code: | bind join - * cmd:stream
proc cmd:stream {nick uhost handle chan {text ""}} {
catch {exec cat /home/evotech/eggdrop/scripts/urls | perl /home/evotech/eggdrop/scripts/streams.pl} streams
putnotc $nick "$streams"
} |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Mar 23, 2011 2:01 pm Post subject: |
|
|
| Quote: |
bind join <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel>
|
the join procedure expects 4 arguments while you have 5. You can trick it by replacing:
| Code: |
proc cmd:stream { nick uhost handle chan text } {
|
with:
| Code: |
proc cmd:stream {nick uhost handle chan {text ""}} {
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
evotech Voice
Joined: 18 Feb 2011 Posts: 8
|
Posted: Wed Mar 23, 2011 9:17 pm Post subject: |
|
|
cool!
idk if i even need the text paramenter, ill try just taking it out first
edit: without it the public call doesnt work so i used the second option and it works great
But yeah, many thanks! |
|
| Back to top |
|
 |
|