This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

noob to tcl's..please help

Old posts that have not been replied to for several years.
Locked
p
psyjoniz

noob to tcl's..please help

Post by psyjoniz »

basically i lack the understanding of syntax i guess... here is a simple bind and proc i want to use when in a channel with my bot so that it will say hello back to me:

Code: Select all

bind pubm - hello pubm:hello
set handle "psyjoniz"
proc pubm:hello {handle} {
        global botnick
        putserv "hello, $handle, i am $botnick"
}
what this means to me, from what i can understand so far, is that when i type 'hello' when in the channel with the bot, it will respond 'hello, psyjoniz, i am <bots name>'. this, of course, is not happening.

what am i doing wrong?

and yes - i am including the tcl script correctly as i pointed it in the wrong direction and got an error the pointed it correctly and no error (bot loaded correctly; joined preset channel; updated flags when ops was given).

very confused - any help would be much appreciated. thanks.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

The proc of your bind and the puserv thing is not complete. Consult the doc/tcl-commands.doc file.
Once the game is over, the king and the pawn go back in the same box.
p
psyjoniz

Post by psyjoniz »

i've read it - none of the examples seem to work - and from what i can gather the var's expressly included are magically set....... i'm assuming that the documentation assumes that you know to set the vars previous in the code but it doesn't specify anything of that nature.

could you please tell me _why_ they are incomplete?

why can't i just get someone to point me to a simple 'hello world' script? all i want is to, in public chat with a bot, say 'hello' and have the bot respond with 'hello, <my-nick>, i am <bots-nick>'. documentation is great - except when you follow it and it doesn't work the way it says its supposed to.

and is it puserv or putserv - now you've got me more confused.

is it _really_ so hard to just point out my mistake instead of telling me to go check the documentation? i'm all for learning on your own but i've been at this for a day and i can't get any response out of the bot whatsoever aside from default functionality and i _have_ read - and everything i've read tells me the snippit i'm attempting to use should work the way i'm desiring it to.
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

psyjoniz wrote:and is it puserv or putserv - now you've got me more confused.
it's putserv
the right way is putserv "PRIVMSG <target> :<message>"
where target can be a nick on the network or a channel.

also your proc is wrong. a pubm bind requires more than one argument

check the TCL-Commands.doc - Bind part, there you'll find the right one
p
psyjoniz

Post by psyjoniz »

ok, i'm guessing here...

Code: Select all

proc pubm:hello {nick host handle chan text} {
}
when binding for pubm - the 5 vars - are they populating in the proc by themselves? and just taking on the varname you specify per proc?

and if so - is this different per bind type?
p
psyjoniz

Post by psyjoniz »

like so?...

Code: Select all

bind pubm - hello pubm:hello
proc pubm:hello {nick host handle chan text} {
        putserv "PRIVMSG $handle :hello"
}
p
psyjoniz

Post by psyjoniz »

change pubm to pub

for some reason the copy of eggdrop i have is like not complete or something - when i'm in dcc chat i do not have all the commands that are supposed to be available like .whois - pubm does not seem to be working - but pub does - does _anyone_ have any idea why this might be happening? i don't recall changing anything in the configuration(s) that strikes me as being associated with this sort of response.
p
psyjoniz

Post by psyjoniz »

Code: Select all

bind pub - hello pub:hello
proc pub:hello {nick host handle chan text} { 
	if {$nick == "psyjoniz"} {
       		putserv "PRIVMSG $chan :hey, $nick, hows it going?" 
	} else {
		putserv "PRIVMSG $nick :i'm sorry, do i know you?"
	}
}

bind pub - "giveinfo" pub:giveinfo
proc pub:giveinfo {nick host handle chan text} { 
	if {$nick == "psyjoniz"} {
       		putserv "PRIVMSG $chan :nick-$nick host-$host handle-$handle chan-$chan text-$text"
	}
}

bind pubm - "giveinfopubm" pubm:giveinfo
proc pubm:giveinfo {nick host handle chan text} { 
	if {$nick == "psyjoniz"} {
       		putserv "PRIVMSG $chan :nick-$nick host-$host handle-$handle chan-$chan text-$text"
	}
}
ok - the first and second binds and procs work fine - but the third one doesn't. am i doing something wron in it? if not - then my pubm bind specification isn't working correctly. would someone try the above code to see if i'm crazy or not? thanks.
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Nice monolog :)

Post by user »

Check doc/tcl-commands.doc (clue: the mask in a pubm bind is matched against more than just the message)
Have you ever read "The Manual"?
p
psyjoniz

Post by psyjoniz »

well now don't i look like a big horses arse? haha - thanks for the clue :D
Locked