local version = "0.1" include("addresses.lua"); include("settings.lua"); include("functions.lua"); include("macros.lua"); include("classes/inventory.lua"); settings.load(); setStartKey(settings.hotkeys.START_BOT.key); setStopKey(settings.hotkeys.STOP_BOT.key); local ORE = getTEXT("SYS_ITEMTYPE_05") local WOOD = getTEXT("SYS_ITEMTYPE_06") local HERB = getTEXT("SYS_ITEMTYPE_07") local ID = { [WOOD] = { [1] = 205223, [2] = 205224, [3] = 205225, [4] = 205226, [5] = 205227, [6] = 205228, [7] = 205229, [8] = 205230, [9] = 205231, [10]= 205232 }, [HERB] = { [1] = 204784, [2] = 204827, [3] = 204828, [4] = 205216, [5] = 205217, [6] = 205218, [7] = 205219, [8] = 205220, [9] = 205221, [10]= 205222 }, [ORE] = { [1] = 204785, [2] = 204829, [3] = 204830, [4] = 205209, [5] = 205210, [6] = 205211, [7] = 205212, [8] = 205213, [9] = 205214, [10]= 205215 } } attach(getWin()); function getType(item) if table.contains(ID[ORE],item.Id) then return ORE end if table.contains(ID[WOOD],item.Id) then return WOOD end if table.contains(ID[HERB],item.Id) then return HERB end end -- The main function function main() cprintf(cli.lightblue,"\n\tUseAll "..version.." by Rock5\n\n") -- read arguments local forcedTypes={}; for i = 2,#args do if args[i] == ORE or args[i] == WOOD or args[i] == HERB then forcedTypes[args[i]] = true else cprintf(cli.yellow,"Invalid argument '%s'. Valid arguments are '%s', '%s' and '%s'.\n\n",args[i],ORE,WOOD,HERB) return end end cprintf(cli.green,"Opening Unknown resources...\n") inventory = CInventory(); -- register inventory settings.profile.hotkeys.MACRO={} setupMacros() for k, item in pairs(inventory.BagSlot) do -- Get type local Type = getType(item) -- Check item type is valid if Type and (next(forcedTypes) == nil or forcedTypes[Type]) then -- Use them up printf("Opening %s in slot %s.\n",item.Name,item.SlotNumber) repeat -- Check if bag is full if inventory:itemTotalCount(0) == 0 then error("Bags are full") end if not item.InUse then item:use() end printf("\rRemaining... "..item.ItemCount.."\t\t") yrest(10) until item.Empty printf("\n") end end cprintf(cli.green,"\nFinished opening Unknown resources.\n") end startMacro(main, true);