The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Can anyone tell me why this BBCode will not work? It's not passing parameters to the vbscript. (sub-Question: Is vbscript supported?)
BBCode Example: [Dice="Climb check"]d20+13[/dice] Desired HTML Output: Roll Climb Check 22 ***************** <html> <head> <script type="text/vbscript"> function rolldice(by Val inDice) 'Init Variables Dim numDice, typeDice, bonusDice, rollDice Dim tmpDice, diceRoll 'Parse dice string numDice = mid(inDice, 1, (len(InDice)-inStr(inDice,"d"))) typeDice = mid(inDice, inStr(inDice, "d"), (inStr(inDice,"+")-inStr(inDice,"d")) bonusDice = mid(inDice, inStr(inDice, "+"), (len(InDice)-inStr(inDice,"+"))) Randomize 'Roll the die For i = 1 to numDice tmpDice = Int((typeDice * Rnd) + 1) diceRoll = diceRoll + tmpDice Next 'Give the function a value to return rollDice = diceRoll + bonusDice end function </script> </head> <body> var_Option = {option} var_Param = {param} <script type="text/vbscript"> document.write(Roll " var_Option ", " rolldice(var_Param)) </script> </body> </html> ***************** |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|