mIRC Home    About    Download    Register    News    Help

Print Thread
#53999 12/10/03 07:26 PM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
I am working on a script that replies to a friends scripts automatically. I am working with the following script:

on *:ACTION:*:#:{
if (*flamethrower* iswm $1- || *barbeques* iswm $1- || *Gar* iswn $1- || *Gararion* $1-) {
describe # sprinkles the hotest mixture of ingredents known to mankind on his arm before Bahran gets a chance to grab it and sits back to watch the show.
}
}

What is is reply to is:

* Bahran takes out a flamethrower and barbeques gar then takes a piece of their crispy arm and chews on it...

It works yes but if he does this script to someone else it replies as well. For examples if he does:

* Bahran takes out a flamethrower and barbeques himself then takes a piece of their crispy arm and chews on it...

it replies as well, which is useless cause the my script is only meant to happen when he does it to me. What would I need to change to make it only reply when he does it to me?

#54000 12/10/03 08:00 PM
M
mancontr
mancontr
M
This should work:
Code:
on *:ACTION:*:#:{
if ($(takes out a flamethrower and barbeques $me then takes a piece of their crispy arm and chews on it...) == $1-) {
describe # sprinkles the hotest mixture of ingredents known to mankind on his arm before $nick gets a chance to grab it and sits back to watch the show.
}
}

#54001 12/10/03 08:06 PM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
so I would have to put the entire saying in, there is now way of shortening it?

#54002 12/10/03 08:11 PM
M
mancontr
mancontr
M
Yes, you can... something like:
Code:
on *:ACTION:*:#:{
if ($4 == flamethrower) && ($6 == barbeques) && ($7 == $me) {
describe # sprinkles the hotest mixture of ingredents known to mankind on his arm before $nick gets a chance to grab it and sits back to watch the show.
}
}


or if you want... just add to your code the "($7 == $me)" smile

#54003 12/10/03 08:28 PM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
okay I tried that one but I got this message in my status window:

* /if: 'iswn' unknown operator (line 113, script.ini)

What does that mean?

#54004 12/10/03 08:42 PM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
nvm figured it out smile

One more question, the script:
on *:ACTION:*:#:{
if ($4 == flamethrower) && ($6 == barbeques) && ($7 == Gar) {
describe # sprinkles the hotest mixture of ingredents known to mankind on his arm before $nick gets a chance to grab it and sits back to watch the show.
}
}


is there a way to do add a or line in the if line? for example:

if ($4 == flamethrower) && ($6 == barbeques) && ($7 == Gar) or ($8 == flamethrower) && ($9 == barbeques) && ($10 == Gararion){
describe # sprinkles the hotest mixture of ingredents known to mankind on his arm before $nick gets a chance to grab it and sits back to watch the show.
}
}

#54005 12/10/03 09:13 PM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
is there a way of edited the scipt:

on *:ACTION:*#:{
if ($4 == flamethrower) && ($6 == barbeques) && ($7 == Gar) {
describe # sprinkles the hotest mixture of ingredents known to mankind on his arm before $nick gets a chance to grab it and sits back to watch the show.
}
}

so it would have do multiple things like this:

