mIRC Home    About    Download    Register    News    Help

Print Thread
Simple script help #150612 06/06/06 05:01 AM
Joined: May 2006
Posts: 87
S
Sableye2 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
Okay so here's what I want to do. Whenever someone types in "!kill <nick>" I want the bot in which the script is hosted on to say a message such as "<nick> has been killed."

For example:
!kill Random
Random has been killed.

Here's what I have so far:

on *:text:*!kill*:#: {
if ($1 == %c $+ !kill) {
.action $chan $nick has been killed.
}
}

What else do I need to add/edit for this to work?

Re: Simple script help #150613 06/06/06 07:12 AM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Code:
on *:text:*!kill*:#: { 
  ;
  ; Why was %C in this if comparison?
  ;
  if ($1 == !kill) { 
    ;
    ; Do you want to do something like kick or ban the person?
    ; if so, add those commands here
    ;
    .action $chan $nick has been killed.
  } 
}


NaquadaBomb
www.mirc-dll.com
Re: Simple script help #150614 06/06/06 07:44 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
re %C , because it is?
Must be some global hes got to activate or disbale the command ie:
set %c $cr | ; disabled event
unset %c | ; enabled event

anyway, the problem was his ACTION command, it should be DESCRIBE to make an action! (man that makes heaps of sence)

Code:
on *:text:*!kill*:#: { 
  if ($1 == %c $+ !kill) { 
    [color:blue]describe $chan $nick has been killed.[/color]
  } 
}

Re: Simple script help #150615 06/06/06 07:58 AM
Joined: Feb 2004
Posts: 206
D
Darwin_Koala Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
I know this may look simplistic but .....

Code:
  
on *:text:!kill *:#: .describe $chan $2 has been killed
 


(not tested).

of course "* !kill *" could work if you wanted the "!kill" to appear anywhere on the line.

Cheers,

DK


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
Re: Simple script help #150616 06/06/06 03:42 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
he is using the %c somehow, I suspect as part of a challenge in a channel game.
using $() in the match text area will allow the code to be smaller as you have it

on *:text:!kill *:#: .describe $chan $2 has been killed

on *:text:$(%c $+ !kill *):#: .describe $chan $$2 has been killed

the second line allows the %c to be part of the matchtext without the if statement
I would guess the channel should be specified but that might not matter
the $$2 prevents it from fireing if someone typed the %c!kill without the nick to kill

Re: Simple script help #150617 06/06/06 06:15 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Since were all looking for code size reduction now

on *:text:$(%c $+ !kill *):#: .describe $chan $2 has been killed

Since the <space>* must be matched there must be a $2 so $$2 is unneeded. :-)

Re: Simple script help #150618 06/06/06 09:41 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
:tongue:

Re: Simple script help #150619 07/06/06 12:17 AM
Joined: May 2006
Posts: 87
S
Sableye2 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
Thanks guys, I got it to work.