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.

Can't giv the bot +o

Help for those learning Tcl or writing their own scripts.
e
engineer
Voice
Posts: 2
Joined: Mon May 19, 2008 12:55 pm

Can't giv the bot +o

Post by engineer »

Hi There.

First off all im not sure if this is the correct place to write my ? but here it goes.

I Have just installed the eggdrop bot made it join my channel before i made it connect the channel i changed my own nick to the nick of the bot,regged the bot's nick and changed my own nick back.
So the bot's nick are regged as it supposed to be buuut here is the essence of my problem.I can't make chanserv change the access level for the bot (i.e give the bot an +o)
Any suggestions

Thanks in advance

PS

I have been searching through the forum but can't find "my" problem anywhere.

PPS

Im running Unreal 3.2
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

It's been a long time since I did anything on irc, but don't you need to "log in" to chanserv to make it recognise it is you? If that is the case just do something like

Code: Select all

bind evnt - init-server login_to_chanserv
proc login_to_chanserv {args} {
	putserv "PRIVMSG chanserv :logincommand with pass and username goes here"
}
put it at the end of your config-file or make a tcl-file and load it from the config-file
Elen sila lúmenn' omentielvo
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Papillon wrote:It's been a long time since I did anything on irc, but don't you need to "log in" to chanserv to make it recognise it is you? If that is the case just do something like

Code: Select all

bind evnt - init-server login_to_chanserv
proc login_to_chanserv {args} {
	putserv "PRIVMSG chanserv :logincommand with pass and username goes here"
}
put it at the end of your config-file or make a tcl-file and load it from the config-file
First off, sure the parameters are trashed, but why use ARGS? To confuse people? Your using it for no reason and it's a special variable..ugh

Also, Chanserv has nothing to do with nick registration/identifying. Chanserv will only let you change channel permissions and channel access levels. To have your bot identify to the nickname you registered you need to communicate with nickserv and use something like this.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

speechles wrote: First off, sure the parameters are trashed, but why use ARGS? To confuse people? Your using it for no reason and it's a special variable..ugh
In his defense, he doesn't actually use it, it is probably for his convenience since he may or may not remember the actual arguments an init-server bound procedure is called with. As to your second point, yes it is a special variable, and yes, it does exist. If it were to never be used, it wouldn't exist at all, so don't take such offence to it and it being used. oy vay.
e
engineer
Voice
Posts: 2
Joined: Mon May 19, 2008 12:55 pm

Post by engineer »

something like this

Cheers m8 the thanks for this link allthough the bot already were identifyed the last post in the link.

Code:
variable nickservpassword "your_password_here"

bind evnt - init-server evnt:init_server

proc evnt:init_server {type} {
putquick "MODE $::botnick +iR-ws"
putquick "nickserv identify $::nickservpassword"
}

Solved my problem :D
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

