MyBB.de Forum
Dice Roller MyCode - Druckversion

+- MyBB.de Forum (https://www.mybb.de/forum)
+-- Forum: Anpassungen (https://www.mybb.de/forum/forum-47.html)
+--- Forum: Plugin-Veröffentlichungen und -Support (https://www.mybb.de/forum/forum-82.html)
+--- Thema: Dice Roller MyCode (/thread-34396.html)



Dice Roller MyCode - MyBB.de Bot - 14.03.2017

Eine neue Erweiterung wurde veröffentlicht: Dice Roller MyCode

Zitat:Roll dice in a variety of exciting ways via MyCode! 

Live Preview Dependencies
  • PluginLibrary
    • Version 1.8.X

    • Download and transfer inc/plugins/pluginlibrary.php to your inc/plugins folder.

    • You do not need to install or activate PluginLibrary.

    • Dice Roller MyCode uses PluginLibrary to run a new hook in class_parser.php, in order to correctly seed quoted rolls.
Features
  • Multiple syntaxes, including low-high, NdS, and weighted lists -- including offsets!

  • Customizable templates for each component

  • Enable or disable sum of NdS rolls

  • Add aliases as shorthand for complicated rolls

  • Add unique result messages and the range of sums at which they display for each roll

  • Add unique resource lists to display an item from for each die in a roll

  • Tamper proof! Rolls cannot be edited to abuse RNG or cherry picked.

  • Quoted rolls retain their original values.

  • Rolls wrapped in code or PHP tags are not parsed.
Syntax
  • [roll=low-high]
    • Rolls a single dice with values between low and high, inclusive.

    • e.g. [roll=1-10] 

    • potential output - Rolling 1-10: 5

  • [roll=low-high+/-F]
    • Rolls a single dice with values between low and high, inclusive. Adds or subtracts the given offset F.

    • e.g. [roll=1-10+5]

    • potential output  - Rolling 1-10: 2 + 5 = 7

    • [roll=1-10-5]

    • potential output - Rolling 1-10: 2 - 5 = -3

  • [roll=dS]
    • Rolls a single dice with with values between 1 and S, inclusive.

    • e.g. [roll=d6]

    • potential output - Rolling d6: 4

  • [roll=NdS]
    • Rolls N dice with values between 1 and S, inclusive.

    • e.g. [roll=3d6]

    • potential output - Rolling 3d6: 4 + 2 + 6 = 12

  • [roll=dS+/F]
    • Rolls a single dice with values between low and high, inclusive. Adds or subtracts the given offset F.

    • e.g. [roll=d6+5]

    • potential output - Rolling d6+5: 4 + 5 = 9

  • [roll=NdS+/-F]
    • Rolls N dice with values between 1 and S, inclusive. Adds or subtracts the given offset F.

    • e.g. [roll=3d6+20]

    • potential output - Rolling 3d6+20: 4 + 1 + 6 + 20 = 31

  • [roll=weighted list]
    • Rolls a single dice with as many values as there are items in weighted list. Each item in weighted list represents how likely that index is to be selected.

    • e.g. [roll=25,25,50] gives 1 a 25% chance to be rolled, 2 a 25% chance, and 3 a 50% chance.

    • potential output - Rolling 25,25,50: 3
Known Issues
  • [roll=*] cannot be previewed. This is not a planned feature due to the possibility of abuse and due to incompatibility with the way rolls are seeded. (Previewed posts don't have a post ID!)



RE: Dice Roller MyCode - Tini93 - 26.04.2017

Hallo,

ich habe dieses Plugin installiert und funktioniert soweit auch gut. Nun gibt es ein Problem. Wenn ich etwas in den normalen Code-Tag posten möchte, zeigt er mir die Variable
Code:
{diceroller-code}
an.

Hat jemand eine Lösung?

lg


RE: Dice Roller MyCode - SvePu - 26.04.2017

Versuch mal bitte, ob es geht, wenn du in der inc/plugins/diceroller.php:

PHP-Code:
$plugins->add_hook("parse_message_start""diceroller_code"); 

durch:
PHP-Code:
$plugins->add_hook("parse_message_end""diceroller_code"); 

ersetzt.


RE: Dice Roller MyCode - Tini93 - 26.04.2017

Ich danke dir! Das war die Lösung. Smile

lg


RE: Dice Roller MyCode - SvePu - 26.04.2017

Schön, dass es geklappt hat....


RE: Dice Roller MyCode - MyBB.de Bot - 03.05.2017

Eine neue Version wurde veröffentlicht: Dice Roller MyCode 1.2.0


RE: Dice Roller MyCode - Santhony - 11.06.2018

Hallo und guten Morgen.
Ich habe da mal eine Frage, wie man dieses Add On am besten als Button-Funktion einbauen kann, da man ja auch eigene Würfelanweisungen eingeben kann.
Bei mir ist es so, dass meine User jeden Tag drei mal würfeln dürfen.
Die Anforderungen wären dabei [roll=x][roll=y][roll=z]

Wie man einen button erstellt, dafür gibts ja genug tutorials, wobei die ja dann direkt die php/html/script Infos mit verbauen.
Aber in diesem Fall wird ja ein mycode abgerufen, der ja über das Add-On dann deffiniert wird und ich den ja nicht einfach mal so da verbauen kann.

Wie kann ich also (am besten eben mit Klick auf einem Button) alle drei Würfelanforderungen auf einmal auswerfen lassen?

Vielen Dank im Vorfeld für Hilfen/Rückantworten/Tips

MfG
Santhony


RE: Dice Roller MyCode - Santhony - 18.06.2018

Hallo und guten Morgen.

Zu meinem obigen Anliegen kommt nun wieder eine Problem-Angelegenheit,  die ja bereits angesprochen wurde:

(26.04.2017, 17:57)SvePu schrieb: Versuch mal bitte, ob es geht, wenn du in der inc/plugins/diceroller.php:

PHP-Code:
$plugins->add_hook("parse_message_start""diceroller_code"); 

durch:
PHP-Code:
$plugins->add_hook("parse_message_end""diceroller_code"); 

ersetzt.

Mit dieser Anweisung wurde die Variable tatsächlich "ausgeblendet".
Aber nun wirft er mir direkt auch innerhalb des Code-Tags direkt das Ergebnis des Wurfes aus, was er ja eigentlich auch nicht machen dürfte?

Vielen Dank im Voraus für Tipps oder Hinweise.

MfG
Santhony