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.

Problem binding to variable trigger with pubm

Old posts that have not been replied to for several years.
C
Cavemanm85de
Voice
Posts: 10
Joined: Mon Jul 05, 2004 8:39 am

Post by Cavemanm85de »

Up front... in Germany we have a saying, that those who critizise the spelling of other have nothing else to contribute .)

What you said could be true, I have no way of testing against it, as the bind is a pubm and therefor would only work in a channel.

But anyhow I do not believe you as your reasoning would mean that my script would not work in any way. But it is working, due to the 'global $botnick' inside the procedure.

Now you tell me, that the binds get read before the botnick is set.
Then how does this explain that my bind, using a not-set-variable, is working without rehashing?

*very confused*
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Cavemanm85de wrote: What you said could be true, I have no way of testing against it, as the bind is a pubm and therefor would only work in a channel.
Sure you can test it.. Your current script won't work... Kill your bot.. and start it up from the shell prompt again, and then test it in the channel...
But anyhow I do not believe you as your reasoning would mean that my script would not work in any way. But it is working, due to the 'global $botnick' inside the procedure.
It's working because when you rehash, your bot is already on irc, and botnick is already set. You can remove the global line and it will still work when you do this.

Also, for the record, please read doc/tcl-commands.doc, and your eggdrop config file, for the definitions of "nick" and "botnick". (The doc comes with your eggdrop)
Now you tell me, that the binds get read before the botnick is set.
Then how does this explain that my bind, using a not-set-variable, is working without rehashing?
*very confused*
Simple, It's not.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Caveman, if you read my post, you'll see that the variable does *exist*, but it is *blank*. That's not the same as saying it doesn't exist or it is not set. There's no error using $botnick before you connect to a server -- it's just meaningless.

We know what we are talking about!
C
Cavemanm85de
Voice
Posts: 10
Joined: Mon Jul 05, 2004 8:39 am

Post by Cavemanm85de »

I think I did not make very clear *sigh*

Without 'global' the bind gets executed if someone says 'shut up' with the 'global' it only gets executed with 'botnick shut up'.
Now if $botnick was *blank* this would not happen.

That is my problem. I see your reasoning but I also see the way eggdrop reacts.

You keep saying botnick is not set when the binds get read therefor it must be "blank".
Strange is, that it works right after starting up the bot and only if I have the 'global' set.

As for telling me 'it's not working' ... *shrugs*

QED. It *IS* working (right after starting the bot without rehashing) even though no one seems to know why.

/case closed; points go to gb for the tip .)
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Before connecting to a server you can use '$nick'

Code: Select all

global $nick
And then use it in your tcl scripts.
This variable is already declared in your
eggdrop.conf file and is the bots nick.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

Global $nick? ;)
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Cavemanm85de wrote:I think I did not make very clear *sigh*

Without 'global' the bind gets executed if someone says 'shut up' with the 'global' it only gets executed with 'botnick shut up'.
Now if $botnick was *blank* this would not happen.

That is my problem. I see your reasoning but I also see the way eggdrop reacts.

You keep saying botnick is not set when the binds get read therefor it must be "blank".
Strange is, that it works right after starting up the bot and only if I have the 'global' set.

As for telling me 'it's not working' ... *shrugs*

QED. It *IS* working (right after starting the bot without rehashing) even though no one seems to know why.

/case closed; points go to gb for the tip .)
For future readers, please do not assume this solution to be correct, because it is NOT. The person in question has either been rehashing their bot, or have changed their code from their original post and have not displayed those changes, which would be the real reason for why it would work.

The fact of the matter is, is that bind is a command like any other Tcl command, and when written outside a procedure (ie. in the global namespace/scope), it has access to global variables (all variables in the same scope as bind [any command] is being invoked from)... The command/procedure that is to be called from the event set up by the bind call has no effect on the previous bind declaration, and as such, declaring "global variable" from within that scope, will not make a difference on the binding itself. Future readers with similar problems, see stdragon's or my own posts in this thread for the working solutions.
C
Cavemanm85de
Voice
Posts: 10
Joined: Mon Jul 05, 2004 8:39 am

Post by Cavemanm85de »

The person in question has either been rehashing their bot, or have changed their code from their original post and have not displayed those changes
Thank you very much.
Without knowing anything about me you just assume that.
If I knew you I'd either be very pissed or amused about this accusation.

I did not change the code, except inserting 'global $botnick', and I do not rehash the eggdrop to get it to work

Please. Just because something does work and you have no explanation for it, lay off accusing others.
If you can not accept it any other way you have my condolence...

BTW, since you were already so nice and correct my spelling you should make sure that your own is correct.
You may be an admin/owner/whatever on this board and you may have a lot of work with it, granted, but you seem to be very arrogant if one does not believe you or if you do not believe some one. I have seen many people getting to this point :( it's part of the 'burn-out-syndrom'.[/b]
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Cavemanm85de wrote: BTW, since you were already so nice and correct my spelling you should make sure that your own is correct.
This again.. I did not correct your spelling, I corrected the word you were using.... you spelled "mood" correct, but that was not the word for which you were looking to use, and as such, made the sentences you were writing incomprehensible. As for my own spelling, I did not from what I can tell make any spelling mistakes, but thanks for coming out.
Cavemanm85de wrote: You may be an admin/owner/whatever on this board and you may have a lot of work with it, granted, but you seem to be very arrogant if one does not believe you or if you do not believe some one. I have seen many people getting to this point :( it's part of the 'burn-out-syndrom'.[/b]
It's not arrogance, it is the fact that I don't want users with similar problems in the future reading this and thinking they'll fix it by using your incorrect solution, because it won't work.
C
Cavemanm85de
Voice
Posts: 10
Joined: Mon Jul 05, 2004 8:39 am

Post by Cavemanm85de »

There we go again... (Hint: check the bold words in my post)

On my system it works like I described above, but you keep telling that it doesn't. If that is not arrogance, I do not know what else it is.

Anyhow this is my last post in this thread as we are on different ends.
You keep telling 'this does not work' and I SEE it running. If it does not work on your system, that's your Problem, not mine.
As for arrogance, you may want to put a warning sticker on this, ok. But just telling people 'this will not work' without even knowing anything about my system where it works is a step further than plain arrogance.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

"has" and "have" are spelled correctly, and if you are attempting to insinuate that their usage is incorrect, you would be wrong. "has" goes hand in hand with "person", and "have" goes hand in hand with "their".
Again, thanks for coming out.

Furthermore, it is not arrogance, it is confidence in knowing that your solution provided in this thread is incorrect, regardless of what system you are running it on.
C
Cavemanm85de
Voice
Posts: 10
Joined: Mon Jul 05, 2004 8:39 am

Post by Cavemanm85de »

lol
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

/me makes popcorn
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Caveman,

If what you had already works, then why are you even asking for help?? I don't get it.

Also, if you really did add global $botnick that is also wrong...

Now here's the thing. What you have does (or should) work, but since $botnick is blank, it should work with any text, not just the bot's nick. Have you tested that?
Locked