quick question about ini files - 26/12/02 09:34 PM
Im tryin to code a quick auto-op feature into MessageBot. This is how users are added into it:
/msg messagebot aop #channel add nickname
and it writes it to an ini file lookin like this:
[#pointblank]
801018178463=EviL_SmUrF
Code for how it adds it is:
Now my question is is it possible to check to see if the nickname is in the ini list under the specified channel on join?
like:
i know thats horribly wrong but i just wrote somethin resembling what im hoping can be done.
Any help is greatly appreciated thanks!
[[Moderator's note: I merely added [[/b]code] and [[b]/code] tags where appropriate to show his indentation and make his post more readable. -Hammer]]
/msg messagebot aop #channel add nickname
and it writes it to an ini file lookin like this:
[#pointblank]
801018178463=EviL_SmUrF
Code for how it adds it is:
Code:
if ($1 == aop) { set %regnickreplace1 $replace($4,[,$) set %regnickreplace2 $replace(%regnickreplace1,],$) set %chanreplace1 $replace($2,[,$) set %chanreplace2 $replace(%chanreplace1,],$) if ($nick == %ownernick) { goto 62 } set %checkregnick $read(rootadminlist.db, w, $nick) if (%checkregnick == $nick) { goto 62 } else { set %checkregnick $read(adminlist.db, w, $nick) if (%checkregnick == $nick) { if (%aopadmin == 0) { .notice $nick You are not authorized to use this command. halt } goto 62 } else { .notice $nick You are not authorized to use this command. halt } } :62 set %hostchk $gettok($hget(nicks,$nick),2,32) if (%hostchk != $fulladdress) { .notice $nick You are not authorized to use this command. halt } if ($2 == $null) { .notice $nick Syntax: /msg $me aop [channel] [add/del/list] [nickname/entry number]. .notice $nick For more help on maintaining the Auto-Op list, use /msg $me help aop. halt } if ($3 == $null) { .notice $nick Syntax: /msg $me aop [channel] [add/del/list] [nickname/entry number]. .notice $nick For more help on maintaining the Auto-Op list, use /msg $me help aop. halt } if ($3 == add) { set %checkregnick $read(registerlist.db, w, $4) if (%checkregnick == $null) { .notice $nick The nickname $4 is not registered. halt } if ($4 == $null) { .notice $nick Syntax: /msg $me aop [channel] [add/del/list] [nickname/entry number]. .notice $nick For more help on maintaining the Auto-Op list, use /msg $me help aop. halt } .notice $nick The nickname $4 has been added to the Auto-Op list of $2 $+ . write log.txt ( $+ $adate $+ )( $+ $time $+ ) ###ADMIN COMMAND### $nick added $4 to the auto-op list of $2 $+ . set %randnum $rand(0,9999999999999) writeini chanaoplist.db %chanreplace2 %randnum %regnickreplace2 write chanlist.db $4 halt } }
Now my question is is it possible to check to see if the nickname is in the ini list under the specified channel on join?
like:
Code:
on join:#: { if ($nick == $ini(chanaoplist.db, $nick, 0) mode $chan +o $nick }
i know thats horribly wrong but i just wrote somethin resembling what im hoping can be done.
Any help is greatly appreciated thanks!
[[Moderator's note: I merely added [[/b]code] and [[b]/code] tags where appropriate to show his indentation and make his post more readable. -Hammer]]