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.

set to specific channel cmds

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
mabrook
Halfop
Posts: 60
Joined: Mon Jun 14, 2021 9:41 am

set to specific channel cmds

Post by mabrook »

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

# 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..
User avatar
mabrook
Halfop
Posts: 60
Joined: Mon Jun 14, 2021 9:41 am

Post by mabrook »

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

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.. :) :P
User avatar
CrazyCat
Revered One
Posts: 1236
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Hum, you'd better do what you asked :)

First, add at the beggining of the script:

Code: Select all

setudef flag menu
Then, in all your proc (called by a pub), add the line:

Code: Select all

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
User avatar
mabrook
Halfop
Posts: 60
Joined: Mon Jun 14, 2021 9:41 am

Post by mabrook »

Just want to try and test this -/+ , please see below

Code: Select all



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

setudef flag menu


if {![channel get $chan menu]} { return 0 }
User avatar
CrazyCat
Revered One
Posts: 1236
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

No, I said "in your proc", so it means the line I gave you must replace your test.

Example:

Code: Select all

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
}
User avatar
mabrook
Halfop
Posts: 60
Joined: Mon Jun 14, 2021 9:41 am

Post by mabrook »

Oh ok .. i will try to insert and test it.. :P


Code: Select all


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.
User avatar
CrazyCat
Revered One
Posts: 1236
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

mabrook wrote:

Code: Select all


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

Tcl error: can't read "chan": no such variable
User avatar
mabrook
Halfop
Posts: 60
Joined: Mon Jun 14, 2021 9:41 am

Post by mabrook »

my bad man, i'm still learning the basics :P


thank you for the support .. it is working perfect now..
Post Reply