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.

Hi, Help With tcl scripting pleas :)

Old posts that have not been replied to for several years.
Locked
G
Gods Hell

Hi, Help With tcl scripting pleas :)

Post by Gods Hell »

Hi I'm Gods Hell,

I'm using mIRC for over 2 years now i make my own mIRC scripts etc

and now i'm willing to learn tcl

i was looking for sites or help files where every comand is explained (like the help file of mIRC)
but i haven't foud it yet ... so if someone has this kind of info it wopuld be verry nice if you could send me it :D

now for the 2nd part

can someone translate mIRC script--> tcl script

just a litle example:

Code: Select all

on *:text:!help*:#help:{
  if ($2 == $null) { /.msg $nick Hello $nick $+ , type !help <question> }
  if ($2 != $null) {
    /.msg $nick Help test 123 worcks 
  }
}
so i know how the trigger event's are

i looked in some scripts but the only thing i c is
proc .... {

}
L
LtPhil
Voice
Posts: 26
Joined: Mon Jul 28, 2003 10:25 am

Post by LtPhil »

PART 1
i tend to use http://tcl.powersource.cx/eggtcl.php and http://www.suninet.nl/tclguide/index.php most often. there are plenty of other references out there, too. just google what you're looking for, and make sure to include "eggdrop" and/or "TCL" as a search keyword.

PART 2

Code: Select all

on *:text:!help*:#help:{
  if ($2 == $null) { /.msg $nick Hello $nick $+ , type !help <question> }
  if ($2 != $null) {
    /.msg $nick Help test 123 worcks
  }
}
i'm no TCL genius... but i think the following code snippet should be equivalent (untested as of yet -- my eggy's broken right now):

Code: Select all

bind pub - !help pub:help

proc pub:help {nick host hand chan text} {
  if {$text == ""} {
    putserv "PRIVMSG $nick :Hello ${nick}, type !help <question>"
  } {
    putserv "PRIVMSG $nick :Help test 123 works"
  }
}
will have a snippet in just a bit that will help you to process WHAT the parameter is...
L
LtPhil
Voice
Posts: 26
Joined: Mon Jul 28, 2003 10:25 am

Post by LtPhil »

i actually have a help command in my eggdrop (it works until i write another script that kills the entire bot :-? ), that takes multiple parameters. here's how it works (\002 is the escape sequence to make text bold in IRC):

Code: Select all

bind pub - !help pub:help

proc pub:help {nick host hand chan text} {
  switch $text {
    "!help" {
      putserv "PRIVMSG $nick :\002!help\002 gives you a list of commands"
    }
    "!opme" {
      putserv "PRIVMSG $nick :\002!opme\002 will op you in the given channel, if you are an auto-op"
    }
    "!kick" {
      putserv "PRIVMSG $nick :\002!kick <nick>\002 will kick the specified nick from the channel, if you are an auto-op"
    }
    "!cookie" {
      putserv "PRIVMSG $nick :\002!cookie [nick]\002 will give a cookie to the specified nick, or to you if you don't specify a nick"
    }
    default {
      putserv "PRIVMSG $nick :Command listing:"
      putserv "PRIVMSG $nick :!help , !opme , !kick , !cookie"
      putserv "PRIVMSG $nick :Type \002!help <command>\002 for more help on that command"
    }
  }
}
the default block will trigger if none of the other blocks triggered -- whether the user didn't specify a command they wanted help on, or they specified something that wasn't in the listing. if you wanted it to ONLY give the command listing when the user didn't specify a command for help on, i think you'd just need to replace default with a pair of double-quotes, like ""

that isn't my script exactly, but it should give you an idea of how to set everything up :)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind pub - !help pub:help 

proc pub:help {nick host hand chan text} { 
  if {$text == ""} { 
    putserv "PRIVMSG $nick :Hello $nick, type !help <question>" 
  } else { 
    putserv "PRIVMSG $nick :Help test 123 works" 
  } 
}
also this may work:

Code: Select all

bind pub - !help pub:help 

proc pub:help {nick host hand chan text} { 
  if {$text != ""} { 
    putserv "PRIVMSG $nick :Help test 123 works" 
  } else {
    putserv "PRIVMSG $nick :Hello $nick, type !help <question>"
   }
}
G
Gods Hell

Post by Gods Hell »

Thx Allot guy's thx for the links will tak a look there i hope i can make some nice scripts THX !

what dous the

Code: Select all

bind pub - !help pub:help
part ?

i think it says when !help is said in channel it shall do process pub:help? is that right?

ahea found something on site

Code: Select all

PUB
bind pub <flags> <command> <proc>
procname <nick> <user@host> <handle> <channel> <text>
Description: used for commands given on a channel. The first word becomes the command and everything else is the text argument.
Module: irc
but I don't see the "-" between the "bind pub" and "!help"

Code: Select all

site: bind pub <flags> <command> <proc>
script: bind pub - !help pub:help
any reason for that?


hm think i just figuerd something out
you can translate the
"on *:text:.." with "bind pub"

on *:join: -> bind join
is that correct?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

pretty good.
the - stands for any flag, for example if u want it to only read the pub from owners then u put bind pub n !help <procname>

as for on *:text: is not always replaced by bind pub
if text on channel then bind pub, if private use binf msg or msgm (check'em out in tcl-commands.doc)

and yeah the on *:join is a join bind (bind join)
G
Gods Hell

Post by Gods Hell »

great!
Locked