|
Joined: Oct 2005
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Oct 2005
Posts: 10 |
ok, im doing a bot with various things, and i need to have a !assasinate nick command for fun so it will be like !assasinate Test Bot orders hitmen to assasinate Test (action) Bot: Test have been killed where the first bot line should be random thx in advance
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Here is just one way to do it... First, make a text file called assassinate.txt and include all the action text that you want to randomly use. Anywhere you want the nick to appear in the text, place #nick# , anywhere for the channel to appear, place #chan# . Example in text file: orders hitmen to assassinate #nick#. hides in #chan# until #nick# walks past and then assassinates him from behind. Next, include this script:
on *:text:!assassinate *:#: {
if ($2 ison $chan) {
describe $chan $replace($read(assassinate.txt,nt),#nick#,$2,#chan#,$chan)
msg $chan $2 has been killed.
}
else describe $chan searches for $2 in $chan, but cannot find him.
}
Last edited by Riamus2; 06/10/05 01:58 PM.
|
|
|
|
Joined: Oct 2005
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Oct 2005
Posts: 10 |
ok, works fine:)
just to be problematic:P
how to make exceptions?
like
Test: !assassinate Glibber Bot takes bribe from Glibber and kills Test
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
just add a describe function example
on *:text:!assassinate *:#: {
if ($2 ison $chan) {
describe $chan $replace($read(assassinate.txt,nt),#nick#,$2,#chan#,$chan)
msg $chan $2 has been killed.
}
[color:red]elseif ($2 == Glibber) {
describe $chan takes bribe from glibber and assisinates $nick
}[/color]
else describe $chan searches for $2 in $chan, but cannot find him.
}
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Um... No. *EDIT* Well, hm... maybe I read too much into that. If you just want it so that you can't be assassinated yourself, then do as said above (though, change the first if to say if ($2 ison $chan && $2 != Glibber) {). If you want anyone to be able to bribe the bot, then you can do this:
on *:text:!assassinate *:#: {
if ($2 ison $chan) {
.timer $+ $+(assassinate.,$2) 1 10 assassinate $chan $2
describes $chan goes in search of $2 $+ ...
}
else describe $chan searches for $2 in $chan, but cannot find him.
}
on *:text:!bribe *:#: {
if ($timer($+(assassinate.,$nick) != $null) {
.timer $+ $+(assassinate.,$nick) off
describe was bribed to assassinate $2 instead and goes off in search of $2 $+ .
.timer $+ $+(assassinate.,$2) 1 10 assassinate $chan $2
}
else msg $chan You're not targeted for assassination.
}
alias assassinate {
describe $1 $replace($read(assassinate.txt,nt),#nick#,$2,#chan#,$1)
msg $1 $2 has been killed.
}
Ok... bribing generally would require money or something else. I've not included any such thing. You can !bribe as much as you want to. Example: <nick1> !Assassinate nick2 * Bot goes in search of nick2 <nick2> !Bribe nick1 * Bot was bribed to assassinate nick1 instead and goes off in search of nick1 <nick1> !Bribe nick3 * Bot was bribed to assassinate nick3 instead and goes off in search of nick3 * Bot sent hitmen to assassinate nick3. <Bot> nick3 has been killed. There are probably nicer ways to make this work so you aren't just constantly bribing, but since I don't know what else you want, I'll leave it at this. Just a note... currently, you have 10 seconds to bribe before being killed.
Last edited by Riamus2; 06/10/05 02:45 PM.
|
|
|
|
Joined: Oct 2005
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Oct 2005
Posts: 10 |
i was more thinking if you shouldn't have to type !bribe
just that some nicks cant be !assassinate
so some would be secure without typing !bribe
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Yeah, I realized after that you probably meant it that way. You can do like was mentioned by Lpfix5, though with the change I mentioned above. However, here's a rewrite that is a better way to do it so it works with many nicks that you want to be safe.
on *:text:!assassinate *:#: {
if ($2 !ison $chan) {
describe $chan searches for $2 in $chan, but cannot find him.
}
elseif (!$istok($me [color:red]Glibber Nick2 Nick3[/color],$2,32)) {
describe $chan $replace($read(assassinate.txt,nt),#nick#,$2,#chan#,$chan)
msg $chan $2 has been killed.
}
elseif ($2 == $me) {
describe $chan refuses to assassinate himself, so chooses to assassinate $nick instead.
msg $chan $nick has been killed.
}
else {
describe $chan takes bribe from $2 and assassinates $nick $+ .
msg $chan $nick has been killed.
}
}
Just replace the red with the nick(s) you want to have "safe" from assassination. I added in a special comment when trying to assassinate the bot.
Last edited by Riamus2; 06/10/05 02:58 PM.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Oct 2005
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Oct 2005
Posts: 10 |
atm i have this code:
on *:text:!kill *:#: {
if ($2 !ison $chan) {
describe $chan searches for $2 in $chan, sneaks up behind $2 and
msg $chan $2 is found dead
}
elseif (!$istok($me Glibber Glibber|AKnB Glibbie Glibby,$2,32)) {
describe $chan $replace($read(assassinate.txt,nt),#nick#,$2,#chan#,$chan)
msg $chan $2 has been killed.
}
elseif ($2 == $me) {
describe $chan refuses to assassinate himself, so chooses to assassinate $nick instead.
msg $chan $nick has been killed.
}
else {
describe $chan takes bribe from $2 and assassinates $nick $+ .
msg $chan $nick has been killed.
}
}
the problem is that it is not working if i type !kill Test and there is a user called Test in the chan
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
I wish I could test this right now... What happens when you try that? You should get some response ... even if it's the wrong one. Try other nicks (including yours, the bot's, and nicks that aren't in the channel). See what you get as results (and post them here). Also, make sure you don't have some other on *:text:!kill *:#:{ script in that same file or it won't work.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
|