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 

on join bind help

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


Joined: 18 Feb 2011
Posts: 8

PostPosted: Wed Mar 23, 2011 10:12 am    Post subject: on join bind help Reply with quote

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 Razz

thanks
Back to top
View user's profile Send private message
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Wed Mar 23, 2011 10:39 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Mar 23, 2011 1:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Mar 23, 2011 2:01 pm    Post subject: Reply with quote

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


Joined: 18 Feb 2011
Posts: 8

PostPosted: Wed Mar 23, 2011 9:17 pm    Post subject: Reply with quote

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 Smile

But yeah, many thanks!
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