Advertisement
Guest User

DemonMUSH_Auction

a guest
Mar 23rd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 9.89 KB | None | 0 0
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE muclient>
  3. <!-- Saved on Sunday, March 17, 2019, 2:43 AM -->
  4. <!-- MuClient version 5.06-pre -->
  5.  
  6. <!-- Plugin "DemonMUSH_Auction" generated by Plugin Wizard --> 
  7.  
  8. <muclient>
  9. <plugin
  10.   name="DemonMUSH_Auction"
  11.   author="Soth"
  12.   id="c2d74453d9e1ec38be0633f2"
  13.   language="Lua"
  14.   purpose="Send bidding info to the 'demonauc' channel and track auction earnings/spendings"
  15.   date_written="2019-03-15 23:10:57"
  16.   requires="4.92"
  17.   save_state = "y"
  18.   version="1.1"
  19.   >
  20.  
  21. </plugin>
  22.  
  23.  
  24. <!--  Get our standard constants -->
  25.  
  26. <include name="constants.lua"/>
  27.  
  28. <!--  Triggers  -->
  29. -- Please wait until the auction closes on the current item.
  30. <triggers>
  31.   <trigger
  32.   enabled="y"
  33.   match="(* gold paid to the mud for auctioning fees)"
  34.   send_to="12"
  35.   sequence="100"
  36.  >
  37.   <send>fee = %1
  38.         feesTotal = feesTotal + fee
  39.         SetVariable("feesTotalSave", feesTotal)
  40.         playerAuctioned = true
  41.         SaveState()</send></trigger>
  42.   <trigger
  43.   enabled="y"
  44.   match="Auction house fee is *.  You receive * gold coins!"
  45.   send_to="12"
  46.   sequence="100"
  47.  >
  48.   <send>fee = %1
  49.         feesTotal = feesTotal + fee
  50.         SetVariable("feesTotalSave", feesTotal)
  51.         playerAuctioned = true
  52.         SaveState()</send></trigger>
  53.   <trigger
  54.   enabled="y"
  55.   match="Item sold for * gold coins."
  56.   send_to="12"
  57.   sequence="100"
  58.  >
  59.   <send>goldGain = %1
  60.         goldEarned = goldEarned + goldGain
  61.         SetVariable("goldEarnedSave", goldEarned)
  62.         SaveState()</send></trigger>
  63.   <trigger
  64.   enabled="y"
  65.   match="(auction) Starting bid on '*' at * gold."
  66.   omit_from_output="y"
  67.   send_to="12"
  68.   sequence="100"
  69.  >
  70.   <send>itemString = "%1"
  71.         if playerAuctioned == true then
  72.             playerAuctioned = false
  73.             if itemInsult ~= "null" and itemInsult ~= nil then
  74.                 itemStartBid = %2
  75.                 attemptedEarn = attemptedEarn + itemStartBid
  76.                 SetVariable("attemptedEarnSave", attemptedEarn)
  77.                 if playerTitle ~= "default" then
  78.                     SendNoEcho("demonauc "..playerTitle.." Started the bidding on item '%1' at '%2' gold.")
  79.                 else
  80.                     SendNoEcho("demonauc Started the bidding on item '%1' at '%2' gold.")
  81.                 end
  82.                 itemInsult = "null"
  83.                 SaveState()
  84.             end
  85.         end</send></trigger>
  86.   <trigger
  87.   enabled="y"
  88.   match="Current bid is * gold coins for '*'."
  89.   send_to="12"
  90.   sequence="100"
  91.  >
  92.   <send>itemString = "%2"</send></trigger>
  93.   <trigger
  94.   enabled="y"
  95.   match="* gold coins put up in escrow."
  96.   send_to="12"
  97.   sequence="100"
  98.  >
  99.   <send>if itemBidAmt ~= "null" and itemBidAmt ~= nil then
  100.             if playerTitle ~= "default" then
  101.                 SendNoEcho("demonauc "..playerTitle.." Placed a bid of '"..itemBidAmt.."' gold on item "..itemString..".")
  102.             else
  103.                 SendNoEcho("demonauc Placed a bid of '"..itemBidAmt.."' gold on item "..itemString..".")
  104.             end
  105.             itemBidAmt = "null"
  106.         end</send></trigger>
  107.   <trigger
  108.   enabled="y"
  109.   match="* tells you, 'badge *'"
  110.   omit_from_output="y"
  111.   send_to="14"
  112.   keep_evaluating="y"
  113.   sequence="100"
  114.  >
  115.   <send>checkName = "%1"
  116.         if checkName == "Soth" or checkName == "Carver" or checkName == "A terrible winged Demon" then
  117.             if "%2" == "badge" then
  118.                 playerTitle = "%3"
  119.                 SetVariable("playerTitleSave", playerTitle)
  120.                 print("")
  121.                 ColourNote("ghostwhite", "indigo", "You have been awarded the "..playerTitle.." badge for the demonauc channel!")
  122.                 SaveState()
  123.             else
  124.                 ColourNote("cyan","black", "%1 tells you, '%2 %3'")
  125.             end
  126.         else
  127.             ColourNote("cyan","black", "%1 tells you, '%2 %3'")
  128.         end</send></trigger>
  129.   <trigger
  130.   enabled="y"
  131.   match="cuadFight string: *"
  132.   omit_from_output="y"
  133.   send_to="12"
  134.   sequence="100"
  135.  >
  136.   <send>opponent = "%1"</send></trigger>
  137. </triggers>
  138.  
  139.  
  140. <!--  Aliases  -->
  141.  
  142. <aliases>
  143.   <alias
  144.   match="auction *"
  145.   enabled="y"
  146.   send_to="12"
  147.   sequence="100"
  148.  >
  149.   <send>itemInsult = "%1"
  150.         SendNoEcho("auction %1")
  151.         DoAfterSpecial(2, "itemInsult = 'null'", sendto.script)</send></alias>
  152.   <alias
  153.   match="bid *"
  154.   enabled="y"
  155.   send_to="12"
  156.   sequence="100"
  157.  >
  158.   <send>itemBidAmt = "%1"
  159.         SendNoEcho("bid %1")
  160.         DoAfterSpecial(3, "itemBidAmt = 'null'", sendto.script)</send></alias>
  161.   <alias
  162.   match="challenge *"
  163.   enabled="y"
  164.   send_to="12"
  165.   sequence="100"
  166.  >
  167.   <send>opponent = "%1"
  168.         SendNoEcho("fin "..opponent.." |prefix cuad|grep Fight")
  169.         DoAfterSpecial(2, "if opponent ~= nil then SendNoEcho('demonauc Challenges '..opponent..' to a bidding war!') end", sendto.script)</send></alias>
  170.   <alias
  171.   match="brag ledger"
  172.   enabled="y"
  173.   send_to="12"
  174.   sequence="100"
  175.  >
  176.   <send>Execute("brag say ledger")</send></alias>
  177.    <alias
  178.   match="show ledger"
  179.   enabled="y"
  180.   send_to="12"
  181.   sequence="100"
  182.  >
  183.   <send>Execute("show my ledger")</send></alias>
  184.   <alias
  185.   match="* * ledger"
  186.   enabled="y"
  187.   send_to="12"
  188.   ignore_case="y"
  189.   sequence="100"
  190.  >
  191.   <send>userInput = "%1 %2"
  192.         goldEarnedTotal = goldEarned - feesTotal
  193.         if userInput == "brag %2" then
  194.              Send("%2 I have attempted to earn '"..attemptedEarn.."' gold coins from Auction, profited '"..goldEarnedTotal.."' gold coins, and paid '"..feesTotal.."' gold coins in auctioning fees. ")
  195.         elseif userInput == "show my" then     
  196.             print("")
  197.             ColourNote ("darkviolet", "black", "You have attempted to earn '"..attemptedEarn.."' gold coins from Auction, profited '"..goldEarnedTotal.."' gold coins, and paid '"..feesTotal.."' gold coins in auctioning fees. ")
  198.         end</send></alias>
  199.   <alias
  200.   match="demon auc* *"
  201.   enabled="y"
  202.   send_to="12"
  203.   ignore_case="y"
  204.   sequence="100"
  205.  >
  206.   <send>userInput = "%2"
  207.         if userInput == "clear" then
  208.             SetVariable("goldEarnedSave", 0)
  209.             SetVariable("attemptedEarnSave", 0)
  210.             SetVariable("feesTotalSave", 0)
  211.             print("")
  212.             ColourNote ("ghostwhite", "indigo", "Your Demon Auction ledger has been cleared.")
  213.         elseif userInput == "help" then
  214.             print("")
  215.             ColourNote("ghostwhite", "indigo", "Demon Auction Manual")
  216.             print("")
  217.             ColourNote ("ghostwhite", "indigo", "Main commands")
  218.             ColourNote ("darkviolet", "black", " 'demon auction help'- Shows this help file.")
  219.             ColourNote ("darkviolet", "black", " 'show ledger' - Shows your current auction statistics.")
  220.             ColourNote ("darkviolet", "black", " 'brag ledger' - Brags your current auction statistics to room.")
  221.             ColourNote ("darkviolet", "black", " 'brag &lt;channel&gt; ledger' - Brags your current auction statistics to specified channel.")
  222.             ColourNote ("darkviolet", "black", " 'demon auction clear'- Clears your Demon Auction ledger (Please use with care).")
  223.             --ColourNote ("darkviolet", "black", " 'challenge &lt;player&gt;' - Challenges a player to a bidding war on the demonauc channel.")
  224.             print("")
  225.             ColourNote("ghostwhite", "indigo", "Important Notice:")
  226.             --                                 ^                                                                                ^
  227.             ColourNote ("darkviolet", "black", " The main purpose of Demon Auction is to remove anonymity from buying, selling, ")
  228.             ColourNote ("darkviolet", "black", " and bidding on the auction channel by sending that information to the demonauc ")
  229.             ColourNote ("darkviolet", "black", " channel. Demon Auction users may regain their privacy by disabling the auction ")
  230.             ColourNote ("darkviolet", "black", " channel. Additionally, this plugin keeps track of your auction statistics for ")
  231.             ColourNote ("darkviolet", "black", " bragging rights and as a learning tool for up and coming auctioneers. Enjoy! ")
  232.         else
  233.             ColourNote ("red", "black", " Demon Auction command '"..userInput.."' not found. Type 'demon auction help' to learn basic usage.")
  234.         end
  235.         </send></alias>
  236.  <alias
  237.   match="cv auc"
  238.   enabled="y"
  239.   send_to="12"
  240.   ignore_case="y"
  241.   sequence="100"
  242.  >
  243.   <send>
  244.     ColourNote ("darkviolet", "black", "***^._.^*** | Auction ANALYSIS: ----------------------------- | ***^._.^***")
  245.     print("            | itemInsult        :          ",itemInsult)
  246.     print("            | itemString        :          ",itemString)
  247.     print("            | itemStartBid      :          ",itemStartBid)
  248.     print("            | itemBidAmt        :          ",itemBidAmt)
  249.     print("            | playerTitle       :          ",GetVariable('playerTitleSave'))
  250.     print("            | playerAuctioned   :          ",playerAuctioned)
  251.     print("            | opponent          :          ",opponent)
  252.     print("            | goldEarned        :          ",GetVariable('goldEarnedSave'))
  253.     print("            | attemptedEarn     :          ",GetVariable('attemptedEarnSave'))
  254.     print("            | feesTotal         :          ",GetVariable('feesTotalSave'))
  255.     ColourNote ("darkviolet", "black", "***^._.^*** | --------------------------------------------- | ***^._.^***")</send></alias> 
  256. </aliases>
  257.  
  258. <!--  Script  -->
  259. <script>
  260. <![CDATA[
  261. ----------------------------------------------------------------------------------------
  262. -- Functions
  263. ----------------------------------------------------------------------------------------
  264.     function OnPluginInstall()
  265.         ColourNote ("white", "indigo", "DemonMUSH_Auction has been installed. Type 'demon auction help' to learn more.")
  266.     end
  267.     if GetVariable("playerTitleSave") ~= nil then
  268.         playerTitle = GetVariable("playerTitleSave")
  269.     else
  270.         playerTitle = "default"
  271.     end
  272.     if GetVariable("goldEarnedSave") ~= nil then
  273.         goldEarned = GetVariable("goldEarnedSave")
  274.     else
  275.         goldEarned = 0
  276.     end
  277.     if GetVariable("attemptedEarnSave") ~= nil then
  278.         attemptedEarn = GetVariable("attemptedEarnSave")
  279.     else
  280.         attemptedEarn = 0
  281.     end
  282.     if GetVariable("feesTotalSave") ~= nil then
  283.         feesTotal = GetVariable("feesTotalSave")
  284.     else
  285.         feesTotal = 0
  286.     end
  287. ----------------------------------------------------------------------------------------
  288. -- Global Variables
  289. ----------------------------------------------------------------------------------------
  290.     itemInsult = "null"
  291.     itemString = "default"
  292.     playerAuctioned = false
  293.     goldEarnedTotal = 0
  294. ]]>
  295. </script>
  296. </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement