Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:join:#: {
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == owner) {
- mode $chan +qo $nick $nick $nick
- }
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == admin) {
- mode $chan +ao $nick $nick $nick
- }
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == op) {
- mode $chan +ov $nick $nick
- }
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == helper) {
- mode $chan +hv $nick $nick
- }
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == voice) {
- mode $chan +v $nick
- }
- }
- on *:part:#: {
- if ($read($+($chan,loggedin.txt), w, $nick $+ *) == $nick) {
- write -ds $+ $nick loggedin.txt
- .notice $nick $+(<,$nick,>) Logged out.
- }
- }
- on 1:quit: {
- var %com = $comchan($nick,0)
- while (%com) {
- if ($read($+($chan(%com),loggedin.txt), w, $nick $+ *) == $nick) {
- write -ds $+ $nick $+($chan(%com),loggedin.txt)
- dec %com
- }
- else {
- dec %com
- }
- }
- }
- on *:nick: {
- var %com = $comchan($nick,0)
- while (%com) {
- if ($read($+($chan(%com),loggedin.txt), w, $nick $+ *) == $nick) {
- write -ds $+ $nick $+($chan(%com),loggedin.txt)
- .notice $newnick $+(<,$nick,>) Logged out.
- dec %com
- }
- else {
- dec %com
- }
- }
- }
- on *:text:*:*: {
- if ($target == $chan) { var %targ = $target }
- if ($target == $me) { var %targ = $nick }
- ;
- ; Login Procedure
- if (!login == $strip($1)) {
- if ($address($nick,2) != $gettok($readini(login.ini,users,$nick),1,32)) {
- .msg %targ $+(<,$nick,>) You do not have user access to this bot. You can request an account by typing !request username password
- halt
- }
- if ($address($nick,2) == $gettok($readini(users.ini,botmaster,$nick),2,32)) {
- if (!$3) {
- .msg %targ Incorrect login procedure: Please proceed by typing !login username password
- }
- if ($3) {
- if ($2 == $gettok($readini(login.ini,users,$nick),2,32)) {
- if ($3 == $gettok($readini(login.ini,users,$nick),3,32)) {
- if ($read(loggedin.txt, w, $nick $+ *) == $nick) {
- .msg %targ $+(<,$nick,>) You are already Logged in.
- }
- else {
- .msg %targ $+(<,$nick,>) Logged in.
- write loggedin.txt $nick
- }
- }
- elseif ($3 != $gettok($readini(login.ini,users,$nick),3,32)) {
- .msg %targ Your password did not match.
- }
- }
- elseif ($2 != $gettok($readini(login.ini,users,$nick),2,32)) {
- .msg %targ Your username did not match.
- }
- }
- }
- else {
- if (!$4) {
- .msg %targ Incorrect login procedure: Please proceed by typing !login username password channel
- }
- if ($4) {
- if ($2 == $gettok($readini(login.ini,users,$nick),2,32)) {
- if ($3 == $gettok($readini(login.ini,users,$nick),3,32)) {
- if ($read(loggedin.txt, w, $nick $+ *) == $nick) {
- .msg %targ $+(<,$nick,>) You are already Logged in.
- }
- else {
- .msg %targ $+(<,$nick,>) Logged in.
- write loggedin.txt $nick
- }
- }
- elseif ($3 != $gettok($readini(login.ini,users,$nick),3,32)) {
- .msg %targ Your password did not match.
- }
- }
- elseif ($2 != $gettok($readini(login.ini,users,$nick),2,32)) {
- .msg %targ Your username did not match.
- }
- }
- }
- }
- ;
- ; Logout Procedure
- if (!logout == $strip($1)) {
- if ($read(loggedin.txt, w, $nick $+ *) == $nick) {
- if (!$2) {
- .msg %targ Please specify a channel to log out of.
- }
- else {
- write -ds $+ $nick $+($2,loggedin.txt)
- .msg %targ $+(<,$nick,>) Logged out.
- }
- }
- else {
- .msg %targ You are either "not logged in" or did not specify a channel to log out of.
- }
- }
- ;
- ; Request user access Procedure ( These users get recognised as Regular Users )
- if (!request == $strip($1)) {
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Owner) {
- if (list == $strip($2)) {
- if ($lines(requests.txt) == 0) {
- .msg %targ There are no requests pending.
- }
- else {
- var %rt = $lines(requests.txt)
- while (%rt) {
- .msg %targ %rt $+ : $read(requests.txt, %rt)
- dec %rt
- }
- }
- }
- if (total == $strip($2)) {
- .msg %targ There are a total of $lines(requests.txt) requests.
- }
- if (approve == $strip($2)) {
- if ($lines(requests.txt) == 0) {
- .msg %targ There are no requests pending.
- }
- else {
- writeini login.ini users $gettok($read(requests.txt,2,$3),1,32) $gettok($read(requests.txt,2,$3),2,32) $gettok($read(requests.txt,2,$3),3,32) $gettok($read(requests.txt,2,$3),4,32)
- write -ds $+ $3 $+ * requests.txt
- if ($3 ison $chan) {
- .notice $3 You now have "Channel Regular" level access to me, login by typing: !login $gettok($readini(login.ini,users,$nick),2,32) $gettok($readini(login.ini,users,$nick),3,32)
- .notice $nick Added $3 with "Channel Regular" level access.
- }
- else {
- haltdef
- }
- }
- }
- }
- else {
- if (!$3) {
- .msg %targ Request Regular User Access: !request username password
- }
- else {
- write requests.txt $nick $address($nick,2) $2 $3
- .msg %targ Your request has been sent.
- }
- }
- }
- ;
- ; Commands for logged in users
- if ($read(loggedin.txt, w, $nick $+ *) == $nick) {
- ;
- ; Bot Master Commands
- if ($address($nick,2) == $gettok($readini(users.ini,botmaster,$nick),2,32)) {
- if ($strip($1) == !adduser) {
- if (!$6) {
- .msg %targ Incorrect Syntax. Please Type: !adduser #channel nick level username password
- .msg %targ level can be any of the following: owner - admin - op - helper - voice
- }
- else {
- writeini users.ini $2 $3 $address($3,2) $4
- writeini login.ini users $3 $5 $6
- .notice $3 You now have $+(",$4,") level access to me, login by typing: !login $5 $6
- .notice $nick Added $3 with $+(",$4,") level access.
- }
- }
- if ($strip($1) == !deluser) {
- if (!$3) || (!$2) {
- .msg %targ Incorrect Syntax. Please Type: !deluser #channel nick
- }
- else {
- remini users.ini $2 $3
- remini login.ini users $3
- .notice $nick $3 has been removed from my database.
- }
- }
- ;
- ; Add Bot Master Commands Here
- }
- ;
- ; Channel Owner Commands
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Owner) {
- ;
- ; Add Channel Owner Commands Here
- }
- ;
- ; Channel Admin Commands
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Admin) {
- ;
- ; Add Channel Admin Commands Here
- }
- ;
- ; Channel Op Commands
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Op) {
- ;
- ; Add Channel Op Commands Here
- }
- ;
- ; Channel Helper Commands
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Helper) {
- ;
- ; Add Channel Helper Commands Here
- }
- ;
- ; Channel Voice Commands
- if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Voice) {
- ;
- ; Add Channel Voice Commands Here
- }
- ;
- ; Add Regular User Commands Here ( All other users with higher access may use these commands too. )
- }
- ;
- ; Add Other Public User Commands Here ( All other users with higher access may use these commands too. )
- }
- alias botmaster {
- writeini users.ini botmaster $1 $1 $address($1,2)
- writeini login.ini users $1 $address($1,2) $1 $2
- .notice $1 Username: $1 Password: $2
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement