|
|
Joined: Oct 2008
Posts: 167
Vogon poet
|
OP
Vogon poet
Joined: Oct 2008
Posts: 167 |
Is there a way (or outline) of making a bot change what it says? e.g. <user> Hot Bot <bot> Tsss.... <user> Hot bot <bot> Stop it user! * bot blushes <user> Hot Bot <bot> I know! :P
|
|
|
|
Buggs2008
|
Buggs2008
|
Here you go.
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,124
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,124 |
Another version using variables: 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: 1,995
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,995 |
And of course the random responses.
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,155
Hoopy frood
|
Hoopy frood
Joined: Jan 2007
Posts: 1,155 |
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)
|
|
|
|
Wyzer
|
Wyzer
|
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! }
|
|
|
|
uicn_renegade
|
uicn_renegade
|
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.
|
|
|
|
Wyzer
|
Wyzer
|
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,412
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,412 |
I don't know if halt is the best to use there, maybe use return instead?
|
|
|
|
Joined: Jul 2007
Posts: 1,124
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,124 |
Try this one: 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,155
Hoopy frood
|
Hoopy frood
Joined: Jan 2007
Posts: 1,155 |
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,124
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,124 |
It does exist in the else event. It looks confusing but it works this way too:
:random | var %y $rand(1,4), %x = $v1
if (%x == %y) goto random | goto $v2
|
|
|
|
Joined: Nov 2006
Posts: 1,552
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,552 |
But why did you come up with :random | var %y $rand(1,4)
if (%x == %y) goto random
else var %x = $v1 | goto $v2 for *confused* 
|
|
|
|
|
|