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 an exsample script!

Old posts that have not been replied to for several years.
Locked
C
Commari

Post by Commari »

Ok, I started studying TCL today :wink:
and I would be pleased if some of u who know TCL could make me an exsample script.
it should be as simple as possible, like
when I type !kill <nick> the bot would kickban the specified nick.
I need this script cos my English isn't that good, so I can't well understand the Sunninet's instructions :sad:
If there would be a help-test in Finnish...
Remember: as simple as a script can be :smile:
Thx
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Code: Select all


bind pub o|o !kill do_kill

proc do_kill {nick uhost hand chan text}
{
  set victim_uhost [getchanhost $text]
  if {$victim_uhost == ""} {
    putserv "PRIVMSG $chan :$text not found"
    return 0
  }
  putserv "MODE $chan +b *!$victim_uhost"
  putserv "KICK $chan $text"
  return 1
}

C
Commari

Post by Commari »

Cheers :smile:
I need help again.
I've understood that this is a public forum, and I have a right to ask for help, right?
Anyway, how do I know when to put {nick chan hand} or something?
And when not, or put something else...
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

OK - The answer for that one is read tcl-commands.doc. It shows what is needed by a command, and as such, it will inform you which one is needed.

In the script, he could have used
proc do_kill {a b c d e}
All the "nick host hand chan text" defines, is what varibale names should be used when running the script.

To state the differance between each of the argiuments.

nick: the nickname of the person that triggere the event EG: ppslim

host: the ident and hostname of the user that triggered the event EG: look@host54.328.ntlworld.com - You can put together the nickname and the host to form a ban mask

hand: The handle is a little more complex. It is basicaly a username. So my nickname on IRC could be "TCLfreak", but my handle would still be ppslim. People without a user-record on the bot, could still trigger a bind, so for these users, hand would be "*".

chan: Obviously, the channel the bind was triggered on.

text: The rest of the text sent when the bind was triggered EG "!pub hehe lala". If !pub was a trigger, then text would equal "hehe lala". NOTE text is a string, and not a list, and as such, can could accidental backdoors to be made, if the text in this string is not handled correctly. If you are unsure as to handle the text, just ask.

These are not all the arguemts that could be placed in a bind, only the ones used in the pub bind. If you read tcl-commands.doc, in the bind section, you will see what each bind has sent to it. Some of the values will be obvoius, others will be explained.


<font size=-1>[ This Message was edited by: ppslim on 2001-11-06 09:54 ]</font>
Locked