don't be afraid speechless, the args will not bite you. no need to be terrified of it.
In place of shouting at people using it (which I did not do) you could try to explain what is so special about it (can't say I have seen you do it yet)

My bad about chanserv.. my irc-experience is years old and much mixed up. I do not even have access to an eggdrop
Elen sila lúmenn' omentielvo
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Papillon wrote:don't be afraid speechless, the args will not bite you. no need to be terrified of it.
In place of shouting at people using it (which I did not do) you could try to explain what is so special about it (can't say I have seen you do it yet)

My bad about chanserv.. my irc-experience is years old and much mixed up. I do not even have access to an eggdrop
wow, you really do forget things quickly. Look here:
http://forum.egghelp.org/viewtopic.php?t=15726

We've already met you see, and this isn't the first time I've taken issue regarding $args. I'm also well aware you didn't write the script in that thread, merely took what was there and applied his wish to it. But what you can do is correct the severe problems the script has and its half assed approaches to resolve those incorrect uses.

And so you know I know what Im talking about.
Say we have a bind of whatever to proc ARGUE { args }

parameters passed to $args : $nick $hand $text

Code: Select all

proc argue { args } {
  set first [lindex [split [lindex $args 0]] 0]
  set second [lindex [split [lindex $args 0]] 1]
  set third [lrange [split [lindex $args 0]] 2 end]
resut: first = $nick, second = $hand, third = $text
Correct use of $args, this guy r0x!

Code: Select all

proc argue { args } {
  set first [lindex $args 0]
  set second [lindex $args 1]
  set third [lrange $args 2 end]
result: first = {$nick $hand $text} (yes, including curly braces), second = tcl error beyond list length or {} emptiness who knows, third = never executes or behaves as 2 did.
Boo! This guy sux!

Is this enough? :roll:

but wait, let's show more about the confusion.

Code: Select all

proc argue { args } {
  set args [split $args]
  set first [lindex $args 0]
  set second [lindex $args 1]
  set third [lrange $args 2 end]
result: first = {$nick, second = $hand, third = $text} (yes including curly braces).
Gah, this cluttered up things even worse than it was before. Sux! You will now need to do string range tricks to rid the curly braces (see here).

The simple rule: If there is no need to use $args, then simply don't use it, otherwise your causing confusion...

Also, this isn't me yelling at you. This is simply one your peers hoping in the future others might not be as confused. Stern advice is the best advice IMHO.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

speechles wrote: And so you know I know what Im talking about.
Say we have a bind of whatever to proc ARGUE { args }

parameters passed to $args : $nick $hand $text

Code: Select all

proc argue { args } {
  set first [lindex [split [lindex $args 0]] 0]
  set second [lindex [split [lindex $args 0]] 1]
  set third [lrange [split [lindex $args 0]] 2 end]
resut: first = $nick, second = $hand, third = $text
Correct use of $args, this guy r0x!

Code: Select all

proc argue { args } {
  set first [lindex $args 0]
  set second [lindex $args 1]
  set third [lrange $args 2 end]
result: first = {$nick $hand $text} (yes, including curly braces), second = tcl error beyond list length or {} emptiness who knows, third = never executes or behaves as 2 did.
Boo! This guy sux!

Is this enough? :roll:
I think you don't understand args like you think you do. This 2nd "argue" proc is actually the more correct method. $args is already in list format.

eg.

Code: Select all

proc mypub {args} {
  set nick [lindex $args 0]
  set uhost [lindex $args 1]
  set hand [lindex $args 2]
  set chan [lindex $args 3]
  set text [lindex $args 4]
  putlog "$nick - $uhost - $hand - $chan - $text"
}
bind pub - !hi mypub

<[sL]> !hi moo moo da moo
<bot> [sL] - sl@strikelight.com - sL - #chan - moo moo da moo
speechles wrote: The simple rule: If there is no need to use $args, then simply don't use it, otherwise your causing confusion...
His reason to use it was to supress defining variables in the declaration of the procedure that he will never use to begin with. Thus the need. I think you might be more upset at the fact that you yourself don't understand the practicality and usage of args.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

strikelight wrote:his reason to use it was to supress defining variables in the declaration of the procedure that he will never use to begin with. Thus the need. I think you might be more upset at the fact that you yourself don't understand the practicality and usage of args.
Upset? Come again? The one getting upset is you. Words here are on a screen, given no audible sounds. I can't scream at you, that voice is in your head. Perhaps you both just need some psychiatry and the world will not be so loud.

and about the correction. Et tu brute (trying to be witty like u were at the end of your.. speech? was it a speech? because i think im.. well, i know i'm.. speechless)

/me walks off nto a dense forest of marijuana plants
/me whistles theme to andy griffith
*fade to green*
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

speechles wrote: Upset? Come again? The one getting upset is you. Words here are on a screen, given no audible sounds. I can't scream at you, that voice is in your head. Perhaps you both just need some psychiatry and the world will not be so loud.
If I am unable to detect your emotion, then how are you able to detect mine? You can't talk out both sides of your mouth and not be called on it ;x In any event, I just wanted to point out that "args" exists to be used, so no need to denounce those who use it, as long as they use it properly.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

strikelight wrote: If I am unable to detect your emotion, then how are you able to detect mine?
Age begets wisdom and insight...
strikelight wrote:You can't talk out both sides of your mouth and not be called on it ;x
What you mean is, both sides of your body. Mouth talks, other side talks, well.. talks.. you know.. 5H17 (forgive my swearing)
strikelight wrote:In any event, I just wanted to point out that "args" exists to be used, so no need to denounce those who use it, as long as they use it properly.
/me points over there somewhere.
I'm also pointing something out.

I didn't denounce. Now I may have used derision, but it was a far cry from denouncing. I can also clearly see we share the same philosophy in the statement "as long as they use it properly". So we shouldn't bicker like children at each other, rather we should focus that energy towards ending the confusion regarding the notorious variable $args .. Which was my intent, and yours in the end.. anyways, back to the forest ;)
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

speechles wrote:
strikelight wrote: If I am unable to detect your emotion, then how are you able to detect mine?
Age begets wisdom and insight...
I don't want to compare age, as my age has made me wise enough to never date myself, although in saying that, I probably have let on too much as is ;x
speechles wrote:
strikelight wrote:You can't talk out both sides of your mouth and not be called on it ;x
What you mean is, both sides of your body. Mouth talks, other side talks, well.. talks.. you know.. 5H17 (forgive my swearing)
I meant mouth, two separate idioms. :)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

And so you know I know what Im talking about.
Say we have a bind of whatever to proc ARGUE { args }

parameters passed to $args : $nick $hand $text
Code:
proc argue { args } {
set first [lindex [split [lindex $args 0]] 0]
set second [lindex [split [lindex $args 0]] 1]
set third [lrange [split [lindex $args 0]] 2 end]

resut: first = $nick, second = $hand, third = $text
Correct use of $args, this guy r0x!

Code:
proc argue { args } {
set first [lindex $args 0]
set second [lindex $args 1]
set third [lrange $args 2 end]

result: first = {$nick $hand $text} (yes, including curly braces), second = tcl error beyond list length or {} emptiness who knows, third = never executes or behaves as 2 did.
Boo! This guy sux!

Is this enough? Rolling Eyes
..pff.. you clearly do NOT know what you are talking about.
It is the 2. example that is correct, the one you so clearly define as wrong. Do some testing in tclsh next time before you pass judgment on others.
example from tclsh:

Code: Select all

% set nick Papillon; set hand Whatever; set text "Let's write it with some \[special chars in for fun\]"
% proc testing {args} { puts "nick: [lindex $args 0] -- hand:[lindex $args 1] -- text: [lindex $args 2]" }
% testing $nick $hand $text
nick: Papillon -- hand: Whatever -- text: Let's write it with some [special chars in for fun]

or even..

% testing $hand $text $nick
nick: Whatever -- hand: Let's write it with some [special chars in for fun] -- text: Papillon
or we can do it with lists within lists

Code: Select all

% set text [list first last]; set nick Papillon
% proc x {args} { puts "[lindex [lindex $args 0] 1] and [lindex [lindex $args 0] 0], right [lindex $args 1]?" }
% x $text $nick
last and first right Papillon?
As strikelight said. $args is in list format and should be handled as being just that, using split on it is where most people go wrong
Elen sila lúmenn' omentielvo
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

I am probably going to regret making this post, but here it goes anyway...

You are all right, and you are all wrong...
When writing examples, it is imperative that you are very clear on all details of the example, even though you yourself think of them as obvious.

Speechles' example could be interpreted in two very different ways, resulting in two very different results:

1st: Here everything would function as per speechles example.

Code: Select all

set r [argue "$nick $hand $text"]

2nd: Here things work as strikelight explained.

Code: Select all

set r [argue $nick $hand $text]


Personally, I don't mind discussions on how things work and do not work. But keep it professional, pecking at each other won't make anyone happier or wiser. And after all, aren't we here to share our wisdom?
NML_375
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Papillon wrote:..pff.. you clearly do NOT know what you are talking about.
It is the 2. example that is correct, the one you so clearly define as wrong. Do some testing in tclsh next time before you pass judgment on others.
tclsh...get real guy.. Realize not everybody wants to install a full unix environment just to run a simple eggdrop on windows, and take that chip off your shoulder jeez..

Where exactly did I pass judgment on others? Your holiness is upset? Put down the pipe before the pipe puts you away. This is not a pedestal.

@nml375, professionalism isn't partial to some people, they prefer to throw mud at everyone. Maybe it's something in the water in norway, angry vikings.
Post Reply