Professional Protect bot.

Do you have script in mind but no ability to make it, type in what it should do, and you might be lucky.

Re: Professional Protect bot.

Postby Dandy » Fri Jul 03, 2009 8:17 pm

iif is correct
Dandy
 

Re: Professional Protect bot.

Postby zNigel- » Fri Jul 03, 2009 8:22 pm

i3s wrote:
Sumsar wrote:yeah, nice error log, it seems that the author forgot some close parentheses.

I closed the parentheses, and it should work properly now.



Nah, it doesn't. :x


Code: Select all
* Loaded script 'C:\Program Files\mIRC\protect.mrc'
Done.
(21:55:29)  -› Unknown command (users.ini)


I'm getting this error when i'm doing /addgowner nick.
*****************************************************************
EDIT:
Seems like everything is working now, found an little misstake in line 144

Code: Select all
    ban -r $chan $2 $iif(*!*

"iif" ^^

but theres ONE problem now........ $protect on/off doesnt work, nothing happends when i'm doing this and it doesnt protect the channel, no settings.ini created etc.. Hope you can find the problem :F


It's supposed to be "iif"
zNigel-
 

Re: Professional Protect bot.

Postby i3s » Fri Jul 03, 2009 8:31 pm

ohhh, ok!
i got this

Code: Select all
´* Invalid format: $iif (line 144, r-own.nbs)
-


mybad then :D
just protect that doesnt work then
i3s
 

Re: Professional Protect bot.

Postby capurro » Sat Jul 04, 2009 12:31 pm

$invite
$kick
dont work :cry:
capurro
 

Re: Professional Protect bot.

Postby zNigel- » Sat Jul 04, 2009 12:46 pm

capurro wrote:$invite
$kick
dont work :cry:



Ofc it doesnt work.. Read the list of commands..

;;$adduser op/master/owner
;;$deluser
;;$op
;;$voice
;;$deop
;;$devoice
;;$ban
;;$unban
;;$protect on
zNigel-
 

Re: Professional Protect bot.

Postby capurro » Sat Jul 04, 2009 12:50 pm

heheheh sorry XD
capurro
 

Re: Professional Protect bot.

Postby Cristian » Sun Jul 05, 2009 10:19 am

i3s wrote:
Sumsar wrote:yeah, nice error log, it seems that the author forgot some close parentheses.

I closed the parentheses, and it should work properly now.



Nah, it doesn't. :x


Code: Select all
* Loaded script 'C:\Program Files\mIRC\protect.mrc'
Done.
(21:55:29)  -› Unknown command (users.ini)


I'm getting this error when i'm doing /addgowner nick.
*****************************************************************
EDIT:
Seems like everything is working now, found an little misstake in line 144

Code: Select all
    ban -r $chan $2 $iif(*!*

"iif" ^^

but theres ONE problem now........ $protect on/off doesnt work, nothing happends when i'm doing this and it doesnt protect the channel, no settings.ini created etc.. Hope you can find the problem :F



I looked through the script, and found the error.
it seemed like the /protect command is already taken by mirc itself, so I changed it to /chanprotect.


Code: Select all
;;$adduser op/master/owner
;;$deluser
;;$op
;;$voice
;;$deop
;;$devoice
;;$ban
;;$unban
;;$protect on

alias access {
  !return $readini(users.ini,$1,$address($2,1))
}

alias chanlev {
  !return $readini(users.ini,$1,$address($2,1))
}

alias userlev {
  !return $readini(users.ini,global,$address($1,1))
}

alias chanprotect {
  !return $readini(settings.ini,$1,protect)
}

alias addgowner {
  writeini users.ini global $address($1,1) owner
  echo Done.
}


on *:TEXT:$adduser*:#: {
  if ($istok(owner,$access($chan,$nick),32)) || ($istok(owner master,$userlev($nick),32)) {
    if (!$2) { notice $nick Syntax: $1 <nick/ident> <level> - where <level> can be: owner, master, op, voice, banned. | halt }
    if ($2 !ison $chan) { notice $nick The requested user ( $+ $2 $+ ) is not on the current channel. ( $+ $chan $+ ) | halt }
    if ($readini(users.ini,$chan,$address($2,1))) { notice $nick The requested user is already known on the current channel, with level: $v1 - use $!deluser to remove him/her. | halt }
    if (!$istok(owner master op voice banned,$3,32)) { notice $nick Invalid level, levels are: owner, master, op, voice, banned. | halt }
    writeini users.ini $chan $address($2,1) $3
    if ($istok(owner master op,$3,32)) { mode $chan +o $2 }
    elseif ($istok(voice,$3,32)) { mode $chan +v $2 }
    elseif ($istok(banned,$3,32)) { ban -k $chan $2 $iif(*!*@*.quakenet.org iswm $address($2,2),2,1) You are BANNED from this channel, order by: $nick, on: $date at: $time $+ . | writeini bans.ini $chan $address($2,$iif(*!*@*.quakenet.org iswm $address($2,2),2,1)) You are BANNED from this channel, order by: $nick, on: $date at: $time $+ . }
    notice $nick Done.
  }
}

on *:TEXT:$deluser*:#: {
  if ($istok(owner,$access($chan,$nick),32)) || ($istok(owner master,$userlev($nick),32)) {
    if ($2 !ison $chan) { notice $nick The requested user ( $+ $2 $+ ) is not on the current channel. ( $+ $chan $+ ) | halt }
    if (!$readini(users.ini,$chan,$address($2,1))) { notice $nick The requested user ( $+ $2 $+ ) is not known on the current channel ( $+ $chan $+ ) | halt }
    if ($2 isop $chan) { mode $chan -o $2 }
    elseif ($2 isvoice $chan) { mode $chan -v $2 }
    remini users.ini $chan $address($2,1)
    notice $nick Done.
  }
}

