Botscript / !warn nick reason

Release your script here.
State:
- Author
- What it does
- Perhaps a little guide.
- Also, if the snippet is of any use to the community, it has a chance of getting posted on the main page, so don't hesitate to submit/ask!

Botscript / !warn nick reason

Postby Cristian » Mon Mar 10, 2008 4:06 pm

Code: Select all
;# 
;# visit http://sp00fed.org for updates or support.
;# script by Sumsar
;#

;# Trigger: !warn <nick> [Reason]

;# You must be operator on the channel.
;# There is set changeable default reasons, if you dont set one youself, reasons can be changes below.
;# There is no commando to remove a user from the database.

;# Tested and works on version 6.15


alias -l ::database { return warn }
alias -l ::file { return warn.hsh }

;# Warning 1
alias -l ::warn1 { return You did something wrong, stop it, before you get banned. }

;# Warning 2
alias -l ::warn2 { return You did something wrong, stop it, banned for 5 minuts. }
alias -l ::ban2 { return 300 }

;# Warning 3
alias -l ::warn3 { return You did something wrong, stop it, last chance, banned for 30 minuts. }
alias -l ::ban3 { return 1800 }

;# Warning 4
alias -l ::warn4 { return You have been permanently banned from this channel. }

;# Script

on *@:TEXT:!warn *:#: {
  if ($2 ison $chan) {
    if (!$hget($::database)) { if ($exists($::file)) { .hmake $::database 1000 | .hload $::database $::file } }
    if ($nick isop $chan) {
      var %n = $2,%h = $address($2,1),%r = $3-
      if (!$hget($::database,$+(incr.,$chan,.,%h))) { .hadd -m $::database $+(incr.,$chan,.,%h) 1 } | else { .hinc -m $::database $+(incr.,$chan,.,%h) 1 }
      if ($hget($::database,$+(incr.,$chan,.,%h)) == 1) {
        .msg %n $iif($3-,$ifmatch,$::warn1)
      }
      elseif ($hget($::database,$+(incr.,$chan,.,%h)) == 2) {
        .ban $+(-ku,$::ban2) $chan %n 1 $iif($3-,$ifmatch,$::warn2)
      }
      elseif ($hget($::database,$+(incr.,$chan,.,%h)) == 3) {
        .ban $+(-ku,$::ban3) $chan %n 1 $iif($3-,$ifmatch,$::warn3)
      }
      elseif ($hget($::database,$+(incr.,$chan,.,%h)) == 4) {
        .ban -k $chan %n 1 $iif($3-,$ifmatch,$::warn4)
        .hadd -m $::database $+(banned.,$chan,.,%h) $iif($3-,$ifmatch,$::warn4)
        .hdel $::database $+(incr.,$chan,.,%h)
      }
      .hsave -o $::database $::file
    }
  }
}
on *!@:JOIN:#: {
  if (!$hget($::database)) { if ($exists($::file)) { .hmake $::database 1000 | .hload $::database $::file } }
  if ($hget($::database,$+(banned.,$chan,.,$address($nick,1)))) { .ban -k $chan $nick 1 $hget($::database,$+(banned.,$chan,.,$address($nick,1))) }
}


warn.rar
(841 Bytes) Downloaded 410 times
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Botscript / !warn nick reason

Postby zNigel- » Mon May 19, 2008 11:44 pm

Sumsar wrote:
Code: Select all
;# 
;# visit http://forum.sp00fed.dk for updates or support.
;# script by Sumsar
;#

;# Trigger: !warn <nick> [Reason]

;# You must be operator on the channel.
;# There is set changeable default reasons, if you dont set one youself, reasons can be changes below.
;# There is no commando to remove a user from the database.




alias -l ::database { return warn }
alias -l ::file { return warn.hsh }

;# Warning 1
alias -l ::warn1 { return You did something wrong, stop it, before you get banned. }

;# Warning 2
alias -l ::warn2 { return You did something wrong, stop it, banned for 5 [b]minutes[/b]. }
alias -l ::ban2 { return 300 }

;# Warning 3
alias -l ::warn3 { return You did something wrong, stop it, last chance, banned for 30 [b]minutes[/b]. }
alias -l ::ban3 { return 1800 }

;# Warning 4
alias -l ::warn4 { return You have been permanently banned from this channel. }

;# Script

