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 help with A fun.tcl (commands react on 3 ways)

Help for those learning Tcl or writing their own scripts.
Post Reply
g
gunnie
Voice
Posts: 1
Joined: Tue Jan 04, 2011 2:52 pm

Need help with A fun.tcl (commands react on 3 ways)

Post by gunnie »

Hi everybody.
I search the forum, but don't find A proper answer on it.
I'm also A newbie in tlc.

Some friends of mine compiled A fun.tcl (bot react on pub-commands).
Now I'm trying to put an extra line in it,so I can make my commands react on 3 ways.
1. !push (example)

Code: Select all

bind pub - !brb brb_msg
proc brb_msg {nick uhost hand chan args} {
  putchan $chan "eventjes geduld mensen ... $nick komt zodadelijk weer :)"
  return 1
}
2. !push nick (example)

Code: Select all

bind pub - !bye bye_msg
proc bye_msg {nick uhost hand chan args} {
  if {[lindex $args 0] == ""} { puthelp "notice $nick :gebruik !bye <nick>" ; return 0 }
  putchan $chan "Tot ziens $args ... ik hoop dat je gauw weer terug komt ... cya ... :-)"
  return 1
}
3. !push nick/botnick (example)

Code: Select all

bind pub - !badje badje_msg
proc badje_msg {nick uhost hand chan args} {
global botnick
  if {[lindex $args 0] == ""} { puthelp "notice $nick :gebruik !badje <nick>" ; return 0 }
  if {[lindex $args 0] == $botnick } { putchan $chan "'t Is nie omda gij raar riekt $nick , dat ik in bad moet hé!" ; return 0 }
  putchan $chan "$nick neemt een heerlijk heet badje samen met $args, Oohhh ... wat een passie ... of zijn jullie met rubberen eendjes aan't spelen :ppp"
  return 1
}
The first one I can make.
And one where the bot react on nick/botnick also

But I can't figure out how to make it work in one code. (like in example 3, but that in that code all 3 manners are present.)

Sorry if mine English is not perfect,but I'm Belgian.
That's also the reason that my commands are in Dutch.
D
Diamond85
Voice
Posts: 27
Joined: Sat Oct 25, 2008 5:12 pm

Re: Need help with A fun.tcl (commands react on 3 ways)

Post by Diamond85 »

gunnie wrote:Hi everybody.
I search the forum, but don't find A proper answer on it.
I'm also A newbie in tlc.
hello Gunnie.
my english is very bad but I'll try to help.
if you are looking for scripts for Eggdrop then you should not search only specific forums but also in the World Wide Web

http://www.eggdrop-help.de/page/download/8/

there loading the channelservice.tcl down. you need only make a difference with the texts in your language.


or if you think something like that then here:

Code: Select all

bind PUB -|- !HI pub:HI

proc pub:HI {nick host hand chan arg} {

	global botnick

	set arg [split $arg]
	set nick [split $nick]

	if {$arg == ""} {
		set arg $nick
	}

	if {[isbotnick $arg]} {
		putquick "PRIVMSG $chan :Hello $nick im the Bot on $chan"
		return 0
	}

	if {![onchan $arg $chan]} {
		putquick "PRIVMSG $chan :$arg is not on $chan."
		return 0
	}
	putquick "PRIVMSG $chan :Hello $arg welcome to $chan"
}
result:
14/01/11 01:05:46 <Diamond85> !hi
14/01/11 01:05:46 <@EggDrop> Hello Diamond85 welcome to #BestIRCd

14/01/11 01:05:54 <Diamond85> !hi EggDrop
14/01/11 01:05:54 <@EggDrop> Hello Diamond85 im the Bot on #BestIRCd

14/01/11 01:06:01 <Diamond85> !hi aaaaa
14/01/11 01:06:01 <@EggDrop> Hello aaaaa welcome to #BestIRCd

14/01/11 01:06:06 <Diamond85> !hi abc
14/01/11 01:06:06 <@EggDrop> abc is not on #BestIRCd.

Can you German? if so it would be easier for me because my English is not so good, too :D
Post Reply