mIRC Home    About    Download    Register    News    Help

Print Thread
#206018 05/11/08 09:58 PM
Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
Is there a way (or outline) of making a bot change what it says?

e.g.
Quote:
<user> Hot Bot
<bot> Tsss....
<user> Hot bot
<bot> Stop it user!
* bot blushes
<user> Hot Bot
<bot> I know! :P


Joined: Oct 2007
Posts: 214
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
Here you go.

Code:
on *:TEXT:*hot bot*:#: {
  hinc -m count $nick 1
  if ($hget(count,$nick) == 1) { msg # Tsss... }
  if ($hget(count,$nick) == 2) { msg # Stop it user! | describe # blushes }
  if ($hget(count,$nick) == 3) { msg # I know! :P | hfree count }
}
 


Cheers!

Jay

Last edited by Buggs2008; 06/11/08 12:48 AM.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Another version using variables:

Code:
on *:TEXT:*hot bot*:#: {
  inc %bot | if (%bot = 1) { msg # Tsss... }
  if (%bot = 2) { msg # Stop it user! | describe # blushes }
  if (%bot = 3) { msg # I know! :P }
  if (%bot >= 3) { unset %bot }
}

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

And of course the random responses.

Code:

on *:TEXT:*hot bot*:#: {
  goto $rand(1,3)
  :1 | msg # Tsss.... | return
  :2 | msg # Stop it user! | describe # blushes | return
  :3 | msg # I know! :P
}


Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
All great answers. I prefer to make a text file with what I want ther bot to say and then just use...

/msg $chan $read(file.txt)

This will read a random line from the text file.


File.txt

Tsss....
Stop it user!
I know! :P

on *:text:Hot Bot:#:msg $chan $read(file.txt)

Joined: Sep 2008
Posts: 6
W
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
W
Joined: Sep 2008
Posts: 6
Well I used a bit of mix and match and tried to come up with my own join random. Yet more often then not, it posts all 4 responses.

on !*:JOIN:#channel: {
goto $rand(1,4)
:1 | describe $chan Huggles $nick | return
:2 | describe $chan loves $nick so much!! | return
:3 | describe $chan puts his arms around $nick | return
:4 | describe $chan thinks $nick has the cutest eyes!
}


Joined: Mar 2004
Posts: 26
U
Ameglian cow
Offline
Ameglian cow
U
Joined: Mar 2004
Posts: 26
GAH, sorry clicked the wrong button, just add halt to the end of each

Last edited by uicn_renegade; 17/02/09 08:32 PM.
Joined: Sep 2008
Posts: 6
W
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
W
Joined: Sep 2008
Posts: 6
So it should look like this then? If that is the case, thanks a lot.

on !*:JOIN:#channel: {
goto $rand(1,4)
:1 | describe $chan Huggles $nick | halt
:2 | describe $chan loves $nick so much!! | halt
:3 | describe $chan puts his arms around $nick | halt
:4 | describe $chan thinks $nick has the cutest eyes! | halt
}

Last edited by Wyzer; 17/02/09 08:38 PM.
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I don't know if halt is the best to use there, maybe use return instead?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Try this one:
Code:
on !*:JOIN:#: {
  :random | var %y $rand(1,4)
  if (%x == %y) goto random
  else var %x = $v1 | goto $v2
  :1 | describe $chan Huggles $nick | halt
  :2 | describe $chan loves $nick so much!! | halt
  :3 | describe $chan puts his arms around $nick | halt
  :4 | describe $chan thinks $nick has the cutest eyes! | halt
}

But then again, yours will work.

Last edited by Tomao; 18/02/09 11:49 PM.
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
I'm barely awake so maybe I'm looking at this wrong ...

on !*:JOIN:#: {
:random | var %y $rand(1,4)
if (%x == %y) goto random
else var %x = $v1 | goto $v2


if (%x == %y) .... %x doesnt exist yet so %x == $null, so $rand(1,4) will never == $null so %x will never == %y which makes that line pointless?

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
It does exist in the else event. It looks confusing but it works this way too:
Code:
  :random | var %y $rand(1,4), %x = $v1
  if (%x == %y) goto random | goto $v2

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
But why did you come up with
Code:
  :random | var %y $rand(1,4)
  if (%x == %y) goto random
  else var %x = $v1 | goto $v2
for
Code:
  goto $rand(1,4)

*confused* smile


Link Copied to Clipboard