on *:TEXT:$op*:#: {
  if ($istok(owner,$access($chan,$nick),32)) || ($istok(owner master,$userlev($nick),32)) {
    if (!$2) { mode $chan +o $nick | notice $nick Done. | halt }
    if ($2 ison $chan) { mode $chan +o $2 | notice $nick Done. | halt }
    if (* isin $2) {
      var %x = $nick($chan,0)
      while (%x) {
        var %q = $nick($chan,%x)
        if ($2 iswm %q) { var %d = $addtok(%d,$v2,32) }
        dec %x
      }
      mode $chan + $+ $str(o,$numtok($gettok(%d,1-4,32),32))
      var %d = $deltok(%d,1-4,32)
    }
  }
}

on *:TEXT:$deop*:#: {
  if ($istok(owner,$access($chan,$nick),32)) || ($istok(owner master,$userlev($nick),32)) {
    if (!$2) { mode $chan -o $nick | notice $nick Done. | halt }
    if ($2 ison $chan) { mode $chan -o $2 | notice $nick Done. | halt }
    if (* isin $2) {
      var %x = $nick($chan,0)
      while (%x) {
        var %q = $nick($chan,%x)
        if ($2 iswm %q) { var %d = $addtok(%d,$v2,32) }
        dec %x
      }
      mode $chan - $+ $str(o,$numtok($gettok(%d,1-4,32),32))
      var %d = $deltok(%d,1-4,32)
    }
  }
}

on *:TEXT:$voice*:#: {
  if ($istok(owner,$access($chan,$nick),32)) || ($istok(owner master,$userlev($nick),32)) {
    if (!$2) { mode $chan +v $nick | notice $nick Done. | halt }
    if ($2 ison $chan) && ($access($chan,$nick) != voice) { mode $chan +v $2 | notice $nick Done. | halt }
    if (* isin $2) && ($access($chan,$nick) != voice) {
      var %x = $nick($chan,0)
      while (%x) {
        var %q = $nick($chan,%x)
        if ($2 iswm %q) { var %d = $addtok(%d,$v2,32) }
        dec %x
      }
      mode $chan + $+ $str(v,$numtok($gettok(%d,1-4,32),32))
      var %d = $deltok(%d,1-4,32)
    }
  }
}

