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 

Script doesn't work... why?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Draknon
Voice


Joined: 01 Apr 2018
Posts: 30

PostPosted: Fri Apr 06, 2018 4:08 am    Post subject: Script doesn't work... why? Reply with quote

can someone tell me why the !menu part doesn't work.. the rest of the script works just fine.

Quote:
proc pub_menu {nick uhost hand channel rest} {
global botnick
putquick "NOTICE $nick :Loading menu"
putquick "NOTICE $nick :Menu this create by Novita & Indra Pratama"
putquick "NOTICE $nick :Enjoy your chatting"
putquick "NOTICE $nick :---------M--------E-------N----------U----------"
putquick "NOTICE $nick :!pizza"
putquick "NOTICE $nick :!!redbull"
putquick "NOTICE $nick :!candyfloss"
putquick "NOTICE $nick :!cherrycoke"
putquick "NOTICE $nick :!pepsi"
putquick "NOTICE $nick :!burger"
putquick "NOTICE $nick :!softserve"
putquick "NOTICE $nick :!chocolate"
putquick "NOTICE $nick :!kebab"
putquick "NOTICE $nick :!bite"
return 0
}

bind pub - !menu pub_menu
bind pub - !list pub_menu

proc pub_menu {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :4Menu on List 01: 10,01!pizza, 4!redbull, 7!candyfloss, 9!cherrycoke, 2!pepsi, 13!burger, 6!softserve, 5!chocolate, 11!kebab 13!bite 4Note: 4Use "2!" 4for this command 9example 7!kebab 9< 13end of list created By Indra^Pratama & novita 9>"
return 0
}
Back to top
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 970

PostPosted: Fri Apr 06, 2018 10:01 am    Post subject: Re: Script doesn't work... why? Reply with quote

Draknon wrote:
can someone tell me why the !menu part doesn't work..
...


"doesn't work" does not tell us what happens.

What does happen?
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 970

PostPosted: Fri Apr 06, 2018 10:04 am    Post subject: Re: Script doesn't work... why? Reply with quote

Draknon wrote:

...
Quote:
proc pub_menu {nick uhost hand channel rest} {
global botnick
putquick "NOTICE $nick :Loading menu"
putquick "NOTICE $nick :Menu this create by Novita & Indra Pratama"
putquick "NOTICE $nick :Enjoy your chatting"
putquick "NOTICE $nick :---------M--------E-------N----------U----------"
putquick "NOTICE $nick :!pizza"
putquick "NOTICE $nick :!!redbull"
putquick "NOTICE $nick :!candyfloss"
putquick "NOTICE $nick :!cherrycoke"
putquick "NOTICE $nick :!pepsi"
putquick "NOTICE $nick :!burger"
putquick "NOTICE $nick :!softserve"
putquick "NOTICE $nick :!chocolate"
putquick "NOTICE $nick :!kebab"
putquick "NOTICE $nick :!bite"
return 0
}

bind pub - !menu pub_menu
bind pub - !list pub_menu

proc pub_menu {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :4Menu on List 01: 10,01!pizza, 4!redbull, 7!candyfloss, 9!cherrycoke, 2!pepsi, 13!burger, 6!softserve, 5!chocolate, 11!kebab 13!bite 4Note: 4Use "2!" 4for this command 9example 7!kebab 9< 13end of list created By Indra^Pratama & novita 9>"
return 0
}


You have two pub binds that create two different public commands that users can type, that call the same proc.
That's fine. No problem there. If that is what you really wanted.

But, you have two procs with the same name - pub_menu .
That's not ok.

I suspect that you want one command to point to one proc, and the other command to point to a different proc.
So, just change the name of one of the procs, both in the bind line and the proc line.
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 970

PostPosted: Fri Apr 06, 2018 10:12 am    Post subject: Re: Script doesn't work... why? Reply with quote

Tips for you:

While you can use "arg" as a variable name where you have used it above, I never do.
To the human eye, it is too close to "args" which is special. No need to try to learn how to use args here and now... just know that it is special, and don't use "args" there unless you mean to.

I'd get in the habit of something more like this:

Code:

bind pub - "!somecommand" foo

