Changeset a59347fe3cc3a7fb05360bf2952952fb9cf01d28 for wow
- Timestamp:
- 08/01/09 17:33:57 (3 years ago)
- Children:
- b72b78844ce1632d3f525227861f9c64dffaf5de
- Parents:
- 8fde61c725a377c23540eb34f741f1555596a414
- git-committer:
- unknown <Administrator@…> (08/01/09 17:33:57)
- File:
-
- 1 edited
-
wow/CashControl/CashControl.lua (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wow/CashControl/CashControl.lua
r8cf6e41 ra59347f 54 54 type = "input", 55 55 name = "fixedcost", 56 desc = "Specify the fixed cost of components needed for a recipe: /cc fixed [recipe index] [[x]g] [[y]s] [[z]c]",56 desc = "Specify the fixed cost of components needed for a recipe: /cc fixedcost [recipe index] [[x]g] [[y]s] [[z]c]", 57 57 set = "SetRecipeFixedCost", 58 },59 numitems = {60 type = "input",61 name = "numitems",62 desc = "Specify the number of items produced by a recipe: /cc numitems [recipe index] [num items] (default: 1)",63 set = "SetRecipeNumItems",64 58 }, 65 59 reset = { 66 60 type = "execute", 67 61 name = "reset", 68 desc = "Reset database ",62 desc = "Reset database - All recipes and history is lost, this cannot be undone !", 69 63 func = "Reset", 70 64 }, … … 149 143 count = tonumber(count) 150 144 local cost = self:ParseMoneyString(cost_string) 145 if cost == nil then 146 CashControl:Print("Invalid money string: ", cost_string) 147 return 148 end 151 149 local reagent_name = db.reagents[reagent_index] 152 150 if reagent_name == nil then … … 324 322 end 325 323 326 function CashControl:SetRecipeNumItems(info, input)327 local db = self.db.factionrealm328 local i1, i2, recipe_index, count = string.find(input, "^ *(%d+) +(%d+) *$")329 if i1 == nil then330 CashControl:Print(string.format("You must specify a recipe index and an items count: /cc numitems [recipe index] [count]"))331 return332 end333 recipe_index = tonumber(recipe_index)334 count = tonumber(count)335 local recipe_name = db.recipes[recipe_index]336 db.recipes_specs[recipe_name].num_items = count337 CashControl:Print(string.format("%s produces %d items", recipe_name,338 count))339 end340 341 324 function CashControl:Reset() 342 325 -- Reset database to defaults … … 395 378 -- 396 379 local db = self.db.factionrealm 397 local i1, i2, recipe_index, cost = string.find(input, "^ *(%d+) +(.+)$")380 local i1, i2, recipe_index, cost_string = string.find(input, "^ *(%d+) +(.+)$") 398 381 if i1 == nil then 399 382 CashControl:Print(string.format( … … 402 385 end 403 386 recipe_index = tonumber(recipe_index) 404 cost = self:ParseMoneyString(cost)387 local cost = self:ParseMoneyString(cost_string) 405 388 if cost == nil then 389 CashControl:Print("Invalid money string: ", cost_string) 406 390 return 407 391 end … … 428 412 CashControl:Print(" Recipe:") 429 413 for reagent, count in pairs(specs.comps) do 430 CashControl:Print(string.format(" %s*%d", reagent, count)) 431 end 432 CashControl:Print(" Items per craft: "..specs.num_items) 414 CashControl:Print(string.format(" %s x %d", reagent, count)) 415 end 433 416 CashControl:Print(" Fixed cost: "..GetCoinTextureString(specs.fixed_cost)) 434 417 end … … 445 428 comps = {}, 446 429 fixed_cost = 0, 447 num_items = 1,448 430 } 449 431 end
Note: See TracChangeset
for help on using the changeset viewer.
