Dice Rolls in a mini window - MUSHclient
Posted: Sun Mar 30, 2014 11:56 am
What this trigger does is displays a mini-window showing the value of dice thrown in game. The two aliases allow you to toggle the window off an on using the commands DICE SHOW and DICE HIDE.
First, download each of the files below and save them to your MUSHclient folder:
http://s000.tinyupload.com/index.php?fi ... 5031179530
http://s000.tinyupload.com/index.php?fi ... 2138525818
http://s000.tinyupload.com/index.php?fi ... 4891722109
http://s000.tinyupload.com/index.php?fi ... 5568084142
http://s000.tinyupload.com/index.php?fi ... 8748349537
http://s000.tinyupload.com/index.php?fi ... 0381833994
Second, copy the trigger and aliases below and paste them in MUSHclient:
For help on how to copy/paste triggers and aliases into MUSHclient: http://mushclient.com/pasting
<triggers>
<trigger
enabled="y"
match="The dice thrown by * roll to a stop, showing * and *."
sequence="100"
>
<send>dice = "throw_" .. GetPluginID ()
WindowCreate (dice, 0, 0, 200, 100, miniwin.pos_top_left, 0, ColourNameToRGB("white")) -- create window
-- If the dice .bmp files are saved to a different location other than what is listed below, you will need to change the location on each of the following lines.
WindowLoadImage (dice, "Dice1", "C:/program files/mushclient/Dice1.bmp")
WindowLoadImage (dice, "Dice2", "C:/program files/mushclient/Dice2.bmp")
WindowLoadImage (dice, "Dice3", "C:/program files/mushclient/Dice3.bmp")
WindowLoadImage (dice, "Dice4", "C:/program files/mushclient/Dice4.bmp")
WindowLoadImage (dice, "Dice5", "C:/program files/mushclient/Dice5.bmp")
WindowLoadImage (dice, "Dice6", "C:/program files/mushclient/Dice6.bmp")
if %2 == 1 then -- first die
WindowDrawImage (dice, "Dice1", 0, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %2 == 2 then
WindowDrawImage (dice, "Dice2", 0, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %2 == 3 then
WindowDrawImage (dice, "Dice3", 0, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %2 == 4 then
WindowDrawImage (dice, "Dice4", 0, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %2 == 5 then
WindowDrawImage (dice, "Dice5", 0, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %2 == 6 then
WindowDrawImage (dice, "Dice6", 0, 0, 0, 0, 1, 0, 0, 0, 0)
end -- first die
if %3 == 1 then -- second die
WindowDrawImage (dice, "Dice1", 101, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %3 == 2 then
WindowDrawImage (dice, "Dice2", 101, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %3 == 3 then
WindowDrawImage (dice, "Dice3", 101, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %3 == 4 then
WindowDrawImage (dice, "Dice4", 101, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %3 == 5 then
WindowDrawImage (dice, "Dice5", 101, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %3 == 6 then
WindowDrawImage (dice, "Dice6", 101, 0, 0, 0, 1, 0, 0, 0, 0)
end -- second die
WindowShow (dice, true) -- show the pair of dice
</send>
</trigger>
</triggers>
<aliases>
<alias
match="dice hide"
enabled="y"
send_to="12"
sequence="1"
>
<send>WindowShow (dice, false)</send>
</alias>
</aliases>
<aliases>
<alias
match="dice show"
enabled="y"
send_to="12"
sequence="1"
>
<send>WindowShow (dice, true)</send>
</alias>
</aliases>
First, download each of the files below and save them to your MUSHclient folder:
http://s000.tinyupload.com/index.php?fi ... 5031179530
http://s000.tinyupload.com/index.php?fi ... 2138525818
http://s000.tinyupload.com/index.php?fi ... 4891722109
http://s000.tinyupload.com/index.php?fi ... 5568084142
http://s000.tinyupload.com/index.php?fi ... 8748349537
http://s000.tinyupload.com/index.php?fi ... 0381833994
Second, copy the trigger and aliases below and paste them in MUSHclient:
For help on how to copy/paste triggers and aliases into MUSHclient: http://mushclient.com/pasting
<triggers>
<trigger
enabled="y"
match="The dice thrown by * roll to a stop, showing * and *."
sequence="100"
>
<send>dice = "throw_" .. GetPluginID ()
WindowCreate (dice, 0, 0, 200, 100, miniwin.pos_top_left, 0, ColourNameToRGB("white")) -- create window
-- If the dice .bmp files are saved to a different location other than what is listed below, you will need to change the location on each of the following lines.
WindowLoadImage (dice, "Dice1", "C:/program files/mushclient/Dice1.bmp")
WindowLoadImage (dice, "Dice2", "C:/program files/mushclient/Dice2.bmp")
WindowLoadImage (dice, "Dice3", "C:/program files/mushclient/Dice3.bmp")
WindowLoadImage (dice, "Dice4", "C:/program files/mushclient/Dice4.bmp")
WindowLoadImage (dice, "Dice5", "C:/program files/mushclient/Dice5.bmp")
WindowLoadImage (dice, "Dice6", "C:/program files/mushclient/Dice6.bmp")
if %2 == 1 then -- first die
WindowDrawImage (dice, "Dice1", 0, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %2 == 2 then
WindowDrawImage (dice, "Dice2", 0, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %2 == 3 then
WindowDrawImage (dice, "Dice3", 0, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %2 == 4 then
WindowDrawImage (dice, "Dice4", 0, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %2 == 5 then
WindowDrawImage (dice, "Dice5", 0, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %2 == 6 then
WindowDrawImage (dice, "Dice6", 0, 0, 0, 0, 1, 0, 0, 0, 0)
end -- first die
if %3 == 1 then -- second die
WindowDrawImage (dice, "Dice1", 101, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %3 == 2 then
WindowDrawImage (dice, "Dice2", 101, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %3 == 3 then
WindowDrawImage (dice, "Dice3", 101, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %3 == 4 then
WindowDrawImage (dice, "Dice4", 101, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %3 == 5 then
WindowDrawImage (dice, "Dice5", 101, 0, 0, 0, 1, 0, 0, 0, 0)
elseif %3 == 6 then
WindowDrawImage (dice, "Dice6", 101, 0, 0, 0, 1, 0, 0, 0, 0)
end -- second die
WindowShow (dice, true) -- show the pair of dice
</send>
</trigger>
</triggers>
<aliases>
<alias
match="dice hide"
enabled="y"
send_to="12"
sequence="1"
>
<send>WindowShow (dice, false)</send>
</alias>
</aliases>
<aliases>
<alias
match="dice show"
enabled="y"
send_to="12"
sequence="1"
>
<send>WindowShow (dice, true)</send>
</alias>
</aliases>