Trader Simple Discounts (dtl)


Author: Dandielo
Created: 2012-09-16T14:51:25-0400
Edited: 2012-10-08T14:54:47-0400
Denizen Version: 0.76
Views: 199
Downloads: 769
Likes: 2


WGET
Description: A simple script to trigger a discount when the trader sold 40 diamonds (overall). and remove it when sold 5 more diamonds.











To use this you will need to have set either price patterns or a whole stock pattern for the trader.

P.S. Additional I'm trying out this repo :D






* Requires dtlTrader v1.9.6

"Trade":
  Type: Interact
  Requirements:
    Mode: None
  Steps:
    1:
      Click Trigger:
        Script:
        - ^TRADER_TRANSACTION START SELL
      Sold Trigger:
        Script:
        - ^IF FLAG:TransactionItem:Diamond SCRIPT:Count_Diamond_Sold

Count_Diamond_Sold:
  Type: Task
  Script: 
  - ^FLAG 'Transactions:++' GLOBAL
  - ^IF GLOBAL EXACTLY FLAG:Transactions:40 SCRIPT:Discount_Pattern
  - ^IF GLOBAL FLAG:Transactions:45 SCRIPT:Basic_Pattern

Discount_Pattern:
  Type: Task
  Script:
  - ^TRADER_PATTERN SET PAT:discount
  - ^CHAT "We got a discount on all items!"
  
Basic_Pattern:
  Type: Task
  Script:
  - ^TRADER_PATTERN SET PAT:default
  - ^CHAT "The discount is over!"
  - ^FLAG Transactions:0 GLOBAL




Comments
2012-09-16 19:02:21 - aufdemrand:

Great!
2012-12-29 17:21:35 - Dandielo:

outdated! going to update with denizen 0.8