on *@:TEXT:!warn *:#: {
  if ($2 ison $chan) {
    if (!$hget($::database)) { if ($exists($::file)) { .hmake $::database 1000 | .hload $::database $::file } }
    if ($nick isop $chan) {
      var %n = $2,%h = $address($2,1),%r = $3-
      if (!$hget($::database,$+(incr.,$chan,.,%h))) { .hadd -m $::database $+(incr.,$chan,.,%h) 1 } | else { .hinc -m $::database $+(incr.,$chan,.,%h) 1 }
      if ($hget($::database,$+(incr.,$chan,.,%h)) == 1) {
        .msg %n $iif($3-,$ifmatch,$::warn1)
      }
      elseif ($hget($::database,$+(incr.,$chan,.,%h)) == 2) {
        .ban $+(-ku,$::ban2) $chan %n 1 $iif($3-,$ifmatch,$::warn2)
      }
      elseif ($hget($::database,$+(incr.,$chan,.,%h)) == 3) {
        .ban $+(-ku,$::ban3) $chan %n 1 $iif($3-,$ifmatch,$::warn3)
      }
      elseif ($hget($::database,$+(incr.,$chan,.,%h)) == 4) {
        .ban -k $chan %n 1 $iif($3-,$ifmatch,$::warn4)
        .hadd -m $::database $+(banned.,$chan,.,%h) $iif($3-,$ifmatch,$::warn4)
        .hdel $::database $+(incr.,$chan,.,%h)
      }
      .hsave -o $::database $::file
    }
  }
}
on *!@:JOIN:#: {
  if (!$hget($::database)) { if ($exists($::file)) { .hmake $::database 1000 | .hload $::database $::file } }
  if ($hget($::database,$+(banned.,$chan,.,$address($nick,1)))) { .ban -k $chan $nick 1 $hget($::database,$+(banned.,$chan,.,$address($nick,1))) }
}





As you see the "big" lines.. did the spell correction on it :)
zNigel-
 

Re: Botscript / !warn nick reason

Postby Fedtmule » Thu May 29, 2008 5:28 pm

How to install it - nothing happens when i wrote !warn user reason
Fedtmule
 

Re: Botscript / !warn nick reason

Postby vodkaplayer » Fri May 30, 2008 6:45 am

copy the whole code in a txt file
save the file as warn.mrc in your mIRC directory
and then type this cmd in the mIRC you want to load the script :)

//load -rs warn.mrc
vodkaplayer
 

Re: Botscript / !warn nick reason

Postby Fedtmule » Mon Jun 02, 2008 11:40 am

vodkaplayer wrote:copy the whole code in a txt file
save the file as warn.mrc in your mIRC directory
and then type this cmd in the mIRC you want to load the script :)

//load -rs warn.mrc


Nothing happens att all when i type !warning Fedtmule testing
Fedtmule
 

Re: Botscript / !warn nick reason

Postby Lukemob » Mon Jun 02, 2008 12:43 pm

Ok, let's get sure about this:

1. Are you sure you're an op, and Fedtmule is on the channel you're typing the command?
2. Are you sure, you've loaded it in a bot's client?
3. When you press ALT+R in a bot's client, you should see warn.mrc, right?
4. If you don't see it (from the STEP 3), try to click on a View table and see, if warn.mrc is loaded. If not, you have loaded it wrongly ;-)

tHx
Lukemob
 

Re: Botscript / !warn nick reason

Postby Fedtmule » Mon Jun 02, 2008 7:29 pm

Lukemob wrote:Ok, let's get sure about this:

1. Are you sure you're an op, and Fedtmule is on the channel you're typing the command?
2. Are you sure, you've loaded it in a bot's client?
3. When you press ALT+R in a bot's client, you should see warn.mrc, right?
4. If you don't see it (from the STEP 3), try to click on a View table and see, if warn.mrc is loaded. If not, you have loaded it wrongly ;-)

tHx


1: I own the Channel and Yes the users is online
2: Yes it is
3: Correct
4: everything is loaded but nothing happens
Fedtmule
 

Re: Botscript / !warn nick reason

Postby Cristian » Mon Jun 02, 2008 7:34 pm

strange, I tried it a few minutes ago, in a standard mirc client, and it worked.
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Botscript / !warn nick reason

Postby Lukemob » Mon Jun 02, 2008 7:39 pm

Well, if you can, we would appreciate a log (the best would be screen with a log) where you're typing the !warn command. Maybe it would help us...

tHx
Lukemob
 

Re: Botscript / !warn nick reason

Postby Fedtmule » Tue Jun 03, 2008 9:30 am

Lukemob wrote:Well, if you can, we would appreciate a log (the best would be screen with a log) where you're typing the !warn command. Maybe it would help us...

tHx


Log off what ? nothing happens and and therefore no log.
Fedtmule
 

Next

Return to Mirc Scripting Release

Who is online

Users browsing this forum: No registered users and 0 guests

cron