on *:TEXT:$devoice*:#: {
  if ($istok(owner,$access($chan,$nick),32)) || ($istok(owner master,$userlev($nick),32)) {
    if (!$2) { mode $chan -v $nick | notice $nick Done. | halt }
    if ($2 ison $chan) && ($access($chan,$nick) != voice) { mode $chan -v $2 | notice $nick Done. | halt }
    if (* isin $2) && ($access($chan,$nick) != voice) {
      var %x = $nick($chan,0)
      while (%x) {
        var %q = $nick($chan,%x)
        if ($2 iswm %q) { var %d = $addtok(%d,$v2,32) }
        dec %x
      }
      mode $chan - $+ $str(v,$numtok($gettok(%d,1-4,32),32))
      var %d = $deltok(%d,1-4,32)
    }
  }
}

on *:TEXT:$ban*:#: {
  if ($istok(owner,$access($chan,$nick),32)) || ($istok(owner master,$userlev($nick),32)) {
    if (!$2) { notice $nick $1 <user> <reason> | halt }
    if ($2 == $me) { notice $nick I will not ban myself. | halt }
    if ($2 == $nick) { notice $nick I will not ban you. | halt }
    ban -k $chan $2 $iif(*!*@*.quakenet.org iswm $address($2,2),2,1) You are BANNED from this channel, order by: $nick, on: $date at: $time $+ .
    writeini bans.ini $chan $address($2,$iif(*!*@*.quakenet.org iswm $address($2,2),2,1)) You are BANNED from this channel, order by: $nick, on: $date at: $time $+ .
  }
}

on *:TEXT:$unban*:#: {
  if ($istok(owner,$access($chan,$nick),32)) || ($istok(owner master,$userlev($nick),32)) {
    if (!$2) { notice $nick $1 <user>/<all> | halt }
    if ($2 == all) {
      mode $chan +b-b *!*@* *!*@*
      remini bans.ini $chan
      notice $nick Done.
    }
    ban -r $chan $2 $iif(*!*@*.quakenet.org iswm $address($2,2),2,1)
  }
}

on *:TEXT:$version:#: {
  var %x = $rand(1,2)
  if (%x == 1) { msg $chan I am protect v0.2 by Phil (SilverRain) }
  elseif (%x == 2) { describe $chan is protect v0.2 by Phil (SilverRain) }
}

on *:TEXT:$protect*:#: {
  if ($istok(owner,$access($chan,$nick),32)) || ($istok(owner master,$userlev($nick),32)) {
    if (!$2) { notice $nick Syntax: $1 <on/off/status> | halt }
    if ($2 == on) {
      writeini settings.ini $chan protect on
      notice $nick Done.
    }
    if ($2 == off) {
      writeini settings.ini $chan protect off
      notice $nick Done.
    }
    if ($2 == status) {
      notice $nick Protection is currently: $iif($readini(settings.ini,$chan,protect),$readini(settings.ini,$chan,protect),off)
    }
  }
}
on @!*:OP:#: {
  msg $chan Access $access($chan,$nick) - Userlev $userlev($nick)

  if ($chr(46) isin $nick) || $len($nick) == 1) { return }
  if ($istok(owner master op,$access($chan,$nick),32)) || ($istok(owner master op voice,$userlev($nick),32)) || ($chanprotect($chan) != on) { halt }
  mode $chan -oo $nick $opnick
  /msg Q chanlev $chan $nick -ao
  writeini bans.ini $chan $address($nick,1) You are not allowed to OP anyone on $chan - violation on: $date at $time
  ban -k $chan $nick 1 You are not allowed to OP anyone on $chan - violation on: $date at $time  - by %homechan
}


