Can increase (++) and decrease (--) points before words.
Closed this issue · 28 comments
Do we want this behavior too? Example (Flexo and Bender are rbots):
...
[02:08pm] Ant> flexo help points
02:08PM Flexo> Ant: points module: Keeps track of internet points, infusing your
pointless life with meaning. Listens to everyone's chat.
++/-- => increase/decrease points for , points for
? => show points for , pointstats => show best/worst,
pointsdump => show everyone's points. Points are a community rating
system - only in-channel messages can affect points and you cannot
adjust your own.
02:08PM Bender> Flexo: ++/ now has -1 points!
...
[02:10pm] Ant> hm
[02:10pm] Ant> Update - We have rolled out a fix and are monitoring recovery.
[02:10pm] Ant> Apr 2, 21:06 UTC --github
02:10PM Bender> Ant: github now has -1 points!
02:10PM Flexo> Ant: github now has -1 points!
[02:10pm] Ant> woah
[02:10pm] Ant> That's a buyg.
[02:10pm] Ant> github--
02:10PM Bender> Ant: github now has -2 points!
02:10PM Flexo> Ant: github now has -2 points!
[02:10pm] Ant> --github
02:10PM Bender> Ant: github now has -3 points!
02:10PM Flexo> Ant: github now has -3 points!
[02:10pm] Ant> hehe
[02:10pm] Ant> ++Ant
[02:10pm] Ant> ++Mousey
02:10PM Flexo> Ant: Mousey now has 2 points!
[02:11pm] Ant> Wow, you can go either way!
...
[02:16pm] Ant> #34
02:16PM URL> [GitHub] [ruby-rbot/rbot #34] antdude: Can increase (++) and
decrease (--) points before words. | Do we want this behavior too?
Example: […]
[02:16pm] Ant> done
[02:17pm] * Ant wonders what the dev will do. By design and update help? Or remove
before words.
02:17PM Mousey> yeah, that's prefixing instead of postfixing
[02:17pm] Ant> flexo rss show rbot 1
02:17PM Flexo> Ant: lemme fetch it...
02:17PM Flexo> Ant: using old data
02:17PM Flexo> Ant: Channel : Recent Commits to rbot:master
02:17PM Flexo> 2020/04/02 07:19 :: plugin(search): fix search and gcalc, closes
#28, #29 @
7b792be
13da3e7b (by mattzque)
02:17PM Mousey> (where the ++'s are? it has names)
02:17PM Bender> Mousey: 's now has 1 points!
02:17PM Flexo> Mousey: 's now has 1 points!
[02:17pm] Ant> HAHAHAHAHA
02:17PM Mousey> lame
[02:17pm] Ant> Nice bug
[02:19pm] Ant> '++
02:19PM Bender> Ant: ' now has 1 points!
02:19PM Flexo> Ant: ' now has 1 points!
[02:19pm] Ant> heh
...
...
[09:58am] Ant> Mousey --
09:58AM Bender> Ant: Mousey now has 0 points!
09:58AM Flexo> Ant: Mousey now has 1 points!
[09:58am] Ant> mouse ++
09:58AM Bender> Ant: mouse now has 1 points!
09:58AM Flexo> Ant: mouse now has 1 points!
[09:58am] Ant> ++ mouse
09:58AM Flexo> Ant: mouse now has 2 points!
[09:58am] Ant> -- mouse
09:58AM Bender> Ant: mouse now has 0 points!
09:58AM Flexo> Ant: mouse now has 1 points!
...
Good catch, --{something} is often used as a signature and should be ignored by the points plugin
For example those messages are now all ignored by the points plugin:
++alice
--alice
something something --github
ls --sort time
-- foo
++ foo
Thank you, mattzque! :)
Oops:
[12:55pm] Ant> $ ls -all
[12:55pm] Ant> total 607124
[12:55pm] Ant> drwxr-xr-x 2 ant ant 4096 Apr 9 12:31 .
[12:55pm] Ant> drwxr-xr-x 6 ant ant 4096 Apr 9 12:31 ..
[12:55pm] Ant> -rw-r--r-- 1 ant ant 79006976 Apr 9 12:30 v2r.tdb
[12:55pm] Ant> -rw-r--r-- 1 ant ant 79030016 Apr 9 12:31 v2.tdb
12:55PM Bender> Ant: -rw-r--r now has -1 points!
[12:55pm] Ant> -rw-r--r-- 1 ant ant 463632896 Apr 9 12:54 v2.tdb.tmp.131944
12:55PM Bender> Ant: -rw-r--r now has -2 points!
12:55PM Bender> Ant: -rw-r--r now has -3 points!
[12:55pm] uh
Is that a bug? :P
that shouldn't be new behavior, -rw-r--r--
is subtracting a point from -rw-r--r
not sure what could be done here
Oh boy. A new bug I just discovered! Make a word in bold and/or a different color with -- or ++ after it like this example with bolded name (also works with space(s) after it):
[09:05pm] Ant> Ant++
09:05PM Bender> Ant now has 2 points!
09:05PM Flexo> Ant now has 2 points!
[09:05pm] Ant> Ant ++
09:05PM Bender> Ant now has 3 points!
09:05PM Flexo> Ant now has 3 points!
Also, I can add and subtract points to myself too with this method. ;)
should strip non-printable characters from the name for sure you are right,
also maybe ignore words that itself have "--" or "++" in them (so things like -rw-r--r--
would be ignored),
will fix that today
OK. :)
Uh, are you sure this is fixed to myself? I can still reproduce it in both of my rbots with BitchX client (^b for (un)bold and ^c# (# is a number for a color). :(
hmm it does work for me with weechat, it should strip \002 \003 etc. escape sequences
Actually, are you adding and subtracting points to yourself? Try that. I just notice it works fine if it is not me like this. Example:
[01:02pm] Ant> Ant--
01:02PM Bender> Ant now has 0 points!
01:02PM Flexo> Ant now has 0 points!
...
01:15PM AfterShock> what if I put it in quotes like "Ant--"
01:15PM AfterShock> nice
01:16PM AfterShock> that's how to refer to it
[01:21pm] Ant> lol
[01:26pm] Ant> I wonder if "Ant--" works.
[01:26pm] Ant> NICE!
Yay, it works. Let's hope I don't find any new bugs related to my bug report. Thanks again! ;)
Argh. I found another bug? by accident:
...
[08:12pm] Ant> . <-- your point
08:12PM Bender> Ant: < now has -2 points!
08:12PM Flexo> Ant: < now has -2 points!
[08:12pm] Ant> LOL!
[08:12pm] Ant> A bug!
...
Yay, another bug:
...
[02:16pm] Ant> bender hangman
02:16PM Bender> Ant has started a hangman -- join the fun!
02:16PM Bender> _______ (^o^)/
02:16PM Flexo> Bender: hangman now has -1 points!
02:16PM Bender> Flexo: incorrect usage, ask for help using 'Bender: help hangman'
[02:16pm] Ant> uh
[02:17pm] Ant> flexo hangman
02:17PM Flexo> Ant has started a hangman -- join the fun!
02:17PM Bender> Flexo: hangman now has -1 points!
02:17PM Flexo> __________ (^o^)/
02:17PM Flexo> Bender: incorrect usage, ask for help using 'Flexo: help hangman'
[02:17pm] Ant> lol
[02:17pm] Ant> BUG!
...
[02:18pm] Ant> hangman --
02:18PM Bender> Ant: hangman now has -2 points!
02:18PM Flexo> Ant: hangman now has -2 points!
[02:18pm] Ant> heh
...
Argh:
...
[02:45pm] Ant> Man, we're finding lots of bugs!!
��� You have new email.
[02:46pm] Ant> I am writing lots of reports too!
02:46PM Mousey> neat
[02:46pm] Ant> At least the deveoper is active and quick.
[02:46pm] Ant> +l
02:46PM Mousey> he
[02:46pm] Ant> I am probably driving him nuts with the ++ and -- bug reports. hahahaha
02:46PM Bender> Ant: the now has 1 points!
02:46PM Flexo> Ant: the now has 1 points!
02:46PM Bender> Ant: and now has -1 points!
02:46PM Flexo> Ant: and now has -1 points!
[02:46pm] Ant> DAMNIT!!!!!!!!!!!!!!!!!!
02:46PM Mousey> they're probably grateful you keep freporting htings. =)
[02:46pm] Ant> wtf
[02:46pm] Ant> Time to add that.
02:47PM Mousey> i still thin it's fine to have ++ before things. but not that. that is bad
02:47PM Bender> Mousey: have now has 1 points!
02:47PM Flexo> Mousey: have now has 1 points!
02:47PM Mousey> bad
[02:47pm] Ant> ++ --
02:47PM Bender> Ant: + now has -1 points!
[02:47pm] Ant> heheheheheh
...
[09:16pm] Ant> https://linux.slashdot.org/story/20/04/12/2138205/how-red-hats-new-ceo-handles-life-under-ibm----and-a-global-pandemic
09:16PM URL> [ How Red Hat's New CEO Handles Life Under IBM -- and a Global Pandemic - Slashdot ] - linux.slashdot.org
09:16PM Bender> URL: IBM now has -1 points!
09:16PM Flexo> URL: IBM now has -1 points!
...
phew quite a lot of issues, I think this never was really tested this thoroughly, especially never with two rbots running alongside each other
I decided to re-implement the message parser to make it more robust/ simplify it. It now no longer accepts spaces and requires a alphanumerical character to be present. In the tests I have added list of things to ignore with all your examples as well:
++alice
--alice
something something --github
ls --sort time
-- foo
++ foo
test ++
test --
<-- pointing
pointing -->
&++
++
--
++ --
-- ++
+rw+r++r++
-rw-r--r--
https://linux.slashdot.org/story/20/04/12/2138205/how-red-hats-new-ceo-handles-life-under-ibm----and-a-global-pandemic
let me know if you find anything else 👍
Thanks again. I am sure there will be more bugs. ;)
Here we go again:
...
[10:38am] Ant> --2020-04-16 10:36:59-- https://i.ibb.co/nPhrpMt/dog-tennis.gif
[10:38am] Ant> Resolving i.ibb.co (i.ibb.co)... 104.194.8.196, 172.96.140.18
[10:38am] Ant> Connecting to i.ibb.co (i.ibb.co)|104.194.8.196|:443... connected.
[10:38am] Ant> HTTP request sent, awaiting response... 200 OK
[10:38am] Ant> Length: 4227342 (4.0M) [image/gif]
[10:38am] Ant> Saving to: ‘dog-tennis.gif’
10:38AM Bender> Ant: 10:36:59 now has -2 points!
10:38AM Flexo> Ant: 10:36:59 now has -2 points!
[10:38am] Ant> dog-tennis.gif.1 2%[ ] 87.62K
1.87KB/s eta 35m 57s
...
ahh, so just 10:36:59--
, would be detected because it includes an alphanumerical character.
Could make it more strict to ensure it has a alphabetical character, but if you wanted to like a number like 42++
it wouldn't work anymore.
I think I rather have the edgecase, and I certainly not going to start adding blacklisting patterns. We might add a feature so a user could supply their own black list patterns (in case the user knows regular expressions), not sure.
Now, this is funny:
...
03:02PM Tarzan> it was still C++
03:02PM Bender> Tarzan: C now has 2 points!
03:02PM Flexo> Tarzan: C now has 2 points!
[03:02pm] Ant> LOL
03:02PM Tarzan> w00t
[03:02pm] Ant> silly bots
03:02PM Tarzan> C++
03:02PM Bender> Tarzan: C now has 3 points!
03:02PM Flexo> Tarzan: C now has 3 points!
...
this is like the never ending story with this plugin :D
what do you think should be done there, forbid single characters from getting the points?
C++ is a tricky one. Hahaha. I'd say leave it. Maybe we need more pluses and minuses? Or how about we tell rbots directly like flexo: C++
...
[01:10pm] * Ant drools all over https://www.youtube.com/watch?v=RFXLRvJguEw
01:10PM URL> [ C&C REMASTERED - TIBERIAN DAWN | EVA Installation / Upgrade REMASTERED Cutscenes
[2020] - YouTube ] - www.youtube.com
[01:10pm] * Ant remembers its DOS version.
[01:13pm] * Ant can't wait to see a Linux port of it from its open sourced code.
[01:13pm] Ant> EA++
01:13PM Bender> Ant: EA now has 2 points!
01:18PM Mousey> ew
[01:18pm] Ant> Open source!
01:24PM Tarzan> EA--
01:24PM Bender> Tarzan: EA now has 1 points!
[01:24pm] Ant> ?!
01:24PM Tarzan> EA sucks
[01:24pm] Ant> I meant for their C&C Remastered!!
[01:24pm] Ant> Source code too!
01:24PM AfterShock> agreed, EA sucks
01:24PM AfterShock> EA--
01:24PM Bender> AfterShock: EA now has 0 points!
[01:24pm] Ant> bah
01:24PM Tarzan> EA-- for double sucking
01:24PM Bender> Tarzan: EA now has -1 points!
01:24PM AfterShock> C&C++
01:24PM Bender> AfterShock: C&C now has 1 points!
[01:25pm] Ant> EA owns C&C. :/
01:25PM Tarzan> Westwood++
01:25PM Bender> Tarzan: Westwood now has 1 points!
01:25PM AfterShock> yeah well
[01:25pm] Ant> If you want to give credit. It would be Westwood Studios.
[01:25pm] Ant> EA ate them up!
01:25PM Tarzan> Westwood Studios++
01:25PM Bender> Tarzan: Studios now has 1 points!
[01:25pm] Ant> C&C4--
01:25PM Bender> Ant: C&C4 now has -1 points!
[01:25pm] Ant> lol
[01:25pm] Ant> "Westwood Studios"++
01:25PM Bender> Ant: Studios" now has 1 points!
[01:25pm] Ant> damn
[01:25pm] Ant> doesn't work
[01:25pm] * Ant reports it!
01:26PM AfterShock> the tokenizer is insufficiently sophisticated
[01:26pm] Ant> I guess you will have to WestwoodStudios++
01:26PM Bender> Ant: WestwoodStudios now has 1 points!
01:26PM AfterShock> it just breaks on space
01:26PM AfterShock> hmm interesting, can do in the middle of a line
01:26PM AfterShock> so, if I posted C code
01:26PM AfterShock> for (int c=0; c<10; c++) {}
01:26PM AfterShock> nope
01:27PM AfterShock> for (int c=0; c<10; c++ ) {}
01:27PM Bender> AfterShock: c now has 1 points!
01:27PM AfterShock> HA!
[01:27pm] Ant> yeah I mentioned that issue to the rbot guy
01:27PM AfterShock> so any (naive) token that ends in ++ causes it to trigger
...
FYI:
...
[03:36pm] Ant> bender points c++
03:36PM Bender> Ant: c now has 2 points!
03:36PM Bender> Ant: c++ has zero points
[03:36pm] Ant> heh
03:36PM util> c++++
03:36PM util> bender points util++
03:36PM Bender> util++ has zero points
...
FYI:
...
[03:36pm] Ant> bender points c++
03:36PM Bender> Ant: c now has 2 points!
03:36PM Bender> Ant: c++ has zero points
[03:36pm] Ant> heh
03:36PM util> c++++
03:36PM util> bender points util++
03:36PM Bender> util++ has zero points
...
FYI:
...
[03:36pm] Ant> bender points c++
03:36PM Bender> Ant: c now has 2 points!
03:36PM Bender> Ant: c++ has zero points
[03:36pm] Ant> heh
03:36PM util> c++++
03:36PM util> bender points util++
03:36PM Bender> util++ has zero points
...