|
Joined: Aug 2003
Posts: 136
Vogon poet
|
OP
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
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
|
|
|
|
Joined: Mar 2003
Posts: 1,256
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,256 |
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"
|
|
|
|
pheonix
|
pheonix
|
alias join { join $2 .set -u3 %joined $true } on *:JOIN:#:{ if (!%joined) || (%joined != $true) { part $chan } }
|
|
|
|
pheonix
|
pheonix
|
as well as a redefinition of the word "friend" yeah i never thought friends should mess around either [/sarcasm]
|
|
|
|
Joined: Aug 2003
Posts: 136
Vogon poet
|
OP
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
|
|
|
|
pheonix
|
pheonix
|
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.
|
|
|
|
Joined: Feb 2003
Posts: 806
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 806 |
[edit: removed the lock suggestion]It would be something like these..
[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.
|
|
|
|
Joined: Feb 2003
Posts: 806
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 806 |
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)".
|
|
|
|
pheonix
|
pheonix
|
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
|
|
|
|
Sigh
|
Sigh
|
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).
|
|
|
|
Joined: Dec 2002
Posts: 2,958
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,958 |
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.
|
|
|
|
r0ck0
|
r0ck0
|
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.
|
|
|
|
r0ck0
|
r0ck0
|
hmmm edit time ran out lol .. forget my last reply
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),.,#)
}
|
|
|
|
Joined: Feb 2003
Posts: 806
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 806 |
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.
|
|
|
|
Joined: Mar 2003
Posts: 1,256
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,256 |
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.
|
|
|
|
r0ck0
|
r0ck0
|
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.
|
|
|
|
Joined: Dec 2002
Posts: 2,958
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,958 |
/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.
|
|
|
|
r0ck0
|
r0ck0
|
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.
|
|
|
|
codemastr
|
codemastr
|
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."
|
|
|
|
r0ck0
|
r0ck0
|
thx
|
|
|
|
|