mIRC Homepage
Posted By: hCK Snippet Request: !mp commands - 25/12/08 10:07 AM
Example:

Code:
<Tammy> !mp
-TammyBot- You have 900 mps left.
<Tammy> !ban LowToys 100 Flooder/Trashtalker
* TammyBot sets mode: +b LowToys!*@*
* LowToys was kicked by TammyBot (Flooder/Trashtalker)
-TammyBot- LowToys is banned in #LowToys. You have 800 mps left.
<Tammy> !mp
-TammyBot- You have 800 mps left.
Posted By: 5618 Re: Snippet Request: !mp commands - 25/12/08 10:12 AM
You'll have to clarify it a bit.
As it is now, it looks like those "mps" are used up when you ban someone, like ban credit. However, the person doing the banning defines how many points (s)he'll use up at the same time, which seems unlikely.

What exactly is the function of these "mps"?
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 10:24 AM
Originally Posted By: 5618
You'll have to clarify it a bit.
As it is now, it looks like those "mps" are used up when you ban someone, like ban credit. However, the person doing the banning defines how many points (s)he'll use up at the same time, which seems unlikely.

What exactly is the function of these "mps"?


hmmm,,, yes, if you ban someone your mps will decrease, then i nid also !refresh if you dont have "mps" you cannot ban someone or kick someone.

Like this:

Code:
 
<Tammy> !ban LowToys 900 Hacker
* TammyBot sets mode: -ao Tammy
-TammyBot- You have 0 mps left. You cannot the !ban and !kick commands.
<Admin> !refresh Tammy
-TammyBot- Tammy have been refresh.
 


that's all i know frown i nid some help.
Posted By: VictriX Re: Snippet Request: !mp commands - 25/12/08 10:56 AM
i'll clarify what hCk was saying.

mps is like a token or credit.
when you ban people, the token will decrease depends on the minute.
lets say, hCk has 900 mps/tokens. and he will perform a ban in his channel.
like: !ban testnick 5 smyle.
then, the bot will decrease 5 in hCk's tokens.
it will become 895.

about the "!refresh" command.
only founder can do it.
and the function of it, is, it returns the person's token to the normal one, which is 900.
Posted By: 5618 Re: Snippet Request: !mp commands - 25/12/08 11:01 AM
How about this? (currently bans *!*@host)
[EDIT: fixed it so someone won't be able to ban one more time if time exceeds his credit; also fixes a missing bracket]

Please note that this code uses the format: !ban nick [reason] (reason being optional)
It does NOT allow the person who bans to define the amount of "mps" that is subtracted from his total. I do not see what use that would serve, since a person can keep banning with a value of zero (!ban nick 0 reason) and never lose banning privileges.
As it is a person gets 900 points and loses 100 for every ban.

On a side note:
- this won't keep people from getting their &/@/% back
- people can still ban via the IRCd (/mode #channel +b nick) unless you have that blocked
- banning nick!*@* is very very easy to evade. A person just has to change his nick to get back into the channel. Instead of "mode nick!*@*" I'd recommend "*!*@host"


Code:
on *:TEXT:!refresh *:#channel:{
  if (~ isin $nick($chan,$nick).pnick) && ($$2 ison $chan) {
    write -ls $+ $v1 mplist.txt $2 900
    mode $chan +o $2
  }
}
on @*:TEXT:!mp:#channel:{
  if ($read(mplist.txt,s,$nick) >= 0) { .notice $nick You have $v1 mps left. }
} 
on @*:TEXT:!ban *:#channel:{
  if ($$2 ison $chan) && ($$3 isnum) {
    if ($read(mplist.txt,s,$nick) >= $3) {
      ban -ku $+ $calc($3 *60) $2 2 $iif($4,$4-,banned)
      write -ls $+ $nick $nick $calc($v1 - $3)
      if (!$read(mplist.txt,s,$nick)) {
        mode $chan -aoh $nick $nick $nick
        notice $nick You have 0 mps left. You cannot use the !ban and !kick commands anymore.
      }
    }
    else { notice $nick Sorry, you are out of points }
  }
  else { notice $nick Sorry, the format is: !ban nick time reason }
}
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 11:14 AM
Originally Posted By: VictriX
i'll clarify what hCk was saying.

mps is like a token or credit.
when you ban people, the token will decrease depends on the minute.
lets say, hCk has 900 mps/tokens. and he will perform a ban in his channel.
like: !ban testnick 5 smyle.
then, the bot will decrease 5 in hCk's tokens.
it will become 895.

about the "!refresh" command.
only founder can do it.
and the function of it, is, it returns the person's token to the normal one, which is 900.


