mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
in a certain way.

Like:

on *:ACTION:Give* StupBot * (cookie, coke, pepsi):#:{
if ($me == StupBot) {
/describe $chan $+(*,Takes $4-,*) Thanks!
}
}

That's what I got but it doesn't work.

If someone gives a Pepsi or a Coke I want StupBot to reply with "Thanks" but if someone gives StupBot for something else not in the list... he says, "No thanks".

So how would I do this?

Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
Right now I have this:

on *:ACTION:Give* StupBot * $5-:#:{
if ($me == StupBot) {
if ($5- == cookie*) /describe $chan $+(*,Takes $5-,*) Thanks for the $5-!
else if ($5- == Pepsi) /describe $chan $+(*,Takes $5-,*) Yum! A Pepsi!
else /msg $chan No thanks!
}
}

But it's not working at all.

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
maybe something like this
Code:
on *:ACTION:Gives *:#:{
if ($me == stupbot) {
  if ($4 == pepsi) { describe $chan $+(*,Takes $4-,*)  it brings good things to life! }
  elseif ($4 == coke) { describe $chan $+(*,Takes $4-,*) its the real thing baby! }
  elseif ($4 == cookie) { describe $chan $+(*,Takes $4-,*) SNARF! }
  else { describe $chan Sorry I don't like $+(*,$4-,*, $chr(44)) Thanks Anyway! }
}
}

Last edited by MikeChat; 24/03/06 07:46 PM.
Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
Thanks.

I got that to work this way:

on *:ACTION:Give* StupBot *:#:{
if ($me == StupBot) {
if ($4- == cookie*) { describe $chan $+(*,Takes $4-,*) SNARF! }
else if ($4- == pepsi) { describe $chan $+(*,Takes $4-,*) Thanks! }
else if ($4- == coke) { describe $chan $+(*,Takes $4-,*) I like Pepsi better... Unless it's Vanilla Coke! }
else /msg $chan No thanks!
}
}

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
looks like what you are trying to do is put the whole of the matching text in the "match text" field.
while this seems logical, that field is very limited.
use that field to get a "Trigger Word" in this case use gives
then in the code of the scripting you can list as many "elseif" comparisons as you want, so you could add or remove them later easily
you can also have it reply with different cute things of course.

Code:
on *:ACTION:Gives *:#:{
  var %actiontext = $1-
  if ($me == stupbot) {
    if (*pepsi* iswm $1-) { describe $chan $+(*,Takes the PePsi,*)  it brings good things to life! }
    elseif (*coke* iswm $1-) { describe $chan $+(*,Graciously accepts the Coke-a-Cola,*) its the real thing baby! }
    elseif (*cookie* iswm $1-) { describe $chan $+(*,Snatches the Cookie,*) SNARF! MunCH Thank-Crunch-s }
    else { describe $chan Sorry I don't like $+(*,$4-,*, $chr(44)) Thanks Anyway! }
  }
}


the first code i put up you need to have it where the second trigger word be $4, this version allos the coke pepsi or cookie to be in different locations as long as it starts /me gives

if /me gives StuPbOt a baseball bat to the head

the reply will still happen
Sorry I don't like *baseball*, Thanks Anyway!

or
/me gives fireprincess the keys to my new car
Sorry I don't like *keys*, Thanks Anyway!

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:
Thanks.

I got that to work this way:
snip of code
}


I like that you replied with what you finally used, so many say "I got it to work, yet never say what they did, what was their fix.

anyway, have fun


Link Copied to Clipboard