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.

Mrc to TCL !!! Plissssssssss !!!!

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
O
ORATEGOD
Voice
Posts: 39
Joined: Mon Jun 08, 2020 5:50 pm

Mrc to TCL !!! Plissssssssss !!!!

Post by ORATEGOD »

Code: Select all

on *:join:#CHAN1:{ mode #CHAN2 +v $nick }
thanks a lot for the help friends
User avatar
CrazyCat
Revered One
Posts: 1216
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

You probably must begin to learn TCL.

Here is the basic "conversion":

Code: Select all

bind join - "#chan1 *" voice
proc voice {nick uhost handle chan} {
   pushmode "#chan2" +v $nick
}
And a better procedure:

Code: Select all

proc voice {nick uhost handle chan} {
   if {$nick eq $::botnick} { return }
   if {![botisop "#chan2"} { return }
   if {![onchan $nick "#chan2"} { return }
   pushmode "#chan2" +v $nick
}
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

bind join - * voice

proc voice {nick uhost hand chan} {
	if {[isbotnick $nick] || ![string equal -nocase $chan "#chan2"] || ![botisop $chan]} return
	pushmode $chan +v $nick
}
isbotnick - returns 0 or 1 if the nick is the bot itself
string equal with the -nocase argument compares the channel name with #chan2
botisop - returns 0 or 1 if the bot has channel operator status
pushmode - sends out a channel mode change, it's one of the methods with a slow queue
the ! (exclamation mark) in front of the [function] negates the result, basically turns the IF statement into an IF NOT
Once the game is over, the king and the pawn go back in the same box.
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Mrc to TCL !!! Plissssssssss !!!!

Post by willyw »

Agreeing with the above.

Here are some links to bookmark and use.

http://suninet.the-demon.de/

https://docs.eggheads.org/mainDocs/tcl-commands.html

http://www.tcl.tk/man/tcl8.6/TclCmd/contents.htm

It's fun stuff. Try it. :) Get started.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
User avatar
CrazyCat
Revered One
Posts: 1216
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

caesar wrote:

Code: Select all

bind join - * voice

proc voice {nick uhost hand chan} {
	if {[isbotnick $nick] || ![string equal -nocase $chan "#chan2"] || ![botisop $chan]} return
	pushmode $chan +v $nick
}
isbotnick - returns 0 or 1 if the nick is the bot itself
string equal with the -nocase argument compares the channel name with #chan2
botisop - returns 0 or 1 if the bot has channel operator status
pushmode - sends out a channel mode change, it's one of the methods with a slow queue
the ! (exclamation mark) in front of the [function] negates the result, basically turns the IF statement into an IF NOT
Thanks for having given explanations.
You made a small error on botisop: it's on target channel that it must be tested, so on #chan2, not on $chan.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Actually I didn't.

For argument sake let's say the following variables hold some values:

Code: Select all

$nick = John (bot's nick is Bot)
$chan = #something
We break this code:

Code: Select all

if {[isbotnick $nick] || ![string equal -nocase $chan "#chan2"] || ![botisop $chan]} return
into 3 separate if statements so it's easier to follow:

Code: Select all

if {[isbotnick $nick]} return
if {![string equal -nocase $chan "#chan2"]} return
if {![botisop $chan]} return
1st - since $nick holds a value "John" and bot's nick is "Bot" the result will be false and continues to 2nd statement (or second part of the initial statement, doesn't mater from a compiler point of view)
2nd - since the $chan is #something and the two strings aren't equal the statement will return false but since it's an IF NOT will make the result a true and thus will enter it's THEN part and dose a return

Now let's make a change to $chan making it be equal with #cHaN2 (notice the mixed case) for example.

1st step will continue as above
2nd step compares the "#cHaN2" with #chan2 in a case in-sensitive matter, meaning the two are identical thus the statement returns true. the IF NOT makes the true into a false thus continues to 3rd step
3rd step - at this point the $nick = John and $chan = #cHaN2 (from the botisop perspective it's identical with #chan2) since it passed the 2nd step. So, no, $chan is correct there since excluded other names at 2nd step.
Once the game is over, the king and the pawn go back in the same box.
User avatar
CrazyCat
Revered One
Posts: 1216
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

I disagree:
Reading the .mrc code, the script voices john on #chan2 if John joins #chan1. So the eggdrop must be op on #chan2 to give the voice. Doesn't matter if it'd op in #chan1 (so $chan), it doesn't make any action in it.

I think you made an initial confusion: John joins #chan1 ($chan) and must be voiced in #chan2.
Your script is: John joins any channl (but not #chan2) where the eggdrop is op, John is voiced. Not what I read in the .mrc.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Ah, i missed the #chan1 part in the initial post (to be honest didnd't even look at it). Yeah, you are right, my bad.
Once the game is over, the king and the pawn go back in the same box.
Post Reply