on *:ACTION:*:#:{
if ($4 == flamethrower) && ($6 == barbeques) && ($7 == Gar) { describe # sprinkles the hotest mixture of ingredents known to mankind on his arm before $nick gets a chance to grab it and sits back to watch the show. }
elseif ($4 == annihilates) && ($6 == barrage) && ($7 == Gar) { describe # -=[counter coming soon]=- }
elseif ($4 == smashes) && ($6 == revenge) && ($7 == Gar) { describe # smiles at the thought of the look on Bahran's face when he notices the insane asylum is located on a now deserted island surronded by shark infested waters, offering no form of escape. }
}

#54006 12/10/03 09:15 PM
P
pheonix
pheonix
P
that works..(or should do)

#54007 12/10/03 09:40 PM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
it didn't, only the first one did. the others wouldn't work. I will try again.

Also "describe" does the /me, what does /say?

#54008 12/10/03 09:58 PM
P
pheonix
pheonix
P
/describe = /me
/ame = /me to all channels
/say = /msg
/amsg = /say to all channels

#54009 12/10/03 10:09 PM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
So in(part of script I am workign with):

{ describe # -=[counter coming soon]=- }

which should do: /me -=[counter coming soon]=-

I could just edit it like:

{ say # -=[counter coming soon]=- }

to make it do this in the proper channel: <Gar> -=[counter coming soon]=-

Last edited by Gar; 12/10/03 10:11 PM.
#54010 12/10/03 10:10 PM
P
pheonix
pheonix
P
/say or /msg #

#54011 12/10/03 10:11 PM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
okay

#54012 12/10/03 10:22 PM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
so this should work then:

on *:ACTION:*#:{
if ($4 == flamethrower) && ($6 == barbeques) && ($7 == Gar) {
msg # sprinkles the hotest mixture of ingredents known to mankind on his arm before $nick gets a chance to grab it and sits back to watch the show.
}
}

or do I need to put the "/" before the "msg #"?

The original code was on
*:ACTION:*#:{
if ($4 == flamethrower) && ($6 == barbeques) && ($7 == Gar) {
describe # sprinkles the hotest mixture of ingredents known to mankind on his arm before $nick gets a chance to grab it and sits back to watch the show.
}
}

#54013 12/10/03 10:26 PM
P
pheonix
pheonix
P
you only need / if your typing it in the edit box, so msg # will be fine.

#54014 13/10/03 12:10 AM
Joined: Sep 2003
Posts: 120
G
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Sep 2003
Posts: 120
okay why wont this script work?

on *:ACTION:*:#:{
if ($4 == flamethrower) && ($6 == barbeques) && ($7 == Gar) { describe # sprinkles the hotest mixture of ingredents known to mankind on his arm before $nick gets a chance to grab it and sits back to watch the show. }
elseif ($4 == howitzers) && ($6 == Paladin) && ($7 == Gar) { msg # -=[counter coming soon]=- }
elseif ($4 == smashes) && ($6 == revenge) && ($7 == Gar) { describe # smiles at the thought of the look on Bahran's face when he notices the insane asylum is located on a now deserted island surronded by shark infested waters, offering no form of escape. }
}


the first one works, the if, but none of the elseif works. frown

#54015 13/10/03 08:04 AM
P
pheonix
pheonix
P
the elseif's will only be executed if the (condition) is $true, but also only if the condition of the if (..) was $false

#54016 13/10/03 10:28 AM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
I copied your code into my remote, tested it and it works fine.

I tested it by sending the following three lines to the channel:

/describe #channel one two three flamethrower five barbeques Gar
/describe #channel one two three howitzers five Paladin Gar
/describe #channel one two three smashes five revenge Gar

channel output:

[12:28] * HCBT one two three flamethrower five barbeques Gar
[12:28] * @[Bot]of[Borg] sprinkles the hotest mixture of ingredents known to mankind on his arm before HCBT gets a chance to grab it and sits back to watch the show.
[12:29] * HCBT one two three howitzers five Paladin Gar
[12:29] <@[Bot]of[Borg]> -=[counter coming soon]=-
[12:29] * HCBT one two three smashes five revenge Gar
[12:29] * @[Bot]of[Borg] smiles at the thought of the look on Bahran's face when he notices the insane asylum is located on a now deserted island surronded by shark infested waters, offering no form of escape.

If the code doesn't work for you, there's another problem, it has nothin to do with the code you pasted here.

#54017 13/10/03 01:15 PM
M
mancontr
mancontr
M
Try grouping with ()... something like:

Code:
on *:ACTION:*:#:{
if (($4 == flamethrower) &amp;&amp; ($6 == barbeques) &amp;&amp; ($7 == Gar)) { 
describe # sprinkles the hotest mixture of ingredents known to mankind on his arm before $nick gets a chance to grab it and sits back to watch the show.
}
elseif (($4 == howitzers) &amp;&amp; ($6 == Paladin) &amp;&amp; ($7 == Gar)) {
msg # -=[counter coming soon]=-
}
elseif (($4 == smashes) &amp;&amp; ($6 == revenge) &amp;&amp; ($7 == Gar)) {
describe # smiles at the thought of the look on Bahran's face when he notices the insane asylum is located on a now deserted island surronded by shark infested waters, offering no form of escape.
}
}


That's because in multiple if's, the "else" only executes if last comparation is false... then, if you group all in one, should work... i supose wink (sorry for my english)

Edit: you can replace "Gar" with $me... and if you start with:
if ($7 != $me) { return }
then you can delete the ($7 == $me) of every if... smirk

Last edited by mancontr; 13/10/03 01:19 PM.

Link Copied to Clipboard