yah, thanks to you sir victrix,
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 11:20 AM
Originally Posted By: 5618
[Give me a few mins to change this post...]

I've tried to write you something.
Please note that this code uses the format: !ban nick [reason] (reason being optional)
It does NOT allow the person who bans to define the amount of "mps" that is subtracted from his total. I do not see what use that would serve, since a person can keep banning with a value of zero (!ban nick 0 reason) and never lose banning privileges.
As it is a person gets 900 points and loses 100 for every ban.

On a side note:
- this won't keep people from getting their &/@/% back
- people can still ban via the IRCd (/mode #channel +b nick) unless you have that blocked
- banning nick!*@* is very very easy to evade. A person just has to change his nick to get back into the channel. Instead of "mode $chan +b $2 $+ !*@*" I'd recommend "mode $chan +b $address($2,2)"


Code:
on *:TEXT:!refresh *:#channel:{
  if (~ isin $nick($chan,$nick).pnick) && ($$2 ison $chan) { write -ls $+ $v1 mplist.txt $2 900 }
}
on @*:TEXT:!mp:#channel:{
  if ($read(mplist.txt,s,$nick) { .notice $nick You have $v1 mps left. }
} 
on @*:TEXT:!ban *:#channel:{
  if ($$2 ison $chan) && ($read(mplist.txt,s,$nick)) {
    mode $chan +b $2 $+ !*@*
    kick $chan $2 $iif($3,$3-,banned)
    write -ls $+ $nick $nick $calc($v1 -100)
    if (!$read(mplist.txt,s,$nick)) {
      mode $chan -aoh $nick $nick $nick
      notice $nick You have 0 mps left. You cannot use the !ban and !kick commands anymore.
    }
  }
  else { notice $nick Sorry, you are out of points }
}


ahmmm sir, there is an error in !mp
* /if: invalid format (line 53, Kdnk Commands.ini)
i don't how to fixed it
but thanks for your fast reply.
Posted By: 5618 Re: Snippet Request: !mp commands - 25/12/08 11:26 AM
Was already working on it. See my edited post. ;P
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 11:29 AM
wer is it? smile because if newbie in making script T_T
Posted By: 5618 Re: Snippet Request: !mp commands - 25/12/08 11:31 AM
Scroll up or click this: https://forums.mirc.com/ubbthreads.php?ub...ew=1#Post207617
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 11:38 AM
smile sir i really confuse T_T
sorry im newbie.
Posted By: sparta Re: Snippet Request: !mp commands - 25/12/08 11:41 AM
tammy still abusing her users? lol, belived it was closed by now. :P
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 12:06 PM
* /ban: invalid parameters (line 7, Kdnk Commands.ini)
that's only the error sir..
but's its already working thanks for the script.
Posted By: 5618 Re: Snippet Request: !mp commands - 25/12/08 12:33 PM
Originally Posted By: hCK
* /ban: invalid parameters (line 7, Kdnk Commands.ini)
that's only the error sir..

Sorry, my fault. Change the code to...
Code:
on @*:TEXT:!ban *:#channel:{
  if ($$2 ison $chan) && ($$3 isnum) {
    if ($read(mplist.txt,s,$nick) >= $3) {
      ban -ku $+ $calc($3 *60) $chan $2 2 $iif($4,$4-,banned)
      write -ls $+ $nick $nick $calc($v1 - $3)
      if ($read(mplist.txt,s,$nick) == 0) {
        mode $chan -aoh $nick $nick $nick
        notice $nick You have 0 mps left. You cannot use the !ban and !kick commands anymore.
      }
    }
    else { notice $nick Sorry, you do not have enough points. }
  }
  else { notice $nick Sorry, the format is: !ban nick time reason }
}
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 12:42 PM
sir 5618 why is it when i ban the person for example

Code:
 
<&[TLU]MrKHmER> !chanban mrkhmer 10 test
* KdnkServ sets mode: +b *!*@CE1CCC52.8D258D3B.1CAB6F59.IP
* MrKHmER was kicked by KdnkServ (test)
-MrKHmER- You have 0 mps left. You cannot use the !ban and !kick commands anymore.


