2014-02-27 15:35
dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
00:05
jackdempsey has quit [Ping timeout: 255 seconds]
01:02
djbkd has quit [Remote host closed the connection]
01:28
jackdempsey has joined #cinch
03:07
jackdempsey has quit [Ping timeout: 250 seconds]
03:17
jackdempsey has joined #cinch
04:08
djbkd has joined #cinch
04:38
jackdempsey has quit [Ping timeout: 240 seconds]
05:09
djbkd has quit [Remote host closed the connection]
07:24
djbkd has joined #cinch
08:55
postmodern has quit [Quit: Leaving]
13:25
_whitelogger has joined #cinch
15:34
jackdempsey has joined #cinch
16:17
aptyget has joined #cinch
16:18
<
aptyget >
I want to make a small trigger that displays a message when someone enters "!no"
16:18
<
aptyget >
and then has a 15 second timer
16:18
<
aptyget >
when the timer's over, it displays another message
16:18
<
aptyget >
however, if a message is entered during those 15 seconds, it should stop the timer and immediatly respond with a third message
16:18
<
aptyget >
here's my code. However, it doesn't seem to be working.
16:18
<
aptyget >
Any ideas?
16:21
jackdempsey has quit [Ping timeout: 255 seconds]
16:39
<
onewheelskyward >
aptyget What Timer class are you using?
16:39
<
aptyget >
onewheelskyward: cinch's, I think
16:40
<
aptyget >
the example in the docs:
16:40
<
aptyget >
on :message, "start timer" do
16:40
<
aptyget >
Timer(5) { puts "timer fired" }
16:41
<
onewheelskyward >
Ah I think I see the problem
16:41
<
onewheelskyward >
Are you expecting the second on :message block to respond to the bots reply?
16:42
<
aptyget >
basically, I want that block to activate only if the first on :message block activates
16:44
<
onewheelskyward >
ok
16:44
<
onewheelskyward >
You're going to need some sort of persistence.
16:45
<
onewheelskyward >
A variable that lasts between threads.
16:46
<
aptyget >
something like
16:48
<
aptyget >
oh I know onewheelskyward
16:48
<
aptyget >
notimer = Timer(15) {m.reply("... pff") if nomessage == true}
16:48
<
aptyget >
or something
16:48
<
onewheelskyward >
Sort of. I was thinking you should check if notimer.stopped? to figure out if it's active.
16:49
<
aptyget >
maybe I should put the notimer at the top of my file
16:50
<
onewheelskyward >
If you're not going to use something like sqlite, you'll have to use a class var, not an instance var.
16:50
<
onewheelskyward >
Each thread instantiates the class.
16:54
<
catepillar >
onewheelskyward: there is shared[]
16:54
<
onewheelskyward >
Oh hey, that should work.
16:55
<
onewheelskyward >
Is there a doc for that? I can't seem to find it.
16:55
<
catepillar >
uh, just a sec
16:58
<
catepillar >
has a "shared" variable
16:58
<
catepillar >
plugins have a "shared" variable that can be just accessed
16:58
<
catepillar >
shared[:key] in the plugin
17:00
<
catepillar >
i might also not use cinch's timer in this situation, the timer is just a wrapper for Thread
17:01
<
catepillar >
and you can control more with Thread, like changing the fire interval and stopping outstanding threads and restarting them with the new interval
17:01
<
onewheelskyward >
nice, thanks!
17:39
postmodern has joined #cinch
17:59
djbkd has joined #cinch
18:01
djbkd has quit [Remote host closed the connection]
18:29
djbkd has joined #cinch
18:54
djbkd has quit [Quit: My people need me...]
19:13
djbkd has joined #cinch
19:14
djbkd has quit [Client Quit]
19:39
djbkd has joined #cinch
19:41
djbkd has quit [Remote host closed the connection]
20:39
Rylee has quit [Quit: WeeChat 1.0-rc2]
21:49
Rylee has joined #cinch
21:53
djbkd has joined #cinch
22:34
jackdempsey has joined #cinch
23:00
Azure has quit [Quit: My MBP went to sleep.]
23:00
djbkd has quit [Remote host closed the connection]
23:08
djbkd has joined #cinch
23:11
Azure has joined #cinch