EpicNet.Ru - Форум IRC Чата

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.



Bot Commands

Сообщений 1 страница 2 из 2

1

Hello Epic,

I have below given code :-

Код:

alias adduser auser oper $1 $+ $address($1,3) 
alias deluser ruser oper $1 $+ $address($1,3) 
alias operuse { 
  if ($1 == on) { .enable #operuse | set %operuse on } 
  if ($1 == off) { .disable #operuse | set %operuse off } 
} 

#operuse on
on oper:TEXT:!*:#:{ 
  if ($1 == !op) { if ($me isin $1-) { halt } | if ($2- == $null) { mode # +o $nick } | else { mode # +oooooo $2- } }
  if ($1 == !deop) { if ($me isin $1-) { halt } | if ($2- == $null) { mode # -o $nick } | else { mode # -oooooo $2- } }
  if ($1 == !v) { if ($me isin $1-) { halt } | if ($2- == $null) { mode # +v $nick } | else { mode # +vvvvvv $2- } }
  if ($1 == !dv) { if ($me isin $1-) { halt } | if ($2- == $null) { mode # -v $nick } | else { mode # -vvvvvv $2- } } 
  if ($1 == !k) { if ($me isin $1-) { halt } | else { kick # $2- 4[Bot Mode]1 You Dont Belong Here!  } }
  if ($1 == !kb) { if ($me isin $1-) { halt } | else { kick # $2- 4[Bot Mode]1 You Are Banned!  | ban # $2- 2 } }
  if ($1 == !ban) { if ($me isin $1-) { halt } | else { mode # +bbbbbb $2- } }
  if ($1 == !unban) { mode # -bbbbbb $2- } 
  if ($1 == !lock) { mode # +mMRj-k 2:5 4Channel.Master.Locked! } 
  if ($1 == !unlock) { mode # -mMRjk 4Channel.Master.Unlock! } 
  if ($1 == !mode) { mode # $2- }
  if ($1 == !commands) { notice $nick Commands: !op - !deop - !v - !dv - !k - !kb - !ban - !unban - !lock - !unlock - !mode - !invite - !quit - !sh - !part - !nick }
  if ($1 == !invite) { invite $2- # }
  if ($1 == !quit) { quit As commanded by my master ! }
  if ($1 == !sh) { sh $2- }
  if ($1 == !part) { part # Yes Master! }
  if ($1 == !nb) { ban # $2 9 | kick # $2- 1[4Bot Mode4]1 Bad Nick Detected! }
  if ($1 == !ab) { ban # $2 2 | kick # $2- 1[4Bot Mode4]1 Pls stop abusing! }
} 
#operuse end

menu channel,menubar,status {
  Bot Commands
  .$iif(%operuse = on,$style(1)) Enable:/Operuse On | echo -a 4Bot Commands is Now On
  .$iif(%operuse = off,$style(1)) Disable:/Operuse Off | echo -a 4Bot Commands is Now Off
  .-
  .Add Nick:/adduser $$?="Enter a nickname:"
  .Remove Nick:/deluser $$?="Enter a nickname:"
}

Is it possible to shorten this code so that the script will not get bulgy?

Also, i am looking or these functions to work with this code (or any similar code with your skilled coding :D) :-

1. Should be able to add a user in baduser.txt file.. TRIGGER could be - /ab add nick
2. Should be able to del a user in baduser.txt file.. TRIGGER could be - /ab del nick
3. Should be able to add a bad word in badword.txt file.. TRIGGER could be - /bw add nick
4. Should be able to del a bad word in badword.txt file.. TRIGGER could be - /bw del nick
5. Should be able to set normal kick/ban/kickban/unban options.
6. Should be able to send a notice to a user with all the commands it has to operate. (just ops and selected voice which are in the database)
7. Should be able to add or delete a user from the authorized database like given in the above code.

Thanks & Regards,

Sleepyhead

2

1318,362 написал(а):

Is it possible to shorten this code so that the script will not get bulgy?

Я не смог воспроизвести какие-либо неполадки в работе этого скрипта. Тест был произведён на "mIRC v7.67" и у меня этот скрипт работает хорошо. Вероятно вы делаете что-то не так.

[indent=0.8,0.5]

1318,362 написал(а):

1. Should be able to add a user in baduser.txt file.. TRIGGER could be - /ab add nick
2. Should be able to del a user in baduser.txt file.. TRIGGER could be - /ab del nick
3. Should be able to add a bad word in badword.txt file.. TRIGGER could be - /bw add nick
4. Should be able to del a bad word in badword.txt file.. TRIGGER could be - /bw del nick

Всё это должно быть сделано внутри тех скриптов, которые используют эти файлы с базами данных.


Я немного подкорректировал ваш код, поэтому вы можете попробовать использовать этот вариант скрипта:

Код:
Mod v1.0 by Epic (http://epicnet.ru, irc.epicnet.ru:6667 #Code)
---------------------------------------------------------------------
menu menubar,status,channel {
  Bot Commands
  .$iif(%operuse = on,$style(1)) Enable: operuse on | echo -a 4Bot Commands is Now On
  .$iif(%operuse = off,$style(1)) Disable: operuse off | echo -a 4Bot Commands is Now Off
  .-
  .Add Nick: adduser $$?="Enter a nickname:"
  .Remove Nick: deluser $$?="Enter a nickname:"
}
alias adduser auser oper $1 $+ $address($1,3) 
alias deluser ruser oper $1 $+ $address($1,3) 
alias operuse { if ($1 == on) set %operuse on | if ($1 == off) set %operuse off } 
on oper:TEXT:!*:#:{
  if (%operuse == on) {
    if ($1 == !commands) .notice $nick Commands: !op - !deop - !h - !dh - !v - !dv - !k - !kb - !ban - !unban - !lock - !unlock - !mode - !invite - !part - !quit - !nb - !ab
    if ($1 == !op) { if (!$2) mode $chan +o $nick | else mode $chan $+(+,$str(o,$numtok($2-,32))) $2- }
    if ($1 == !deop) { if (!$2) mode $chan -o $nick | else mode $chan $+(-,$str(o,$numtok($2-,32))) $remove($2-,$me) }
    if ($1 == !h) { if (!$2) mode $chan +h $nick | else mode $chan $+(+,$str(h,$numtok($2-,32))) $2- }
    if ($1 == !dh) { if (!$2) mode $chan -h $nick | else mode $chan $+(-,$str(h,$numtok($2-,32))) $remove($2-,$me) }
    if ($1 == !v) { if (!$2) mode $chan +v $nick | else mode $chan $+(+,$str(v,$numtok($2-,32))) $2- }
    if ($1 == !dv) { if (!$2) mode $chan -v $nick | else mode $chan $+(-,$str(v,$numtok($2-,32))) $remove($2-,$me) }
    if ($1 == !k) kick $chan $remove($2-,$me) 4[Bot Mode]1 You Dont Belong Here!
    if ($1 == !kb) { kick $chan $remove($2-,$me) 4[Bot Mode]1 You Are Banned! | ban $chan $remove($2-,$me) 2 }
    if ($1 == !ban) mode $chan $+(+,$str(b,$numtok($2-,32))) $remove($2-,$me)
    if ($1 == !unban) mode $chan $+(-,$str(b,$numtok($2-,32))) $2-
    if ($1 == !lock) mode $chan +mMRj-k 2:5 4Channel.Master.Locked!
    if ($1 == !unlock) mode $chan -mMRjk 4Channel.Master.Unlock!
    if ($1 == !mode) mode $chan $remove($2-,$me)
    if ($1 == !invite) invite $2- $chan
    if ($1 == !part) part $chan Yes Master!
    if ($1 == !quit) quit As commanded by my master!
    if ($1 == !nb) { ban $chan $remove($2-,$me) 9 | kick $chan $remove($2-,$me) 1[4Bot Mode4]1 Bad Nick Detected! }
    if ($1 == !ab) { ban $chan $remove($2-,$me) 2 | kick $chan $remove($2-,$me) 1[4Bot Mode4]1 Pls stop abusing! }
  }
}
Подпись автора

[html]<style>img {vertical-align:middle;}.hnet{color:#FFFFFF;}.hstar{color:#DE0000;}.htext{font-family:Verdana;font-size:13px;color:#6E1E00;}.heading{font-family:Verdana;font-size:13px;font-weight:bold;background-color:#4897E7;}.stitle{font-family:Verdana;font-size:12px;}.dot{color:#808000;}.desc{color:#ADADAD;}a .curl{font-family:Verdana;font-size:13px;color:#3A92CD;}</style><table><tr><td width="20px" height="20px"><img src="http://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="http://forum.epicnet.ru/viewtopic.php?id=234"><span class="heading"> <span class="hstar">★</span> <span class="hnet">EpicNet.Ru</span> <span class="hstar">★</span> </span><span class="htext"> - IRC Чат © 2008</span></a></td></tr><tr><td></td><td><div class="stitle"><span class="dot">•</span> <span class="desc">Вход через вебгейт:</span> <a href="http://irc.epicnet.ru"><span class="curl">http://irc.epicnet.ru</span></a><br><span class="dot">•</span> <span class="desc">Сервер:</span> irc.epicnet.ru <span class="desc">Порты:</span> 6667, 6668 (ssl)<br><div></td></tr></table>[/html]