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.

oper fjoin/!move/vhost .tcl help

Old posts that have not been replied to for several years.
Locked
T
Travis

oper fjoin/!move/vhost .tcl help

Post by Travis »

Code: Select all

bind pub m|m vhost /ns set $2 $3- | /notice $nick vhost of $2 changed to $3-
bind pub m|m fjoin { if ( [ $chan isin %m.rooms ] ) && ( [ $3 isin %m.rooms ] ) { /sajoin $2 $3 | /notice $nick $2 forced to join $3 }
elseif ( [ $chan !isin %m.rooms ] ) { /halt }
elseif ( [ $3 !isin %m.rooms ] ) { /notice $nick sorry but due to abuse only main channels can be forced to }
bind pub m|m !move { if ( [ $chan isin %m.rooms ] ) && ( [ $3 isin %m.rooms ] ) && ( [ $chan != #admins ] ) { /sajoin $2 $3 | /timer 1 5 /sapart $2 $chan | /notice $nick $2 forced to $3 $+ , $2 will be parted from here in 5 seconds }
elseif ( [ $chan !isin %m.rooms ] ) { /halt }
elseif ( [ $3 !isin %m.rooms ] ) { /notice $nick sorry but due to abuse only main channels can be forced to }

#main rooms set in variable %m.rooms
ok ive never made .tcl scripts before will this work if not can you tell me what i need to do to make it work
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

that's not tcl.
Have you ever read "The Manual"?
D
DayCuts
Voice
Posts: 37
Joined: Tue Jun 15, 2004 8:43 am

Post by DayCuts »

That is mirc scripting not tcl. All you have done is change the on text events to tcl binds. which simply will not work.

First of all you must seperate binds from the code.. eg
bind pub m|m vhost my:vhostproc

proc my:vhostproc {nick host hand chan arg} {
your code here
}

A HUGE factor to realise is that tcl handles command arguments very differently, all arguements given with a command are stores in $arg not the $1 $2 $3- etc that mirc scripting uses.

Here is the first part to get you started, keep in mind this is very basic and untested. I highly suggest you RTFM : )

Code: Select all

bind pub m|m vhost my:vhostproc
proc my:vhostproc {nick host hand chan arg} {
  putmsg NickServ "set [lindex $arg 0] [lindex $arg 1]"
  putnotc $nick "Vhost of [lindex $arg 0] changed to [lindex $arg 1]"
}
T
Travis

Post by Travis »

i have much difficulty understanding .tcl lol however from what i have seen im sure i could probably come up with the rest and also learn from it ty very much so for this however i have but just one question pertaining to this for instance using the !move command how would i make it so that if the user being moved is in #admins that the command would not proceed...
i apreciate all of your help ty very much for taking the time to help me learn this style of scripting
T
Travis

Post by Travis »

sorry i also forgot to mention that the fjoin and !move are only able to be done in the main room channels they usually use a variable how would that be done in .tcl for instance they would set the variable as %m.rooms and have all the main rooms listed on it
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well what you can do here is make a list, of the main room channels which you want the bots triggers to only work on.

set mainrooms "#chan1 #chan2 #chan3"

Then in your procedure check if the trigger command is done on any of the mainrooms, then only go ahead and 'do your stuff'

Use this in your procedure at first:

Code: Select all

if {([lsearch -exact [split [string tolower $mainrooms]] [string tolower $chan]] != -1)} {
This is what you needed, hope it helps! :P
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked