mIRC Home    About    Download    Register    News    Help

Print Thread
#50709 22/09/03 05:15 AM
Joined: Aug 2003
Posts: 136
Vogon poet
OP Offline
Vogon poet
Joined: Aug 2003
Posts: 136
Me and a friend run a small irc server, when i goto bed he likes to be an ass and force me into rooms with odd names, i wrote a lil script that if the channel doesnt match a variable it parts but it doesnt work help would be apreciated
Code:
 
on *:join:#: {
  if ($chan != %chans)
  /part
}
 

And I set the variable by hand and checked to make sure it was what it was supposed to be


In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
#50710 22/09/03 05:24 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
And you think he won't be able to circumvent that? Why not simply use mirc's password feature? (type /help lock)

PS: a good ass-kicking might be helpful too, as well as a redefinition of the word "friend"


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#50711 22/09/03 05:26 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
alias join {
join $2
.set -u3 %joined $true
}
on *:JOIN:#:{
if (!%joined) || (%joined != $true) { part $chan }
}


new username: tidy_trax
#50712 22/09/03 05:29 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
Quote:
as well as a redefinition of the word "friend"

yeah i never thought friends should mess around either
[/sarcasm]


new username: tidy_trax
#50713 22/09/03 05:30 AM
Joined: Aug 2003
Posts: 136
Vogon poet
OP Offline
Vogon poet
Joined: Aug 2003
Posts: 136
the lock feature sure seems like it would work since he isnt on my computer, why dont you read it and maybe learn a thing or two. And thankyou pheonix


In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
#50714 22/09/03 05:31 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
np:), that might not work if your on a really laggy irc server, or if you have a really slow internet connection.
in other words, if it takes you longer than 3 seconds to /join it will /part.


new username: tidy_trax
#50715 22/09/03 05:47 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
[edit: removed the lock suggestion]
It would be something like these..
Code:
[color:brown]on *:join:#:{ if ($nick == $me) && ($istok(%chans,$chan,32)) { part } }[/color]
or
[color:brown]on me:*:join:#:{ if ($istok(%chans,$chan,32)) { part } }[/color]

You'd fill %chans with "#channel1 #channel2 #channel3 ... #channelN".

Your current script fails because..
1) Your /if statement doesn't check if $chan is an existing item from the list on %chans. Instead, it checks if $chan is different (!=) than the whole list on %chans, which doesn't make sense;
2) Your /part command is not part of the /if statement (no { } brackets nor both sentences in the same line), causing the script to always leave any channel you join.

Last edited by cold; 22/09/03 05:50 AM.

* cold edits his posts 24/7
#50716 22/09/03 05:59 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
I don't get it, why /part if it takes 3s or more? The only problem I saw was about channel names.

Anyway, that would be "join $1-", not "$2".
Also a tip, the condition "(!%joined) || (%joined != $true)" is redundant, it can be shortened to "(!%joined)".


* cold edits his posts 24/7
#50717 22/09/03 11:41 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
no it cant, because then the /join alias will be useless, the whole point of setting the variable '%joined' to '$true' is so that if someone /fjoins him it will /part.
i realise it should of been $1 blush


new username: tidy_trax
#50718 22/09/03 01:12 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
Don't you receive a specific server notice when the fjoin command is used? Scripting something that reacts to that may be another option (using the on snotice event).

#50719 22/09/03 03:41 PM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
That will stop mIRC opening the window but /fjoin will still bring you to a room. It's not possible to get around. I think a review of the fella's o:line is in order.

#50720 22/09/03 04:02 PM
Joined: Jun 2003
Posts: 242
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
Code:
alias join {
  set [color:red]-u10[/color] $+($eval(%joined,0),.,[color:green]$iif($left($1,1) == -,$2,$1)[/color]) $true
  !join $1-
}

on *:JOIN:#: {
  if (($nick == $me) && (!$eval($+($eval(%joined,0),.,#),2))) !part #
  unset $+($eval(%joined,0),.,#)
}


[i]Edit:

Added this to unset variable in case of no join (ban, invite only, incorrect
key, channel limit etc.) and 10 seconds to allow for some lag time.


Added this in case switches are used with the JOIN command

Last edited by r0ck0; 22/09/03 05:52 PM.
#50721 22/09/03 06:08 PM
Joined: Jun 2003
Posts: 242
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
hmmm edit time ran out lol .. forget my last reply
Code:
alias join {
  var %chans = $iif($left($1,1) == -,$2,$1),%i = 1
  while ($gettok(%chans,%i,44) != $null) {
    set -u10 $+($eval(%joined,0),.,$gettok(%chans,%i,44)) $true
    inc %i
  }
  !join $1-
}
on *:JOIN:#: {
  if (($nick == $me) && (!$eval($+($eval(%joined,0),.,#),2))) !part #
  unset $+($eval(%joined,0),.,#)
}

#50722 22/09/03 08:22 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Quote:
no it cant, because then the /join alias will be useless, the whole point of setting the variable '%joined' to '$true' is so that if someone /fjoins him it will /part.

"(!%joined) || (%joined != $true)" means "(%joined is $null, $false or 0) OR (%joined isn't $true)".

If %joined isn't $true, then it will satisfy the first condition. Since your whole code doesn't tell %joined to be something other than $true or $null anywhere, this condition will be evaluated to "(!$null)", which is always satisfied.
Otherwise, if %joined is $true, it will be evaluated to "(!$true)", thus won't be satisfied.

So, that means the first condition itself checks everything. No need for the second one, it's redundant in this case. That's what I meant.

Last edited by cold; 22/09/03 08:36 PM.

* cold edits his posts 24/7
#50723 22/09/03 08:29 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
I assume it's a stab at my help suggestion. Your original post made it quite obvious he was using YOUR mirc ( that is to say - you never specified he wasn't using your mirc copy, you now seem to say he uses another mirc copy on another computer )? In that case, he someone remotely controls your mirc? ewww. remove the script then.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#50724 22/09/03 08:43 PM
Joined: Jun 2003
Posts: 242
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
Some IRCd's like Hybrid have a Force Join module that gives admins a command called FORCEJOIN or FJOIN which forces a user to join a channel.

/forcejoin <nick> <channel>
/fjoin <nick> <channel>

Last edited by r0ck0; 22/09/03 09:13 PM.
#50725 22/09/03 08:50 PM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
/sajoin is for opers to use on themselves and provides ban protection.
/fjoin is for opers to use on other users but only provides a forced entry but no protection.

#50726 22/09/03 09:12 PM
Joined: Jun 2003
Posts: 242
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
ya that's right .. was it SVSJOIN?

I think this is from Unreal ..
SVSJOIN
Forces a user to join a channel. Can only be used by a U:Lined server.
Syntax: /SVSJOIN [nickname] [channel]
Example: /SVSJOIN parseint #perch

SAJOIN
Forces a user to join a channel. Can only be used by a Services Admin.
Syntax: /SAJOIN [nickname] [channel]
Example: /SAJOIN parseint #perch

SVSPART
Forces a user to leave a channel. Can only be used by a U:Lined server.
Syntax: /SVSPART [nickname] [channel]
Example: /SVSPART parseint #perch

SAPART
Forces a user to leave a channel. Can only be used by a Services Admin.
Syntax: /SAPART [nickname] [channel]
Example: /SAPART parseint #perch

Anyway, LocutusofBorg it sounds like this is what he meant.
It's what I assumed he meant anyway.

Last edited by r0ck0; 22/09/03 09:15 PM.
#50727 22/09/03 11:06 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
In UnrealIRCd /sajoin is _not_ what Watchdog said. It allows you to force someone else to join a channel. The thing is, the user will be notified with a message like "someoper forced you to join #somechannel." svsjoin, which can only be used by services does not display that notice. The reason is, many IRC services programs have an autojoin feature. Basically a server-side autojoin list. They make use of SVSJOIN to accomplish that. It would be a pain if each time you connected and /ns identified that you'd get "nickserv forced you to join #thechannel."

#50728 22/09/03 11:33 PM
Joined: Jun 2003
Posts: 242
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
thx smile


Link Copied to Clipboard