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.

Script doesn't work... why?

Support & discussion of released scripts, and announcements of new releases.
Post Reply
D
Draknon
Voice
Posts: 30
Joined: Sun Apr 01, 2018 8:24 am

Script doesn't work... why?

Post by Draknon »

can someone tell me why the !menu part doesn't work.. the rest of the script works just fine.
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
}
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Script doesn't work... why?

Post by willyw »

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 !
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Script doesn't work... why?

Post by willyw »

Draknon wrote: ...
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 !
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Script doesn't work... why?

Post by willyw »

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: Select all

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. :)
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
D
Draknon
Voice
Posts: 30
Joined: Sun Apr 01, 2018 8:24 am

Re: Script doesn't work... why?

Post by Draknon »

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
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Script doesn't work... why?

Post by willyw »

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 !
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Script doesn't work... why?

Post by willyw »

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 !
D
Draknon
Voice
Posts: 30
Joined: Sun Apr 01, 2018 8:24 am

Post by Draknon »

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: Select all

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.
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Now you are spinning off into space or something. :)

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 !
D
Draknon
Voice
Posts: 30
Joined: Sun Apr 01, 2018 8:24 am

Re: Script doesn't work... why?

Post by Draknon »

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...
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.
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
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.
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.
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...
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Script doesn't work... why?

Post by willyw »

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: Select all

 .

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 !
D
Draknon
Voice
Posts: 30
Joined: Sun Apr 01, 2018 8:24 am

Post by Draknon »

well, I got it working, now if I just knew what I did.. but it's going now.. thanks for all your help..
Post Reply