| View previous topic :: View next topic |
| Author |
Message |
mabrook Halfop

Joined: 14 Jun 2021 Posts: 60
|
Posted: Mon Aug 16, 2021 8:41 am Post subject: set to specific channel cmds |
|
|
Hello all, a nice script indeed, but need help in the following;
a. to set the specific command in one channel only.
a1. set specific command like .chanset #channelname +menu
| Code: | # menu.tcl Its Scripts funny when bot will services you on this menu,and give you funny action,you can modif or change it what you want command it remember use "!" so this script will be run #
# Everebody can feel free to change the Script. The Author of this Version: Indra^Pratama & Novita from irc.bhasirc.com with E-Mail: ajimaltez@hackermail.com Author This Scripts : Indra^Pratama & Novita #
############################################################################################################################################################################################################
# Support By : http://www.egghelp.org #
# Support By : Htpp://www.bhasirc.com #
# Author Script : Indra^Pratama & Novita #
# Thanks To : Owner Website www.egghelp.org #
#---------------- Menu TCL -----------------#
#----- Dont Edit If You Dont Know It ----#
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
}
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
}
bind pub - !redbull pub_redbull
proc pub_redbull {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :9looks @ 10$nick 9I'm sure you need some energy be ready here it comes. by grabs *grabs a can of REDBULL and tosses it to 10$nick slides down to $nick some ice in a glass enjoy!!! :)"
return 0
}
bind pub - !candyfloss pub_candyfloss
proc pub_candyfloss {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :7hands 9$nick 7rainbow coloured candy floss in a heart shape on a stick. Please note I don't pay dentist bills $1 dolar ^_^.\001"
return 0
}
bind pub - !cherrycoke pub_cherrycoke
bind pub - !coke pub_cherrycoke
proc pub_cherrycoke {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :2looks @ 7$nick 2inspect's them from head to toe. CHERRYCOKE you say? Mmm.. Come back later :P.\001"
return 0
}
bind pub - !pepsi pub_pepsi
proc pub_pepsi {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :11hands 13$nick a 14<01_10P01_10E01_10P01_10S01_10I01_14> 11with a straw relax and enjoy :).\001"
return 0
}
bind pub - !burger pub_burger
proc pub_burger {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :4gives 11$nick 4ayummeh full house burger with frie's :)"
return 0
}
bind pub - !softserve pub_softserve
proc pub_softserve {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :9Grabs a cone and fill's it up with some SoftServe! 4Stop drooling here you go :)\001"
return 0
}
bind pub - !chocolate pub_chocolate
proc pub_chocolate {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :4Gives 10$nick 4lindt mmmm keep it safe"
return 0
}
bind pub - !kebab pub_kebab
proc pub_kebab {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :10Give Kebab very hot to 5$nick 10enjoy create 01by 9$nick 4:9P"
retrun 0
}
bind pub - !bite pub_bite
proc pub_bite {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :13Bite $nick and run :P"
retrun 0
}
###############################################################################
#---- putlog "Die Menu By Indra^Pratama & Novita Staff BhasIRC Network" ---- #
#---- putlog "Menu.tcl On Eggdrop or Windrop Only By Indra^Prtama & Novita ---#
#---- putlog "Menu.tcl Success loaded Have A nice Day ------------------------#
############################################################################### |
thank you in advance.. |
|
| Back to top |
|
 |
mabrook Halfop

Joined: 14 Jun 2021 Posts: 60
|
Posted: Tue Aug 17, 2021 5:03 am Post subject: |
|
|
no worries guys, this is Ok.. i figured it out by adding above simple codes... (doing research, and found out a helpful other script)
| Code: |
set mabrook "#mabrook"
bind pub - !Menu pub_cs
proc pub_cs {nick user hand chan arg} {
global mabrook
if {(([lsearch -exact [string tolower $mabrook] [string tolower $chan]] != -1) || ($mabrook == ""))} {
puthelp "NOTICE $nick :$nick, your message here"
}
}
|
and so on..
of course, the whole codes different now..  |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Tue Aug 17, 2021 6:33 am Post subject: |
|
|
Hum, you'd better do what you asked
First, add at the beggining of the script:
Then, in all your proc (called by a pub), add the line:
| Code: | | if {![channel get $chan menu]} { return 0 } |
This will enable the .chanset #channel +/-menu and exit from the proc if the channel is not +menu _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
mabrook Halfop

Joined: 14 Jun 2021 Posts: 60
|
Posted: Tue Aug 17, 2021 9:06 am Post subject: |
|
|
Just want to try and test this -/+ , please see below
| Code: |
set mabrook "#mabrook" [color=red] (this is already set to specific channel)[/color]
bind pub - !Menu pub_cs
setudef flag menu
if {![channel get $chan menu]} { return 0 }
proc pub_cs {nick user hand chan arg} {
global mabrook
if {(([lsearch -exact [string tolower $mabrook] [string tolower $chan]] != -1) || ($mabrook == ""))} {
puthelp "NOTICE $nick :$nick, Available Commands: .test .test2 .test3 .test4 "
}
}
bind pub - .test pub_test [color=red] (this is to call the .test command)[/color]
proc pub_test {nick user hand chan arg} {
global mabrook
if {(([lsearch -exact [string tolower $mabrook] [string tolower $chan]] != -1) || ($mabrook == ""))} {
puthelp "NOTICE $nick :$nick, this is your test "
}
}
putlog "Edited / Modified by Someone"
|
CrazyCat, am i putting it in the right place for the code or not ?
| Code: | setudef flag menu
if {![channel get $chan menu]} { return 0 } |
|
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Tue Aug 17, 2021 9:21 am Post subject: |
|
|
No, I said "in your proc", so it means the line I gave you must replace your test.
Example:
| Code: | proc pub_pizza {nick uhost hand channel arg} {
global botnick
if {![channel get $chan menu]} { return 0 }
putserv "PRIVMSG $channel :10Gives 4$nick 10a 4hot 10slice of cheese pizza, compliments of Ferrari^_^"
return 0
} |
_________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
mabrook Halfop

Joined: 14 Jun 2021 Posts: 60
|
Posted: Tue Aug 17, 2021 9:36 am Post subject: |
|
|
Oh ok .. i will try to insert and test it..
| Code: |
proc pub_pizza {nick uhost hand channel arg} {
global botnick
if {![channel get $chan menu]} { return 0 }
putserv "PRIVMSG $channel :10Gives 4$nick 10a 4hot 10slice of cheese pizza, compliments of Ferrari^_^"
return 0
}
|
i've inserted it to all proc and tried it, it is working the -/+menu in the channel ..
but when i type the others commands it is not responding/showing in the channel. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Tue Aug 17, 2021 10:11 am Post subject: |
|
|
| mabrook wrote: | | Code: |
proc pub_pizza {nick uhost hand channel arg} {
global botnick
if {![channel get $chan menu]} { return 0 }
putserv "PRIVMSG $channel :10Gives 4$nick 10a 4hot 10slice of cheese pizza, compliments of Ferrari^_^"
return 0
}
|
but when i type the others commands it is not responding/showing in the channel. |
Because you just copy/paste without checking that there is an error in my example. Your procedures use channel, not chan.
Replace $chan with $channel in my line and it will be ok.
Note that switching the console to +d (debug) will advise you of an error:
| Code: | | Tcl error: can't read "chan": no such variable |
_________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
mabrook Halfop

Joined: 14 Jun 2021 Posts: 60
|
Posted: Tue Aug 17, 2021 11:15 am Post subject: |
|
|
my bad man, i'm still learning the basics
thank you for the support .. it is working perfect now.. |
|
| Back to top |
|
 |
|