on @!*:DEOP:#: {
  if ($nick == $me) {
    msg Q op $chan
  }
  if ($nick == Q) || ($istok(owner master op,$access($chan,$nick),32)) || ($istok(owner master op voice,$userlev($nick),32)) || ($chanprotect($chan) != on) { halt }
  mode $chan -o+o $nick $opnick
  writeini bans.ini $chan $address($nick,1) You are not allowed to DEOP anyone on $chan - violation on: $date at $time
  /msg Q chanlev $chan $nick -ao
  ban -k $chan $nick 1 You are not allowed to DEOP anyone on $chan - violation on: $date at $time
}



on @!*:KICK:#: {
  if ($nick == Q) || ($istok(owner master op,$access($chan,$nick),32)) || ($istok(owner master op voice,$userlev($nick),32)) || ($chanprotect($chan) != on) { halt }
  mode $chan -ov $nick $nick
  /msg Q chanlev $chan $nick -ao
  writeini bans.ini $chan $address($nick,1) You are not allowed to KICK anyone on $chan - violation on: $date at $time
  ban -k $chan $nick 1 You are not allowed to KICK anyone on $chan - violation on: $date at $time
}



on @!*:BAN:#: {
  if ($nick == Q) || ($istok(owner master op,$access($chan,$nick),32)) || ($istok(owner master op voice,$userlev($nick),32)) || ($chanprotect($chan) != on) { halt }
  mode $chan -o+b-b $nick $address($nick,1) $banmask
  /msg Q chanlev $chan $nick -ao
  kick $chan $nick You are not allowed to BAN anyone on $chan - violation on: $date at: $time
  writeini bans.ini $chan $address($nick,1) You are not allowed to BAN anyone on $chan - violation on: $date at $time
}


on @!*:UNBAN:#: {
  if ($nick == $me) { halt }
  if ($nick == Q) || ($istok(owner master op,$access($chan,$nick),32)) || ($istok(owner master op voice,$userlev($nick),32)) || ($chanprotect($chan) != on) { halt }
  mode $chan -o+b+b $nick $address($nick,1) $banmask
  kick $chan $nick You are not allowed to BAN anyone on $chan - violation on: $date at: $time
  /msg Q chanlev $chan $nick -ao
  writeini bans.ini $chan $address($nick,1) You are not allowed to BAN anyone on $chan - violation on: $date at $time
}


on @!*:TOPIC:#: {
  if ($nick == Q) || ($istok(owner master op,$access($chan,$nick),32)) || ($istok(owner master op voice,$userlev($nick),32)) || ($chanprotect($chan) != on) { writeini settings.ini $chan topic $chan($chan).topic | notice $nick Topic Saved. | halt }
  mode $chan -o+b $nick $address($nick,1)
  kick $chan $nick You are not allowed to CHANGE TOPIC on $chan - violation on: $date at $time
  /msg Q chanlev $chan $nick -ao
  writeini bans.ini $chan $address($nick,1) You are not allowed to CHANGE TOPIC on $chan - violation on: $date at $time
  topic $chan $readini(settings.ini,topic,$chan)
}
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Professional Protect bot.

Postby i3s » Tue Jul 07, 2009 2:22 am

nice sumsar, but still one problem ;)
it doesnt protect..


I'm getting a notice with "Done." but when someone deop/kicks the bot it doesnt deop/kick the one who deoped the bot :roll:

thx for still helping me! :)


Edit: Work's fine if someone kick/deop's other ppl in the channel.
Last edited by i3s on Tue Jul 07, 2009 6:10 am, edited 1 time in total.
i3s
 

Re: Professional Protect bot.

Postby fraguk » Tue Jul 07, 2009 2:45 am

Any errors in the bots status window ..?
fraguk
 

Re: Professional Protect bot.

Postby PuNkTuReD » Sat Jul 11, 2009 12:17 pm

i still think giving
http://www.sassirc.com/view.php?snippet=39
a try is well worth it.

if you set him up right, he is good functioning bot.
PuNkTuReD
 

PreviousNext

Return to Mirc Scripting Request

Who is online

Users browsing this forum: No registered users and 0 guests

cron