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.

Needing some help in converting mIRC -> TCL

Old posts that have not been replied to for several years.
Locked
I
Infernal_DJ

Needing some help in converting mIRC -> TCL

Post by Infernal_DJ »

I have read some topics conserning the same thing, but I have so much things to ask that I decided to create new topic for it. For start, I'd like to ask how I should convert some parts of my earlier code to TCL. All texts, variables ect. were in finnish so i translated them on-the-fly for you. Makes things easier. (so don't expect anything politicaly correct text :)) These mIRC scripts are in beta because I planned them for my friend and suddenly got one shell -account to run eggdrop in. You'll get the poin what it should do.
Oh, and I started to study TCL -scripting about two days ago, so...

1. Prefix'o'matic

Code: Select all

on 1600:text:*prefix*:#: {
  if ($1 == %prefix $+ prefix ) {
    set %prefix $2
  }
  else { halt }
  halt
}
This code sets the prefix of all chancommands. (it's usualy "!") 1600 means owner. I don't actualy know how "$+" should be done.

2. Anti Autojoin -kick

Code: Select all

on 1600:text:*infkick*:#: {
  if ($1 == %prefix $+ infkick) { 
    if ($2 == $me) { /msg $nick No. | halt }
    /ban $chan $2 -u3
    /msg $2 Anti autojoin -kick (3 sec ban)
    /kick $chan $2 $3- (Infernal Kick)
    set %last.command infkick $2 | set %last.user $nick
  }
  else { /msg $nick Correct syntax: %prefix $+ infkick <target> <reason> }
  halt
}
This script first checks if prefix is right, then if it's going to kick himself, (witch it prevents) bans the target for 3 secs, sends some spam to the target, kicks the target, sets %last.command and %last.user. As I test this while i write, the un-ban needs some coding to work. You still got the point.

3a. Silent Night on/off

Code: Select all

on 1600:text:*silentnight*:#certain.channel:{
  if ($1 == %prefix $+ silentnight) {
    if ($2 == on) { .set %silentnight on | mode $chan +m | .msg $chan 4Silent night activated, stfu or get kicked! | set %last.command silentnight on | set %last.user $nick | halt }
    if ($2 == off) { .set %silentnight off | mode $chan -m | .msg $chan 4Silent night deactivated. | set %last.command silentnight off | set %last.user $nick | halt }
  }
  else { halt }
}
Sets Silent night on or off and sets +/-m to that channel in addition to normal prefix -checks ect.

3b. Silent Night scan

Code: Select all

on 1:text:*:#certain.channel: {
  if ($nick == negu) { halt }
  if ($nick == Svir) { halt }
  if (%silentnight == on) { kick $chan $nick Stfu! }
  else { halt }
}
Nothing special here. Just kicks people if they speak when Silent Night is on.

-------------------------------------------
There is lots of other small scripts, but maby these will help me to start understanding tcl enough to convert 'em myself.
Sorry for possible bad english :wink:
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

well us the pub binds (tcl-commands.doc)
for example second script "Anti Autojoin -kick" (I'll leave the others for you):

Code: Select all

#what prefix do you want to use ?
set prefix "!"

#code goes here
bind pub n|n "${prefix}infkick" kick:nick

proc kick:nick {nick uhost hand chan arg} {
 set vict [lindex [split $arg] 0]
 set rso [lindex [split $arg] 1 end]
 if {$vict == $::botnick} {
 putserv "PRIVMSG $nick :No"; return 0
}
 #set your ban type.. lets call it $ban for example
 putserv "MODE $chan +b $ban"
 putserv "KICK $chan $vict :$rsn"
} else {
 putserv "PRIVMSG $nick :Correct syntax: $::{prefix}infkick <target> <reason>"
}
try to understand it, then do the other scripts... cuz nobody is in the mood or has time to make your scripts.
I
Infernal_DJ

Post by Infernal_DJ »

1. Thanks for the help.
2. I'll try.
3. "nobody is in the mood or has time to make your scripts." <- *sigh* Sorry for asking how it's done by "volunteering experts". :-?
Locked