mIRC Home    About    Download    Register    News    Help

Print Thread
#97530 13/09/04 04:44 PM
Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
hello again,

okay now that i have the input straight (somewhat) on my anti-op script.. now i need some info on how i would be able to match the adress of the user being opped to the address in the txt file that the info is stored in..

so far i know i need the event:

on 1:op:?: { w/e code }

okay on this, i have a %var setup to store the channels i want it active on. can i use this %var in the event string?

on 1:op:%chanlist:{ code } like this???

and i also know i need to use the $read(text.txt, w ) command to search the file and ismatch $address(nick,5) to
match it from beyond that i'm not sure how to put it all together and with what??

would i need to use gettok? would some one be able to give a example on how this would be done... OH, also i have the data inputed as nick : manually inputed adress.
the : being the delimiter...
(hope i'm making sense)

any advice will be appreated
thanks in advance ! smile

Joined: Sep 2004
Posts: 8
R
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
R
Joined: Sep 2004
Posts: 8
Just trying to make sure I understand this:
Sounds like you are doing a preventative script that will stop channel operators from oping users as well as preventing what I like to call seem riders. This is usally used for a channel operations bot with strictop or bitch mode enabled. I would store the channels that you would like this run in as text file as well, but it can be done from a variable. I will try to do both below:

; OP Prevention (CHANNEL OPER MODE +O)
; Channels in Data file called BOT_CHANS.INI
; File format is just a list of channels
; #channel1
; #channel2
; #channel3
; ********************************
# BITCHMODE off
on 1:OP:* {
set %CHANTEST = $read(BOT_CHANS.INI, s, $chan)
if (%CHANTEST != $NULL) {

/* INSERT YOUR CODE TO DEOP HERE */

}
}
#BITCHMODE end

; OP Prevention (CHANNEL OPER MODE +O)
; Channels in VARIABLE called %BOT_CHANS
; Variable format is just a space delimited list of channels
; #channel1 #channel2 #channel3
; ********************************
# BITCHMODE off
on 1:OP:* {
if ($chan isin %BOT_CHAN) {

/* INSERT YOUR CODE TO DEOP HERE */

}
}

#BITCHMODE end

Remember to include server op as well. ON 1:SERVEROP:. The code should basically be the same. Give this a shot and if it doesn't work, feel free to email me, [email]skepcat@skepcat.com.[/email] Been a while since I noodled with mIRC bots.


Albert Ramnath
WinChat IIRC
http://routing.winchat.net
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Just an FYI, maybe you weren't intending to use mIRC-compatible comments, but /* comment */ will not work on a single line, those comments have to be like this:

/*
comment
*/


New username: hixxy
Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
thanks for the reply ramnaa, but here is where my problem lies.... i want to do a check on the opnicks address using mask type 5 against the mask i have in the txt file. The format is like this: bob42:bob!bob@bob42.users.undernet.org , but i need it to olny look at bob!bob@bob42.users.undernet.org to match with the opnicks mask.. then trigger the rest of the function code

so more or less that what i need help with....


Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
would this work?

on 1:OP:* {
if ($chan isin %aochan_list) {
set %aoaddress $address($nick,5)
set %aoread $read(dat\amanti-op.txt, w, * $+ %aoaddress)
if ($gettok(%aoread,0,32) != $null) { msg $chan $opnick Welcome Back! }
else { /mode $chan -o $opnick } { .notice $nick NICE TRY!!! }
unset %aoaddress
unset %aoread
}

okay i have the file amanit-op.txt with only full hostmasks thats $address mode 5 i believe.. anyways this is supposed to check on op the txt and it's a match msg the chan and if the opnicks hostmask isn't in the file it'll de-op and notcice the nick


Joined: Sep 2004
Posts: 8
R
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
R
Joined: Sep 2004
Posts: 8
Clutz,
I have been thinking about what you are trying to do. I clowned around a little this weekend with some ideas to simplify it. If you have a chance, email me at skepcat@skepcat.com or just jump on Dayton.oh.us.winchat.net and I will show you what I have been doing.

I spent some time working on your idea of using several variables and basic files for maintinance. This is ok, but I found it easier to use an INI style file that includes peices like
[CHANNELS]
#Channel1=no
#Channel2=yes
#Channel3=yes
#Channel4=yes
#Channel5=no
#Channel6=no
[OPCHANS]
NICK1=channel:level,channel2:level,channel3:level
NICK2=channel:level,channel2:level,channel3:level
NICK3=channel:level,channel2:level,channel3:level
[OPADDS]
NICK1=channel:level,channel2:level,channel3:level
NICK2=channel:level,channel2:level,channel3:level
NICK3=channel:level,channel2:level,channel3:level

By tokenizing the reply from the OPERATOR sections ([OPCHANS][OPADDS], you can grab the level and the channel for a nick. Your script used level 5. I have issues with this setting, because anyone who has a dynamic address can change from 1 to 8 tokens daily. For this reason, I use 8 to maintain the NICKNAME as well as a type 3 address. if you dont want to worry about NICKNAME, you can do the same thing using level 3 addressing and just the [email]user@host.[/email]

Just briefly, this is how I was using these files to get your operator status. Using gettoks and the $readini function, I scanned the ini file for a nickname. Before you start this, set a variable %OWNER to your nick. This is just to fix a message that is sent.

ON 1:OP:* {
set %operator $readini(botchans.ini,OPCHAN,$opnick)
set %OPADD $readini(botchans.ini,OPADDS,$opnick)
;
; SET THE ADDRESS KEY BASED ON NICKNAME
; The owner and the addresses are now stored
;
; Verify that the channel where the OP action has occured is being
; Actively scanned by the bot and make sure that user is an operator
; for the channel where the op action has occurred.
;
if (ON isin $readini(botchans.ini,CHANNELS, $chan) && $chan isin %operator) {
;
; If the nick is known as an operator, ensure that his address is
; known to the bot for verification. If it is, then leave oped and
; send greeting
;
echo 3 -a $address($opnick,8)
if ($address($opnick,8) isin %OPADD) {
notice $opnick Welcome Back $opnick!!!
}
else {
;
; If there is no verification, then deop the user and send
; notice to chanops and to user stating that the channel has
; a restricted op list.
;
mode $chan -o $opnick
notice $opnick This channel has a restricted operator list.
notice @ $+ $chan $opnick is not a recognized operator, please verify this with %OWNER
}
}
}
It should work as a good starting point, and you should be able to work from there.



Albert Ramnath
WinChat IIRC
http://routing.winchat.net

Link Copied to Clipboard