why is it 10 only but my mps is 900 its become to 0 again T_T
and when i check my !mp is not decreasing T_T.
Posted By: 5618 Re: Snippet Request: !mp commands - 25/12/08 01:11 PM
Ok, my apologies again. xD It seems like today is not a good day to write code since I keep making silly mistakes. Here is your working version:
Code:
on *:TEXT:!refresh *:#channel:{
  if (~ isin $nick($chan,$nick).pnick) && ($$2 ison $chan) {
    write -s $+ $v1 mplist.txt $v1 900
    mode $chan +o $2
  }
}
on @*:TEXT:!ban *:#mIRC:{
  if ($$2 ison $chan) && ($$3 isnum) {
    if ($read(mplist.txt,s,$nick) >= $3) {
      write -s $+ $nick mplist.txt $nick $calc($v1 - $3)
      ban -ku $+ $calc($3 *60) $chan $2 2 $iif($4,$4-,banned)
      if ($read(mplist.txt,s,$nick) == 0) {
        mode $chan -aoh $nick $nick $nick
        notice $nick You have 0 mps left. You cannot use the !ban and !kick commands anymore.
      }
    }
    else { notice $nick Sorry, you do not have enough points. }
  }
  else { notice $nick Sorry, the format is: !ban nick time reason }
}
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 01:18 PM
sir it's always
<&[TLU]MrKHmER> !ban MrKHmER 10 Flooder
-KdnkServ- Sorry, the format is: !ban nick time reason
Posted By: 5618 Re: Snippet Request: !mp commands - 25/12/08 01:21 PM
Then MrKHmER must not be in the channel?
Because it works on my side.
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 01:22 PM
its already working,
thanks sir
merry xmas
thank you so much
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 01:37 PM
sir last question.,,
why is it the nick will !refresh his/her own

Code:
 
on *:TEXT:!refresh*:#test:{
  if (~ isin $nick($chan,$nick).pnick) && ($$2 ison $chan) {
    $read(mplist.txt,s,$v1)
    write -l $+ $readn mplist.txt $v1 900
    mode $chan +ao $2
  }
}


the if (~ isin $nick($chan,$nick).pnick && ($$2 ison $chan) {
why is not the Admin can do the refresh
like this:

<&[TLU]MrKHmER> !chanban Kults 889 Hacker
* KdnkServ sets mode: +b *!*@CE1CCC52.8D258D3B.1CAB6F59.IP
* Kults was kicked by KdnkServ (Hacker)
* KdnkServ sets mode: -ao [TLU]MrKHmER [TLU]MrKHmER
* Retrieving #test modes...
* KdnkServ sets mode: -b *!*@CE1CCC52.8D258D3B.1CAB6F59.IP
<[TLU]MrKHmER> !mp
<[TLU]MrKHmER> !refresh
<~KdnkServ> !refresh [tlu]mrkhmer
<~KdnkServ> !refresh [tlu]mrkhmer
* KdnkServ sets mode: +q [TLU]MrKHmER
<~[TLU]MrKHmER> !refresh
<~[TLU]MrKHmER> !refresh [tlu]mrkhmer
* KdnkServ sets mode: +a [TLU]MrKHmER
* KdnkServ sets mode: -a [TLU]MrKHmER
* KdnkServ sets mode: +a [TLU]MrKHmER
* KdnkServ sets mode: -q [TLU]MrKHmER
<&[TLU]MrKHmER> !mp

i set first [TLU]Mrkhmer as a owner because i can't refresh him,
how to change if (~ isin $nick($chan

thanks sir
Posted By: 5618 Re: Snippet Request: !mp commands - 25/12/08 02:08 PM
Originally Posted By: VictriX
about the "!refresh" command.
only founder can do it.
and the function of it, is, it returns the person's token to the normal one, which is 900.

This is what I did. Only the channel founder (who has +q/~) can use the !refresh command on other people.

In your example:
- [TLU]MrKHmER can't use !refresh because he doesn't have +q
- KdnkServ can't use refresh because he's running the code (for KdnkServ to be able to use !refresh you need an on INPUT event)
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 02:11 PM
sir can i assign [TLU]MrKHmER can be the refresher, he is the only 1 can do the !refresh.

instead my bot will +q the person to !refresh.

thanks!
Posted By: 5618 Re: Snippet Request: !mp commands - 25/12/08 02:24 PM
In this example [TLU]MrKHmER has to be a channel op or higher and you have to replace *!*@host with whatever //echo -a $address([TLU]MrKHmER,2) returns.
If [TLU]MrKHmER has a dynamic IP address this can be troublesome. In that case you could use another ban mask. For example $address($nick,1) which matches *!*user@*.host
You can remove the ($nick isop $chan) check if you want him to be able to use the command at all times.
Code:
on *:TEXT:!refresh *:#channel:{
  if ($address($nick,2) == *!*@host) && ($nick isop $chan) && ($$2 ison $chan) {
    write -s $+ $v1 mplist.txt $v1 900
    mode $chan +oa $2 $2
  }
}


P.s. The code you have is old. Check my earlier post. wink
Posted By: hCK Re: Snippet Request: !mp commands - 25/12/08 02:29 PM
ok sir thanks.
© mIRC Discussion Forums