3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 03:49:29 +01:00

doc/Plugins/Plang.md: Slightly simplify karma example

This commit is contained in:
Pragmatic Software 2020-10-01 18:01:05 -07:00
parent a49df678e7
commit 51dabf2bf4

View File

@ -118,12 +118,12 @@ we'll use PBot's special factoid variable `$arg[0]`.
First we add the `++` command.
<pragma-> !factadd ++ /call plang var karma = Integer(factget('#karma-data', '$arg[0]')); karma += 1; factset('#karma-data', '$arg[0]', String(karma));
<pragma-> !factadd ++ /call plang var karma = Integer(factget('#karma-data', '$arg[0]')); factset('#karma-data', '$arg[0]', String(karma + 1));
<PBot> ++ added to global channel.
Similarly, we add the `--` command.
<pragma-> !factadd -- /call plang var karma = Integer(factget('#karma-data', '$arg[0]')); karma -= 1; factset('#karma-data', '$arg[0]', String(karma));
<pragma-> !factadd -- /call plang var karma = Integer(factget('#karma-data', '$arg[0]')); factset('#karma-data', '$arg[0]', String(karma - 1));
<PBot> -- added to global channel.
Finally, we add the `karma` command.