|
yah
|
yah
|
í need something for snotice. snotice is: XXXXXX.XXXXX.server- *** Notice -- Client connecting on port 6667: badguy (war@69.163.85.3).
can anyone help me with a code so that if there is anything before @, bot will kline the ip address or mask for example, 69.163.85.* for 150 sec?
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
What you're asking for will kline everyone that attempts to join the server. I suggest you re-think about what it is you actually want to do, because I doubt it if you want to kline everyone.
|
|
|
|
Om3n
|
Om3n
|
on ^1:SNOTICE:*:{
if ($1-8 == *** Notice -- Client connecting on port 6667:) && (*[color:red]war[/color]@* iswm $10) {
var %addy = $mask(*! $+ $mid($10,2-,$calc($len($10)-3)),4)
; this will set the address in the format *!*@xxx.xxx.xxx.* to a local variable called %addy
put KLINE command here
; use %addy in your kline command for the address to kline
}
}
Change the red part to the ident of your choice, be specific. This should work, BUT i highly suggest you dont ban users based entirely on the ident used. Also, most services support other types of klines, such as sqline sgsline and szline which allow akilling of users based on nickname, realname and mask respectively.
Last edited by Om3n; 08/10/05 05:52 AM.
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
That should be the other way round, if (*war@* iswm $10)
|
|
|
|
Om3n
|
Om3n
|
Yep, updated, its an unfortunate habbit of mine coding iswm the wrong way around :\
|
|
|
|
yah
|
yah
|
sorry! it is for any ident or anything before @ character not just for 'war' and it will be not kline but shun for 30 sec on mask/ip address. thankz!
|
|
|
|
Om3n
|
Om3n
|
For any ident at all? im sorry but i think that is an obsurd idea. EVERY user connecting to irc has an ident, there is NO way around it. So what you would be doing it shunning every user the second they connect, this is again an obsurd thing to do in my opinon, by shunning them how are they to identify? join channels? msg somebody?. If they can't do anything then its pointless them being connected in the first place. In any case, if you want to shun/kline/whatever to anybody that even has an ident, then you dont need to even both checking the ident because every user will have one.
on ^1:SNOTICE:*:{
if ($1-7 == *** Notice -- Client connecting on port) {
var %addy = $mask(*! $+ $mid($10,2-,$calc($len($10)-3)),4)
; this will set the address in the format *!*@xxx.xxx.xxx.* to a local variable called %addy
put KLINE/SHUN/WHATEVER command here
; use %addy in your command for the address to use or whatever
}
}
I also altered the first if, since i assume like most ircds it allows connections on multiple ports. If you want it port specific just change the second line back to "if ($1-8 == *** Notice -- Client connecting on port 6667:) {" changing '6667' if neccersary.
|
|
|
|
yah
|
yah
|
thankz Om3n. actually i wanted bot to read ident and initiate command after reading snotice:connecting....i am trying to use it for java based site where i will be able to manage to get snotice with ident and without ident. and i want a script to read the ident. if there is anything before @, script will tiger some command for example, shun. if there is nothing before @, bot won't execute any command. the code you have given, if there is any ident or no ident, it shuns the mask in both cases. can you make it like if there is no ident, there will be no shun?
|
|
|
|
schaefer31
|
schaefer31
|
thankz Om3n. actually i wanted bot to read ident and initiate command after reading snotice:connecting....i am trying to use it for java based site where i will be able to manage to get snotice with ident and without ident. and i want a script to read the ident. if there is anything before @, script will tiger some command for example, shun. if there is nothing before @, bot won't execute any command. the code you have given, if there is any ident or no ident, it shuns the mask in both cases. can you make it like if there is no ident, there will be no shun? It's impossible to have no ident. Everyone has one even if it's just a single character.
|
|
|
|
Om3n
|
Om3n
|
Indeed, the java irc ident is generally jirc by default. It is not possible to be connected without an ident. If you are recieving any sort of connect/exit server notices without the ident part then its a bug in the ircd.
|
|
|
|
yah
|
yah
|
thank u again! if the ident is larger than one, what would be the code for shuning the mask for 30 sec?
|
|
|
|
yah
|
yah
|
hello again! thank u! somehow i can also get snotice like this: XXXXXX.XXXXX.server- *** Notice -- Client connecting on port 7000: WdRta (@69.163.85.3) at the same time. can you help me with a code so that if there is anything to the left of @ (before @), bot will shun the ip address or mask for 150 sec and who wont have anything before @, script will be halted?
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
There will always be something on each side of the @ symbol The users ident is before it, and their IP address (either resolved into a name or unresolved and in numerics) will be after it. It is IMPOSSIBLE to have a connection to the internet without the second part, and for IRC chatting, the first part will be there also.
Your basically just repeating what you started this topic with.
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
I wonder if the "ident" being used is something like Ctrl-O or whatever... basically a character that will not display, but is still acceptable as an ident. I don't know how else it's possible to get no ident.
|
|
|
|
Om3n
|
Om3n
|
Indeed, if its not a bug in the ircd then a non-displayable charactor such as a control charactor is all i can think of. Yah, hold control when you copy/paste to keep control codes intact.
|
|
|
|
yah
|
yah
|
yes you guys are right. it is some non-displayable charactor such as a control charactor they use.i have seen that. is there anyway, any script code to detect these control characters in ident?
|
|
|
|
Joined: Apr 2003
Posts: 701
Hoopy frood
|
Hoopy frood
Joined: Apr 2003
Posts: 701 |
When you get such an 'empty' ident displayed, keep ctrl pressed and select the ident and a few letters following it with your mouse. Then paste in the editbox and you should see a box, this is the control character they used, you can use $asc(character) and press tab to see the character number. In scripts you can just use that box with an isin or iswm or even just == in a /if statement.
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
Well, here are the $chr's for the main control codes:
$chr(2) = Ctrl-B $chr(3) = Ctrl-K $chr(15) = Ctrl-O $chr(31) = Ctrl-U
You can check it for those by default if you want. If it's some other code, then you'd need to find the $chr for it as mentioned above.
|
|
|
|
|