dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.2.1
v0n has joined #cinch
Crazy_Atheist has quit [Quit: WeeChat 1.0.1]
djbkd has quit [Quit: My people need me...]
<CM-Punk> Hey, so once I've started a timer in a method, how do I stop it?
<leftylink> CM-Punk: http://www.rubydoc.info/gems/cinch/Cinch/Timer it has a #stop
<CM-Punk> I just came from that page
<CM-Punk> So, I came here to ask
<CM-Punk> Ohhhh wait a minute
<CM-Punk> Okay
<CM-Punk> So I'd stop it by like
<CM-Punk> Timer(*args).stop
<CM-Punk> Right?
<CM-Punk> But how do I get it to tell which timer to stop!?
<leftylink> CM-Punk: #stop stops the specific Timer object it's called on.
<leftylink> that's how it knows what timer to stop
<leftylink> so you just need to know what Timer object to call #stop on
<CM-Punk> You're talking over my head...I need a relevant example...
<CM-Punk> I learn everything by example and then I can run with it...
<CM-Punk> Like I did with the entirety of my bot
<CM-Punk> http://pastie.org/private/6sguihek9xw6ho97zqpsww leftylink line 105 is where I create the timer
<leftylink> CM-Punk: but wait, you already gave yourself an example... like above you said < CM-Punk> Timer(*args).stop
<leftylink> so if you had said Timer(5).stop, you would create a Timer of 5 seconds, and then you immediately stopped the timer you just created
<CM-Punk> I don't want to immediately stop it...
<leftylink> then stop it later
<CM-Punk> Okay, so let's say I....created that timer....
<CM-Punk> Then another action happens that I want to trigger a stop of the action
<CM-Punk> Would I just create another method with...
<CM-Punk> Timer(3600, shots: 1).stop
<CM-Punk> And it would STOP the time because the arguments match?
<CM-Punk> No...that doesn't make sense...
<CM-Punk> That would just create a timer and stop it
<CM-Punk> I don't know.
<leftylink> right, if you did `Timer(3600, shots: 1)` that creates a brand new timer and stops it immediately. instead, call stop on the timer you created previously
<leftylink> a bit misleading, redoing
<leftylink> right, if you did `Timer(3600, shots: 1).stop` that creates a brand new timer and stops it immediately. instead, call stop on the timer you created previously
<CM-Punk> Right, how do I do that?
<CM-Punk> I've never called an active object like that...
<leftylink> hmm... the same way you would call any method on any other object. a period, and then "stop"
<CM-Punk> timeoutHandler.Timer.stop?
<CM-Punk> Wait leftylink
<CM-Punk> If...
<CM-Punk> If I don't specify arguments...
<CM-Punk> Would Timer.stop not create a new timer, but call on an active timer?
<CM-Punk> Call me an idiot, but I don't understand.
<leftylink> hmm, looking at your code, `timeoutHandler.Timer` wouldn't work
<leftylink> `timeoutHandler` returns a Timer object, and Timer objects... probably don't have a Timer method
<leftylink> or, well, I don't know if they do, but it's certainly not what I would use, so I would be too scare to give advice there
<CM-Punk> Do you have ANY suggestions, leftylink? Because like...when someone logs out, I don't want the timer firing.
<leftylink> indeed. well it looks like on line 91, you create a timer for the user who just logged in. so somewhere around line 113 or so (when the user uses !logout command) you would want to call #stop on the timer for the user who used that command
<leftylink> "the timer for the user who used that command" being the same timer that was created on line 91
<CM-Punk> Right
<CM-Punk> So how do I call that timer to stop it?
<leftylink> hmm, I think the answer to that depends a little bit on personal preference. like, I personally would use a hash, but there could be other ways. if you think that would work for you cool, but I'd definitely not be offended if you did it any other way
djbkd has joined #cinch
<CM-Punk> leftylink, I don't know how to do it with a hash
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<CM-Punk> I don
<CM-Punk> I don't know how to do it at all, that is what I am asking you to tell me.
<leftylink> wait, that doesn't make sense to me. you did it many times in the code you showed me. how can you avhe done it if you don't know how? for example, on line 17
<leftylink> er maybe 18 is a better example
frog|OFF is now known as green-big-frog
green-big-frog is now known as frog|OFF
postmodern has quit [Quit: Leaving]
Crazy_Atheist has joined #cinch
<CM-Punk> I still don't know how to stop the timer.
Crazy_Atheist has quit [Quit: WeeChat 1.0.1]
Crazy_Atheist has joined #cinch
Crazy_Atheist has quit [Quit: WeeChat 1.0.1]
djbkd has quit [Remote host closed the connection]
ayonix has quit [Read error: Connection reset by peer]
ayonix has joined #cinch
Crisopolis has quit [Ping timeout: 256 seconds]
Crisopolis has joined #cinch
postmodern has joined #cinch
frog|OFF is now known as green-big-frog
britneywright has joined #cinch
postmodern has quit [Quit: Leaving]
frdmn has quit [Ping timeout: 264 seconds]
frdmn has joined #cinch
Crazy_Atheist has joined #cinch
djbkd has joined #cinch
sarkyniin has joined #cinch
djbkd has quit [Remote host closed the connection]
green-big-frog is now known as frog|OFF
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
dominikh has quit [Ping timeout: 245 seconds]
dominikh has joined #cinch
djbkd has quit [Remote host closed the connection]
apt-get_ has joined #cinch
sarkyniin has quit [Ping timeout: 244 seconds]
djbkd has joined #cinch
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
britneywright has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
postmodern has joined #cinch
djbkd has quit [Remote host closed the connection]
apt-get_ has quit [Quit: Quitte]