dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.0.10
space_ has joined #cinch
space has quit [Ping timeout: 245 seconds]
space_ is now known as Space
qb has joined #cinch
leftylink has quit [Read error: Operation timed out]
leftylink has joined #cinch
robonerd is now known as testr0n
Spami has quit [Quit: This computer has gone to sleep]
testr0n is now known as robonerd
Spami has joined #cinch
robonerd is now known as testr0n
<Rickmasta> I want to get a notice on my bot
<Rickmasta> and then reply in a specific channel, how would I do that?
<dominikh> Rickmasta: Channel("#somechannel").send("your message")
<Rickmasta> Yup I found it. Thanks dominikh.
<dominikh> cool
testr0n has quit [Remote host closed the connection]
robonerd has joined #cinch
Spami has quit [Quit: This computer has gone to sleep]
Space has quit [Read error: Operation timed out]
xeviox|afk is now known as xeviox
xeviox is now known as xeviox|afk
xeviox|afk is now known as xeviox
xeviox is now known as xeviox|afk
xeviox|afk is now known as xeviox
postmodern has joined #cinch
kludge` has quit [Ping timeout: 248 seconds]
kludge` has joined #cinch
xeviox is now known as xeviox|afk
xeviox|afk is now known as xeviox
postmodern has quit [Quit: Leaving]
rikai has quit [Ping timeout: 252 seconds]
xeviox is now known as xeviox|afk
xeviox|afk is now known as xeviox
UberDragon has joined #cinch
xeviox is now known as xeviox|afk
Spami has joined #cinch
Dwarf has quit [Ping timeout: 240 seconds]
Dwarf has joined #cinch
phus1on has joined #cinch
Dwarf has quit [Remote host closed the connection]
Dwarf has joined #cinch
<phus1on> hi, maybe someone could give me a hint on how to enable ssl in cinch cfg ?
phus1on has left #cinch ["."]
Spami has quit [Quit: This computer has gone to sleep]
Spami has joined #cinch
rikai has joined #cinch
Spami has quit [Quit: Leaving]
<Rickmasta> How would I go about scrapping all of the colors from any incoming message?
Spami has joined #cinch
<Rickmasta> Or just igoring the colors
<catepillar> uhhh, you can regex it out
<catepillar> i forgot the exact character used
<catepillar> /[\x02\x1F\x0F\x16]|\x03(\d\d?(,\d\d?)?)?/
<catepillar> that's the offical regex
<catepillar> that also removes bold and underline too
<Rickmasta> catepillar: Thanks
<Rickmasta> Can I do this on the message?
<Rickmasta> I mean
<Rickmasta> How would I do this at the point of the event?
<catepillar> you have to apply it to the prefix you are using
<catepillar> and at the end of each of your matches
<Rickmasta> Can you show me an example? I'm sorry
<catepillar> i don't have any on hand
<catepillar> and at work atm
<catepillar> < dominikh> `match /.../, prefix: ...`, `set :prefix, ...` and `c.plugins.prefix = ...`
<catepillar> so there's 3 different ways to do this
<catepillar> `set :prefix, ...` would work on plugins
<catepillar> `c.plugins.prefix = ...` would affect all plugins
<catepillar> it kinda depends on the setup of your bot in particular
<Rickmasta> I don't have a plugin-based bot.
<Rickmasta> A single ruby file.
<catepillar> so you are doing a bunch of `match /.../`? with no prefix?
<Rickmasta> I'm not too familiar with what you mean.
<Rickmasta> I do have
<Rickmasta> things like "on :message, /^.+Choose a color Rig/ do |m|"
<catepillar> ok, that's easy enough, your matcher is a /./
<catepillar> i would assume
<Rickmasta> Is there anyway that I can make it so that every :message event removes the colors before
<catepillar> im testing htis out, make sure i get you something that works right
<Rickmasta> Sure
<catepillar> i dunno about that in particular, dominikh might know
<catepillar> `/(?:[\x02\x1F\x0F\x16]\x03(?:\d\d?(?:,\d\d?)?))?.+Choose a color Rig/`
<catepillar> seems to be getting it
<catepillar> use everything between the `` (don't include the ticks)
<catepillar> you could probably remove the .+ now too, since you probably just want to match something like `Choose a color` and not asdf.Choose a color
<catepillar> alright, my lunch break is over now, but i can check in here if you have any more questions
<Rickmasta> Sweet. Thank you catepillar!
<catepillar> np
<Rickmasta> Actually, doesn't seem to ork catepillar
<Rickmasta> This is an example message
<Rickmasta> :\u0002\u00033U\u000312N\u000313O\u000308!\u0002\u0003 Card in play: \u00030,04 Red 2 \u0003
<catepillar> you might need to swap out all the \x with \u00
<catepillar> i forget exactly how ruby handles unicode in strings
xeviox|afk is now known as xeviox
<Rickmasta> I can't get it.
<Rickmasta> :/
<catepillar> i need to see some sample code now...
<Rickmasta> Sure catepillar
<Rickmasta> catepillar: http://pastie.org/8490797
<Cinchy> [pastie] #8490797 - Pastie (at pastie.org, on 2013-11-19 01:17)
<dominikh> [\u0002\u001F\u000F\u0016] matches exactly one of them.
<dominikh> (and I generally don't see half of the text from the example in your regexp)
<dominikh> so, how is this "\u00033U\u000312N\u000313O" supposed to be matched by "somethingsomething UNO"?
<dominikh> "UNO" can't match "stuffUstuffNstuffO"
<Rickmasta> :/
<Rickmasta> I guess I have to do it another method?
postmodern has joined #cinch
<dominikh> why don't you simply match /You have \u000314\u0002\u000230\u0002s\u0002\u0003 to join uno$/ and be done with it
<Rickmasta> I was doing that for that particular message
<Rickmasta> but that's not the only one
<Rickmasta> dominikh: I have for example http://pastie.org/pastes/8490839/text
<dominikh> you could implement stripping of colors in the core of cinch ;)
<Rickmasta> Wouldn't know how. :(
<Rickmasta> That was one of my first thoughts, though.
<dominikh> certainly saner than writing such regexps
<Rickmasta> Are you the author of Cinch, dominikh?
<dominikh> yes
<Rickmasta> Maybe we can write it "together" and it can be implemented? ;)
<dominikh> I'm not actively working on Cinch anymore, I spend my time on other things ;)
<Rickmasta> Ah
<dominikh> it should be rather straightforward though
<Rickmasta> Is it possible if you can lead me in the right direction and I find my way from there?
<dominikh> meh, I'll see about implementing it
<Rickmasta> lol :)
<Rickmasta> I wrote this UNO playing bot. I had it working, then once I stuck it in the real channel, I didn't even realize that the colors would make such a big deal.
<catepillar> so are you trying to parse your own colors?
<Rickmasta> Not my uno channel.
<Rickmasta> I'm just making a bot to play uno to practice my ruby
<dominikh> (and of course a fair dose of cheating :P)
<Rickmasta> lol nah :P
<Rickmasta> My bot is stupid!
<Rickmasta> Did't realize how hard it'll be to make it "smart"
<Rickmasta> plus I have zero knowledge of any AI oriented programming.
<catepillar> eh, im pretty sure playing uno is considered pretty trivial
<dominikh> depends if you want to predict your opponent's moves or not
<catepillar> this is a fair statement, and humans do tend to try and predict
<Rickmasta> Yeah, so I was going to do things like have the bot keep track of what cards they possibly don't have.
<Rickmasta> But I want to get it to play first. :P
<Rickmasta> they as in the other players. Like if the drew when a Blue 9 was out, then they don't have any Blues or 9s.
<catepillar> seems to have been a couple of papers written on optimal uno strategies
<catepillar> most of them have to do with keeping track of who played what and when
<catepillar> then using statistics to figure who might have what
<catepillar> from a cursory glance
<dominikh> try poker instead ;)
<catepillar> poker is about the same :P
<Rickmasta> I'll master UNO then create a poker game.
<catepillar> probably easier cause of hte smaller deck
<Rickmasta> You guys can play against it. ;)
<dominikh> catepillar: a lot more to predict though. bluffing behaviour, aggressiveness etc
<dominikh> catepillar: i.e. it crosses single hand boundaries
<catepillar> dominikh: yea, if you wanna get that complicated
<dominikh> catepillar: well of course, I want to cheat on pokerstars and win money! ;)
<catepillar> bots that play the straight odds tend to be relatively successful anyways
<catepillar> of course, in poker terms, they are considered "conservative"
<dominikh> not that successful if they can't get anyone to commit though
<dominikh> "oh look, the bot's playing… time to fold" :P
<catepillar> that's the problem with conservative play, yes
<catepillar> but if you ahve 4 bots in a room of 5 playing hte same conservative method, where they all communicate, then you have all 4 go to the flop (if texas hold em) then best hand plays out
<catepillar> gonna have a rougly 80% win rate like that ;)
<dominikh> and of course you'll get banned ;)
<catepillar> what? banned? how?
<catepillar> i have 4 different IP's from 5 different countries!
<dominikh> yeah, it's not exactly hard to spot a) strictly mathematical play b) players that communicate
<catepillar> actually, just need to cycle IP's enough that it's very difficult to track, and use lots of different accounts
<dominikh> be it bots or not; they equally hunt real people who play together at the same table to cheat
<dominikh> lots of different accounts will be difficult to cash out
<catepillar> ahh, so super smart bot is much better
<dominikh> how many bank accounts/credit cards do you have? ;)
<catepillar> eh, 5 bank accounts today
<catepillar> 20 tomorrow
<catepillar> anyways, i need to get work done
<dominikh> and 80 the day after tomorrow? I hope you can keep that growth up :P
<catepillar> we can continue this talk when i get off work
<catepillar> :)
<dominikh> (said the administrator of a big bank)
<catepillar> lol, you are a bank admin?
<dominikh> no, I was implying that you are
<dominikh> I'm a student whose only relationship with banks consists of debt :P
<catepillar> haha, i just graduated in may
<dominikh> hah, congrats
<catepillar> software developers (and not for banks)
<catepillar> *developer
<dominikh> Rickmasta: almost done
<Rickmasta> Sweeet!
<Rickmasta> My method was failing
<Rickmasta> I was trying to create a removecolor method
<dominikh> in essence that's the same thing I did. just in the right place
Space has joined #cinch
<dominikh> now I only need to figure out how to send colours with my IRC client :P
<dominikh> well then, seems to work
<dominikh> Rickmasta: you'll need to build cinch from git
<Rickmasta> Alright, now I must learn how to do that.
<Rickmasta> Oh man, I'm so bad. haha
<dominikh> git clone https://github.com/cinchrb/cinch; cd cinch; gem build cinch.gemspec; gem install cinch-2.0.10.gem
<dominikh> after that, matchers have a new option, :strip_colors. set that to true and Cinch will strip colors before attempting a match
<Rickmasta> and that'll work with "on :message", "on :notice" etc.?
<dominikh> no. that'll work with proper plugins and matchers
<dominikh> not with the "on" stuff
<Rickmasta> Oh boy. Alright.
<Rickmasta> dominikh: Is it possible if you can show me the example you just did?
<Rickmasta> I'm sorry if I'm asking for too much.
<dominikh> Rickmasta: what do you mean?
<Rickmasta> I mean the test. To test it yourself
<Rickmasta> Oh alright
<Rickmasta> and with matching, how do i tell if it was a notice?
<dominikh> use the react_on option
<dominikh> if you're curious, these are the changes to implement it in Cinch: https://github.com/cinchrb/cinch/commit/5e594079ac607d218f372464d3592867bffea6d2
xeviox is now known as xeviox|afk