dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
Trenal has joined #cinch
<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?
<Trenal> I get the Try /quote PASS username:password error, but I can't figure out how to send it during connection
<dominikh> set the password in the bot's configuration.
<Trenal> thanks, just took another set of eyes
<Trenal> I had the user wrong
<Trenal> had it at the nick
irsol has quit [Ping timeout: 250 seconds]
irsol has joined #cinch
frdmn has quit [Quit: ssssSSSSssss]
frdmn has joined #cinch
tekku is now known as tekk
aclearman037 has joined #cinch
aclearman037 has quit []
aclearman037 has joined #cinch
aclearman037 has left #cinch [#cinch]
irsol has quit [Ping timeout: 264 seconds]
irsol has joined #cinch
irsol has quit [Remote host closed the connection]
irsol has joined #cinch
sarkyniin has joined #cinch
<sarkyniin> hey
<sarkyniin> is it possible to make a list of words for the bot to react to?
<sarkyniin> right now my code is
<sarkyniin> on :message, "hi" do |m|
<sarkyniin> m.reply "Hi, #{m.user.nick}"
<sarkyniin> end
<sarkyniin> but I want it to react to more words: hello, sup, etc
<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
rikai has joined #cinch
<Trenal> look at the google example
<Gizmokid2005> sarkyniin: you could use some regex to do what you're looking for
<Trenal> uses regex to match
<sarkyniin> oh wait
<sarkyniin> on :message, /(^hi$|^sup$|^hi everyone$|^hello$)/ do |m|
<sarkyniin> could this work
rikai_ has quit [Ping timeout: 256 seconds]
<sarkyniin> yeah, it works
<sarkyniin> is it possible to add a timer to a command?
<sarkyniin> so you can't use a command more than one time every minute, for example
<catepillar> yes, it's possible
<catepillar> but it's something you are going to have to manage yourself
<catepillar> create a hash where keys are m.user.name and the value is Time.now
<catepillar> and don't respond if Time.now.to_i - Hash[m.user.name] < 60
irsol has quit [Remote host closed the connection]
irsol has joined #cinch
<catepillar> sarkyniin: http://pastebin.com/9pynQwuA
<catepillar> that's a simple working example
<sarkyniin> thanks
<catepillar> oh, wait
<catepillar> need to convert Time.now to an int
<catepillar> that abuses ruby's type system a little
<catepillar> but it works
<catepillar> some things to be wary of: the hash never kicks users out of memory, so you could potentially run out of memory
<catepillar> and users can change nicks to skirt the usage limits
<sarkyniin> catepillar: http://hastebin.com/izaralefoq.rb
<sarkyniin> does this work?
<catepillar> instead of setting greet_cooldown to 0, you can set it to Time.now.to_i-60
<sarkyniin> hmm I guess
<catepillar> but i still don't think that matters
<catepillar> and you can still drop that comparison
<catepillar> but it should be Time.now.to_i-cooldown < 60
<catepillar> you don't need the ! greet_cooldown == 0
<catepillar> it won't ever matter, unless the epoch changes to literally in the last minute
<sarkyniin> catepillar: http://hastebin.com/iburexexam.rb
<sarkyniin> does this look better
<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
<sarkyniin> catepillar: it doesn't do anything
<sarkyniin> I made it print greet_cooldown and time.now in order
<sarkyniin> 1405961752
<sarkyniin> 1405961863
<sarkyniin> first is greet_cooldown, second time.now
<sarkyniin> it won't work with this
<sarkyniin> unless greet_cooldown - Time.now.to_i < 60
<sarkyniin> shouldn't it be Time.now - greet_cooldown?
<catepillar> yea, it should be
postmodern has joined #cinch
irsol has quit [Remote host closed the connection]
sarkyniin has quit [Ping timeout: 264 seconds]
sarkyniin has joined #cinch
irsol has joined #cinch
sarkyniin has quit [Ping timeout: 240 seconds]
sarkyniin has joined #cinch
sarkyniin has quit [Quit: Quitte]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
irsol has quit [Ping timeout: 240 seconds]
irsol has joined #cinch