Simple kick ban or warn script

By slub77 on Sep 03, 2009

This is just a small snipped allowing people with op to do actions that allow to kick a user ban them or simply warn them.

Also a help command to explain how to do it to other ops. replace {s) with the what you wantalso change to your bots name just to make it simpler for the person reading it :)

on @:TEXT:Kick*&:?:/kick $2- 
on @:TEXT:Ban*&:?:/ban $2-
on @:TEXT:warn*&:?:/notice $2-  :Warning sent from $nick On $asctime(hh:nn:ss) 

on @:TEXT:(s)help op:*:/msg $nick As op you can kick and ban soldier can do that for you simply type | /msg $nick /msg <BOTNAME> <action> <#channel> <nick> <reason> | /msg $nick With the warn application you need to type | /msg $nick /msg <BOTNAME> warn <nick> <reason> This will warn them and if they carry on you can kick them

Comments

Sign in to comment.
slub77   -  Jan 09, 2010

@jethro_ i have edited my help snippet now anyways, stored it in an ini file allowing multiple help much quicker

on *:TEXT:*:*:{
  if $1 == Shelp {
    if $readini(help.ini, help, $2) {
      notice $nick  $2 : $readini(help.ini, help, $2)
    notice $nick For more help go to http://www.soldercom.tk }
    else { notice $nick No commands have been saved with that name sorry }
  }
  else { halt }
}

menu * {
  Help with actions
  .Add Word:{
    var %word $?="Enter the actions name"
    var %help $?="Enter the help for that word"

    writeini help.ini Help %word %help
  }
  .Del word:{
    var %word $?="Enter the actions name"

    if !$readini(help.ini, help, %word) { Echo No words have Been  saved with %word }
    else {
      echo $?!=" %word Has been fount Def: $readini(help.ini, help, %word) : Are you Sure you want to delete? "
      if $! = $true {
        remini help.ini help %word
      echo %word has been removed }
      else { echo %word was not removed }

    }
  }
  .$iif($file(help.ini).size <= 8,$style(2)) Word infomation:{
    var %word $?="Enter the actions name"

    if !$readini(help.ini, help, %word) { Echo No words have Been  saved with %word }
    else { Echo %word Has been fount Def: $readini(help.ini, help, %word) }

  }

}

see alot more simple.

And since i make a new help for each action i make it was kind of making my remotes page look bleak and annoying, having to add an

if $1--3 == word { action }

each time got boring so i made it easier on my self :)

 Respond  
slub77   -  Sep 05, 2009

hmm u see the way i got it worked at is soldier will ignore if someone trys to kick a op because i have a code some where that makes him ignore certain commands and since soldier (bot) adds ops as level 99 (second best best being owner) its ok so yea others may want to edit, but the good thing is i aint gona make u ask for permission or wut not so yea go ahed and play around with it :)

 Respond  
Jethro   -  Sep 05, 2009

Slub77, you don't need one text event for each procedure. Combine them with if-then-else statement or use goto loops. I'm not trying to put down your script, but what if you have 100 procedures to trigger, are you going to make 100 of them?

 Respond  
slub77   -  Sep 05, 2009

Hey guys just saw this so i better fill you in:

My bot has about 100 help lines for each diffrent set of levels for users

i have 4 users sets so that is about 400 not including extra for certain users.

I know the file would shourtan the code it self but i have many many pages fo code so it all good and i find it easy to change quicker as i have a code that let's me add what ever to my remotes ;)

 Respond  
D-Mag   -  Sep 04, 2009

Yea the thing is i hve about 200 help lines so for me it is best to keep them as one line in stead of multiple lol.

I know we see 4 but he said he has about 200 help lines. XD

 Respond  
sunslayer   -  Sep 03, 2009

he doesnt have 200 lines of help, only 4

 Respond  
D-Mag   -  Sep 03, 2009

Well I'm just saying that if he has 200 lines of help, he could read from a file. And he wouldn't need the code to write the text to a file if he knows how to make and where to save the file so it can be read. He would only need the code to write the text to a file IF he wanted others to use this script. But also i guess the person that does get this script could do it :P

 Respond  
Jethro   -  Sep 03, 2009

Storing info in a text file actually shrinks the size of your hard drive, as it gets bigger and bigger over time with more info added. While it may shorten your remote script size, that's not usually the case.

 Respond  
sunslayer   -  Sep 03, 2009

i don't see how that would make it smaller, if anything it would actually make it larger because you would need to add code to write the text to the file and to read from it

 Respond  
D-Mag   -  Sep 03, 2009

You could also read from a file to shorten it. You could name it like kbhelp.txt

 Respond  
slub77   -  Sep 03, 2009

Yea the thing is i hve about 200 help lines so for me it is best to keep them as one line in stead of multiple lol.

Thanks for the comment and tips :)

 Respond  
sunslayer   -  Sep 03, 2009

you can remove the /'s from the begining of the command part of the event

also it makes the code much easier to read when its a long line if you use { and }

ex:

on @:TEXT:(s)help op:*: {
  msg $nick As op you can kick and ban soldier can do that for you simply type 
  msg $nick /msg <BOTNAME> <action> <#channel> <nick> <reason>
  msg $nick With the warn application you need to type
  msg $nick /msg <BOTNAME> warn <nick> <reason> This will warn them and if they carry on you can kick them
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.