proc foo {nick uhost handle chan text} {

               ## commands
               ## go
               ## here
}


since "text" truly is what is passed right there.
Again, you CAN use arg ... (just don't use args) ... but I just don't.


Next tip:
Here on the forum, use the [ code ] [ /code ] option, when you are posting actual code. It makes it easier for us to read. Smile
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
Draknon
Voice


Joined: 01 Apr 2018
Posts: 30

PostPosted: Fri Apr 06, 2018 1:00 pm    Post subject: Re: Script doesn't work... why? Reply with quote

willyw wrote:
Draknon wrote:
can someone tell me why the !menu part doesn't work..
...


"doesn't work" does not tell us what happens.

What does happen?


doesn't work means nothing happens absolutely nothing
Back to top
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 970

PostPosted: Fri Apr 06, 2018 1:20 pm    Post subject: Re: Script doesn't work... why? Reply with quote

Draknon wrote:

...
doesn't work means nothing happens absolutely nothing



Could be a few things.

First, check to be sure script is loaded, as expected:
In partyline, do:
.binds *!menu*

and what is returned? .... is the bind loaded, as expected?

If so - good.
Now notice the HITS counter. Note the count.
Then go try : !menu from the channel.
do: .binds *!menu* again, and did the hits counter increment by one?
If so - good. That means that it is triggering, and should be running the corresponding proc.
Which is what it looks like it should do.

The problem now is that there are TWO procs with the same name.
I don't know what would happen... but I would expect something to happen.

Also, are there any error messages or anything appearing in the partyline, when you trigger it with !menu from the channel?
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 970

PostPosted: Fri Apr 06, 2018 1:21 pm    Post subject: Re: Script doesn't work... why? Reply with quote

Draknon wrote:
willyw wrote:
Draknon wrote:
can someone tell me why the !menu part doesn't work..
...


"doesn't work" does not tell us what happens.

What does happen?


doesn't work means nothing happens absolutely nothing


What IRC network is your bot on?
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
Draknon
Voice


Joined: 01 Apr 2018
Posts: 30

PostPosted: Fri Apr 06, 2018 1:43 pm    Post subject: Reply with quote

ok, let me try it this way... here is the issue.. the !menus or !lists does nothing ( Does not work ) the !pizza does exactly as it is supposed to.

Code:
bind pub - !menus pub_menu

proc pub_menu {nick uhost hand channel rest} {
  global botnick
    putquick "NOTICE $nick :Loading menu"
    putquick "NOTICE $nick :Menu this set up by Draknon"
    putquick "NOTICE $nick :Enjoy your order"
    putquick "NOTICE $nick :---------M--------E-------N----------U----------"
    putquick "NOTICE $nick :!pizza"
    putquick "NOTICE $nick :!!redbull"
    putquick "NOTICE $nick :!candyfloss"
    putquick "NOTICE $nick :!cherrycoke"
    putquick "NOTICE $nick :!pepsi"
    putquick "NOTICE $nick :!burger"
    putquick "NOTICE $nick :!softserve"
    putquick "NOTICE $nick :!chocolate"
    putquick "NOTICE $nick :!kebab"
    putquick "NOTICE $nick :!bite"
    return 0
}


bind pub - !lists pub_list

proc pub_list {nick uhost hand channel arg} {
  global botnick
    putserv "PRIVMSG $channel :4Menu on List 01: 10,01!pizza, 4!redbull, 7!candyfloss, 9!cherrycoke, 2!pepsi, 13!burger, 6!softserve, 5!chocolate, 11!kebab 13!bite 4Note: 4Use "2!" 4for this command 9example 7!kebab 9< 13end of list 9>"
    return 0
}


bind pub - !pizza pub_pizza

proc pub_pizza {nick uhost hand channel arg} {
  global botnick
    putserv "PRIVMSG $channel :10Gives 4$nick 10a 4hot 10slice of cheese pizza, compliments of Ferrari^_^"
    return 0
}


as you can see, the !pizza is the same as the !lists so why does the !lists not work?


Last edited by Draknon on Fri Apr 06, 2018 2:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 970

PostPosted: Fri Apr 06, 2018 1:55 pm    Post subject: Reply with quote

Now you are spinning off into space or something. Smile

First, you've changed the script. Whatever you are talking about now, with pizza , wasn't there in your first post.

Next, you have completely ignored some questions that I asked you. Yet you've asked me more questions.

I'm not even going to try to respond to them. That's setting up a cycle that is a waste of time.
Things go in order. We can't proceed until you respond to all questions asked of you.

If you care to focus and be methodical, then perhaps we can find your problem.
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
Draknon
Voice


Joined: 01 Apr 2018
Posts: 30

PostPosted: Fri Apr 06, 2018 5:13 pm    Post subject: Re: Script doesn't work... why? Reply with quote

willyw wrote:
Draknon wrote:

...
doesn't work means nothing happens absolutely nothing



Could be a few things.

First, check to be sure script is loaded, as expected:
In partyline, do:
.binds *!menu*

and what is returned? .... is the bind loaded, as expected?

If so - good.
Now notice the HITS counter. Note the count.
Then go try : !menu from the channel.
do: .binds *!menu* again, and did the hits counter increment by one?
If so - good. That means that it is triggering, and should be running the corresponding proc.
Which is what it looks like it should do.

The problem now is that there are TWO procs with the same name.
I don't know what would happen... but I would expect something to happen.

Also, are there any error messages or anything appearing in the partyline, when you trigger it with !menu from the channel?


Wow, completely missed this.. sorry.. gonna try to answer everything in this post...

Quote:

First, check to be sure script is loaded, as expected:
In partyline, do:
.binds *!menu*

and what is returned? .... is the bind loaded, as expected?


1: yes it is loaded and the !menu works because of my changes to the script so we are now only working with !lists.

Quote:
Now notice the HITS counter. Note the count.
Then go try : !menu from the channel.
do: .binds *!menu* again, and did the hits counter increment by one?
If so - good. That means that it is triggering, and should be running the corresponding proc.
Which is what it looks like it should do.


the party line response to
.bind !lists = pub -|- !lists 0 pub_list
.bind !lists = pub -|- !lists 1 pub_list

Quote:
Also, are there any error messages or anything appearing in the partyline, when you trigger it with !menu from the channel?


2:No there are no error messages in the partyline.

Quote:
First, you've changed the script. Whatever you are talking about now, with pizza , wasn't there in your first post.


3: the pizza line is part of the rest of the script that has worked from the beginning. I added it in this time only to show that it is identical almost to the !lists command that is not working as it should.

Quote:
What IRC network is your bot on?


4: the bot is on the bondage international server.. basically the same as Dalnet

I hope I have answered everything..

now to reiterate .. with the changes I have gotten the !menu to work.. not an issue any more.

the !lists does not work yet the one that is !pizza is exact same setup and it does work. there in lies my confusion, they are just about identical and yet 1 works and 1 does not.

as you can see in another post I did make some changes to the script based on your statement about 2 procs with the same name. ... now just the !lists does not work...
Back to top
View user's profile Send private message
willyw
Owner


Joined: 15 Jan 2009
Posts: 970

PostPosted: Fri Apr 06, 2018 6:02 pm    Post subject: Re: Script doesn't work... why? Reply with quote

I'm short on time at the moment. Sorry.

Just wanted to make this post quickly:

Two things:
1. ) After editing binds, a simple .rehash is not enough.
For now, the simple way to explain it is: After editing a bind line, be sure to do: .restart
So, .restart your bot, and test again. Just to see if that makes a difference.

2.) It is probably best for you to to post the whole, complete script, so we can see it. Be sure it is the exact script that is currently running in your bot.

If you choose to post it here, be sure to use [code] .

Else, you can post it here : http://paste.tclhelp.net/

I might be back here in a few hours. Else it will be tomorrow. Perhaps someone else will jump in here, especially after you post the complete script.

What is your nick and bot's nick, on DalNet? I'll look for you there, too.
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
Draknon
Voice


Joined: 01 Apr 2018
Posts: 30

PostPosted: Fri Apr 06, 2018 7:50 pm    Post subject: Reply with quote

well, I got it working, now if I just knew what I did.. but it's going now.. thanks for all your help..
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 -> Script Support & Releases 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