2014-02-27 15:35
dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
03:12
Trenal has joined #cinch
03:13
<
Trenal >
Hello, I'm trying to setup a simple bot using a ZNC shell. Does anyone know how to get by the need for an initial password when connecting to the ZNC?
03:13
<
Trenal >
I get the Try /quote PASS username:password error, but I can't figure out how to send it during connection
03:13
<
dominikh >
set the password in the bot's configuration.
03:16
<
Trenal >
thanks, just took another set of eyes
03:16
<
Trenal >
I had the user wrong
03:16
<
Trenal >
had it at the nick
05:48
irsol has quit [Ping timeout: 250 seconds]
06:16
irsol has joined #cinch
06:48
frdmn has quit [Quit: ssssSSSSssss]
06:49
frdmn has joined #cinch
10:32
tekku is now known as tekk
12:12
aclearman037 has joined #cinch
13:02
aclearman037 has quit []
13:03
aclearman037 has joined #cinch
13:05
aclearman037 has left #cinch [#cinch]
14:48
irsol has quit [Ping timeout: 264 seconds]
14:51
irsol has joined #cinch
15:55
irsol has quit [Remote host closed the connection]
15:55
irsol has joined #cinch
16:05
sarkyniin has joined #cinch
16:06
<
sarkyniin >
is it possible to make a list of words for the bot to react to?
16:06
<
sarkyniin >
right now my code is
16:06
<
sarkyniin >
on :message, "hi" do |m|
16:06
<
sarkyniin >
m.reply "Hi, #{m.user.nick}"
16:06
<
sarkyniin >
but I want it to react to more words: hello, sup, etc
16:07
<
sarkyniin >
however, I don't want it to react when the word's in a sentence, so I don't want it to react to "hi user", etc
16:09
rikai has joined #cinch
16:10
<
Trenal >
look at the google example
16:10
<
Gizmokid2005 >
sarkyniin: you could use some regex to do what you're looking for
16:10
<
Trenal >
uses regex to match
16:10
<
sarkyniin >
oh wait
16:10
<
sarkyniin >
on :message, /(^hi$|^sup$|^hi everyone$|^hello$)/ do |m|
16:10
<
sarkyniin >
could this work
16:10
rikai_ has quit [Ping timeout: 256 seconds]
16:14
<
sarkyniin >
yeah, it works
16:14
<
sarkyniin >
is it possible to add a timer to a command?
16:14
<
sarkyniin >
so you can't use a command more than one time every minute, for example
16:16
<
catepillar >
yes, it's possible
16:16
<
catepillar >
but it's something you are going to have to manage yourself
16:17
<
catepillar >
create a hash where keys are m.user.name and the value is Time.now
16:17
<
catepillar >
and don't respond if Time.now.to_i - Hash[m.user.name] < 60
16:23
irsol has quit [Remote host closed the connection]
16:24
irsol has joined #cinch
16:28
<
catepillar >
that's a simple working example
16:28
<
catepillar >
oh, wait
16:28
<
catepillar >
need to convert Time.now to an int
16:29
<
catepillar >
that abuses ruby's type system a little
16:29
<
catepillar >
but it works
16:31
<
catepillar >
some things to be wary of: the hash never kicks users out of memory, so you could potentially run out of memory
16:31
<
catepillar >
and users can change nicks to skirt the usage limits
16:41
<
sarkyniin >
does this work?
16:42
<
catepillar >
instead of setting greet_cooldown to 0, you can set it to Time.now.to_i-60
16:42
<
sarkyniin >
hmm I guess
16:42
<
catepillar >
but i still don't think that matters
16:43
<
catepillar >
and you can still drop that comparison
16:43
<
catepillar >
but it should be Time.now.to_i-cooldown < 60
16:44
<
catepillar >
you don't need the ! greet_cooldown == 0
16:44
<
catepillar >
it won't ever matter, unless the epoch changes to literally in the last minute
16:50
<
sarkyniin >
does this look better
16:52
<
catepillar >
yea, but picky me is gonna say to let the timer initialize to 0 cause it won't matter if it's Time.now.to_i-60 or 0, but that is completely functional
16:58
<
sarkyniin >
catepillar: it doesn't do anything
16:58
<
sarkyniin >
I made it print greet_cooldown and time.now in order
16:58
<
sarkyniin >
1405961752
16:58
<
sarkyniin >
1405961863
16:58
<
sarkyniin >
first is greet_cooldown, second time.now
16:59
<
sarkyniin >
it won't work with this
16:59
<
sarkyniin >
unless greet_cooldown - Time.now.to_i < 60
16:59
<
sarkyniin >
shouldn't it be Time.now - greet_cooldown?
17:02
<
catepillar >
yea, it should be
17:25
postmodern has joined #cinch
18:14
irsol has quit [Remote host closed the connection]
18:16
sarkyniin has quit [Ping timeout: 264 seconds]
18:16
sarkyniin has joined #cinch
18:17
irsol has joined #cinch
20:03
sarkyniin has quit [Ping timeout: 240 seconds]
20:27
sarkyniin has joined #cinch
20:45
sarkyniin has quit [Quit: Quitte]
21:27
djbkd has joined #cinch
21:32
djbkd has quit [Remote host closed the connection]
22:40
djbkd has joined #cinch
22:41
djbkd has quit [Remote host closed the connection]
22:48
irsol has quit [Ping timeout: 240 seconds]
23:02
irsol has joined #cinch