mIRC Homepage
Posted By: confuzzed Ok i need help again - 13/07/05 03:26 AM
Ok well i dont know what exactly i did wrong but the only feature that works is the kick feature but it kicks me other then the nick i type so if you could please help me figure this out i would appreciate it.
Thanks
Code:
on 1:TEXT:!kick*:#: {
  if ($nick isop $chan) {
  kick $chan $nick 
}
on 1:TEXT:!ban*:#: {
  if ($nick isop $chan) {
  mode $chan +b $nick 
}
on 1:TEXT:!unban*:#: {
  if ($nick isop $chan) {
  mode $chan -b $nick
}
on 1:TEXT:!ban24*:#: {
  if ($nick isop $chan) {
  ban $chan $nick 2 Banned for $duration($duration(24 hrs)
  kick $chan $nick 
}
on 1:TEXT:!voice*:#: {
  if ($nick isop $chan) {
  mode $chan +v $nick
}
on 1:TEXT:!devoice*:#: {
  if ($nick isop $chan) {
  mode $chan -v $nick
}
on 1:TEXT:!op*:#: {
  if ($nick isop $chan) {
  mode $chan +o $nick 
}
on 1:TEXT:!deop*:#: {
  if ($nick isop $chan) {
  mode $chan -o $nick
}
Posted By: bwr30060 Re: Ok i need help again - 13/07/05 03:38 AM
use $knick to refer to the nick you want to kick, otherwise, $nick refers to your nick.
Posted By: arctangent Re: Ok i need help again - 13/07/05 04:13 AM
no no no...

i assume u wanna type sumthin like: !kick <sum-lamer-here> <kick-msg-here>

you should use $2...
as in
Code:
 
on *:text:!kick*:#:{
  if ($nick isop #) &amp;&amp; ($2 ison #) &amp;&amp; ($me isop #) {
  kick # $2 $3-
 }
}
 


in the ON TEXT event, $1- holds the whole line
in this case: !kick MyEnemy you're lame!
$1 = !kick
$2 = MyEnemy
$3- = you're lame!

get it now? smile

and to the other guy: $knick only returns sumthin on the ON KICK event, it return the nick of person who was just kicked.

edit: explained stuff
Posted By: confuzzed Re: Ok i need help again - 13/07/05 04:27 AM
i think i understand ill go mess with it some and come back tell you how it dose
Thanks
Posted By: DaveC Re: Ok i need help again - 13/07/05 04:34 AM
Quote:
Code:
 
on *:text:!kick*:#:{
  if ($nick isop #) &amp;&amp; ($2 ison #) &amp;&amp; ($me isop #) {
  kick # $2 $3-
 }
}


Am i missing some greater purpose here? becuase if the nick making the call has op's cant they just kick the user anyway?
Posted By: arctangent Re: Ok i need help again - 13/07/05 04:47 AM
lol, gez he just wants ta be flashy? grin
Posted By: confuzzed Re: Ok i need help again - 13/07/05 08:23 AM
No im not trying to be flashy in any way if you would see my first post it will be doing more then kicking and sometimes i use java (i know i know but if its handy why not?) so it will be usefull and i have a op or two who dont know how to use the comands so this will help them as it dose all the work for them. Now as for the script its self i got it all worked out and im useing it like so
Code:
on *:TEXT:!ban*:#: {
  if ($nick isop #) &amp;&amp; ($2 ison #) {
   mode $chan +b $2
 }
}


and so on, Thanks again fo all the help it is appreciated smile
Posted By: xDaeMoN Re: Ok i need help again - 13/07/05 08:38 AM
You also have to make sure that the bot is an OP too

Code:
on @*:TEXT:!ban*:#: {

  if ($nick isop #) &amp;&amp; ($2 ison #) {

   mode $chan +b $2

 }

}  


The "@" checks if the bot is an op then the script continues.
Posted By: confuzzed Re: Ok i need help again - 13/07/05 08:50 AM
Thanks for the tip the bot will always be an op so im not to worried about it i will indeed keep that in minds now i do have one more question. Will this work for a 24hr ban

Code:
on *:TEXT:!ban24*:#: {
  if ($nick isop #) &amp;&amp; ($2 ison #) {
   ban -k $chan $2 2 Banned for $duration($duration(24 hrs)
  }
}


or should i do it this way?

Code:
on *:TEXT:!ban24*:#: {
  if ($nick isop #) &amp;&amp; ($2 ison #) {
   mode $chan +b $2 Banned for $duration($duration(24hrs)
  }
}


Thanks
Posted By: Riamus2 Re: Ok i need help again - 13/07/05 03:26 PM
First of all, you're missing ending )'s there... but that won't work anyhow.

You need to use -u to set a timed ban. /help /ban

Example:
/ban -u600 chan nick

This would ban for 600seconds (5 minutes). You use the same idea when using -k. Note that I'd just end the kick reason with "banned for 24 hours" rather than even messing with $duration... there's no reason to use $duration for this.
Posted By: confuzzed Re: Ok i need help again - 13/07/05 08:59 PM
ok so it would be
Code:
on *:TEXT:!ban24*:#: {
  if ($nick isop #) &amp;&amp; ($2 ison #) {
    mode $chan +b -u86400
  }
}
Posted By: xDaeMoN Re: Ok i need help again - 13/07/05 09:05 PM
You should use /ban

Code:
 on @*:TEXT:!ban24*:#: {
  if ($nick isop #) &amp;&amp; ($2 ison #) {
    ban -ku86400 $chan $2 2 Your Message Here
  }
} 
Posted By: confuzzed Re: Ok i need help again - 15/07/05 12:30 AM
Ok i need some more help the 24hr ban thing dosnt work for some reason and also i was wondering how i would write a line to op someone with a certin ip. Thanks again
Posted By: confuzzed Re: Ok i need help again - 15/07/05 05:17 AM
bump
Posted By: RusselB Re: Ok i need help again - 15/07/05 07:02 AM
If all of the conditions of xDaeMoN's script are matched, then it will work. The conditions, in order of occurance in the script are:
A) the bot or person running the script must be opped
B) the command must be sent in the channel/room
C) the person issuing the command must be opped
C) the person named in the !ban24 command must be in the room.

As to opping someone with a certain IP, if the network has chanserv, review the information about AOP and SOP lists.
/msg chanserv help AOP
/msg chanserv help SOP

If you don't have chanserv, then you can use mIRC's AOP capabilities
/help /aop
© mIRC Discussion Forums