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.

Need some help.

Old posts that have not been replied to for several years.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I want to bind bot's need's to ask what he need's from an other bot. I can't link them so .. I must do somthing like this: EggHelp is MyEgg helper, MyEgg will check if EggHelp ("*!*@host") is corect (let's say that his corect "*!*@host" is "*!*@helper") he will ask for his need's, else do nothing. Any sugestions ? .. I tryed to do on my own .. but .. no success. :smile:

Thx! .. Help will be apreciated. :smile:
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Inform us exactly where you are having the trouble and we will help.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

ok ppslim .. brb witht the code.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

--- Code ---
bind pub m|m !something pub_something

proc pub_something {a b c chan arg} {
if {![botisop $chan]} {return 0}
set arg [charfilter $arg]
global botnick
set friend "*!*@[string trimleft [lindex [split [getchanhost $nick $chan] @] 1] *!]"
if {$friend == *!*@friend.org} # <- in here I don't know how to do ... In here is the mistake. :smile:
putserv "PRIVMSG $chan :something"
return 0
}
else
return 0
}
}
--- EOF ---

Uff .. i lost the original code .. ;o( .. This is an copy of what I did remember. ;o(

Thx!

<font size=-1>[ This Message was edited by: caesar on 2001-11-20 09:07 ]</font>
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

It would be simpler to use

Code: Select all

if {[string match "*@friend.com" $c]} {
  yes it matches, so your commands go here
}
Note the use of $c, because of the way you defined the proc.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Hmm .. oky. I'll try it right now. Thx! :smile:
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

O .. well .. It works .. Thx! .. but I forgot for what I needed it. :smile: I'll remember .. :smile:

I'm bodering u with an other tcl. I bind a pub msg for "*#*" .. and if the msg is found "#mychan" .. don't do nothing .. else .. do the rest of the proces. I did something .. but .. don't good. I did this:

--- Cut ---
if {$arg == "#mychan"} { return }
-- Cut ---

This .. only do nothing .. if the only word in the line is "#mychan" .. If in line is more than "#mychan" .. boom :smile: .. not good. Any sugestions with this ?

Thx!
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Code: Select all

bind pubm - "*#*" pubm:test:bind
proc pubm:test:bind {nick uh hand chan arg} {
  if {[string match "*#mychan*" $arg]} { return }
  continue with script here
}
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Aaaaa.. Thx! .. I put there:

- Cut -
if {[string match "#mychan" $arg]} {return }
- Cut -

.. and din't work :smile: .. I forgot the "*" .. Thx again!
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

After all .. I ain't so dumb as I think :smile:
lol
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Hmm .. this don't work like it supouse to work.

- Code -
bind pubm - "*#*" pubm:test:bind
proc pubm:test:bind {nick uh hand chan arg} {
if {[string match "*#mychan*" $arg]} { return }
putserv "PRIVMSG $chan :Something.."

}
- Code -

When I say in the channel "#mychan" .. he don't do nothing. If I say something else .. he say's in the channel "Something.." .. like it's made to say.
The bind is only for "*#*" .. but he reacts to all words and is halting if "mychan" if found in the line. Where is the mistake ?
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

Code: Select all

 bind pubm - "*#*" pubm:test:bind 
proc pubm:test:bind {nick uh hand chan arg} { 
  if {[string match "*#mychan*" $arg]} {
    putserv "PRIVMSG $chan :Something.." 
  }
} 
I think thats what you want to do, that will say Something... when *#mychan* is said in the channel.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

caesar, a simple script like that can be read as english.

if {[string match "*#mychan*" $chan]} { return }
can be read as
if the contents of $chan has the text #mychan in it, then I should return.

This is why it was failing.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I see .. Ok.. I'm testing it right now.
Well man .. I know that can be read in english, and this is only a pice of an tcl. Is not working like i needed to work. Well .. I have to post in here my old tcl .. to see what I want to do.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

--- Code ---
####################
# Don't advertise! #
# version 1.0 #
# by |caesar #
####################

bind pubm - "*#*" pub_dont_advertise

proc pub_dont_advertise {nick host handle channel arg} {
global botnick
set banmask "*!*@[string trimleft [lindex [split [getchanhost $nick $channel] @] 1] *!]"
set bantime "1440"
if {![isop $botnick $channel]} {return 0}
if {[isop $nick $channel]} {return 0}
if {[string match "*#mychan*" $channel]} { return }
set n2hand [nick2hand $nick $channel]
if {([matchattr $n2hand m] || [matchattr $n2hand p] || [matchattr $n2hand b] || [matchattr $n2hand n] || [matchattr $n2hand f])} { return }
newchanban $channel $banmask $bantime "Don't advertise!"
putserv "KICK $channel $nick :grin:on't advertise!"
putserv "mode $channel +b $banmask"
return 1
}

putlog "Don't advertise .. loaded."
--- Code ---

With this code he don't do nothing. He don't react at all. Any sugestions with this ?
Locked