Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Coś dla skryptera Xenobot


Killer1918

Rekomendowane odpowiedzi

Opublikowano

Siemka
Pobrałem z forum xenobota skrypt na POH ale gdy zmieniam w nim koszt potów i ile ma ich kupić i załączam skrypt pokazuje error....
Gdy nic nie zmieniam jest ok i nie wiem o co chodzi.
Proszę o pomoc, chce aby bot kupował zwykłe mana potki i health potki.

--.......╗...╗   ..╗ ......╗  ......╗ ......╗  .....╗ .......╗              .......╗ ......╗......╗ ..╗......╗ ........╗.......╗--
--..╔════╝....╗  ..║..╔═══..╗..╔═══..╗..╔══..╗..╔══..╗..╔════╝              ..╔════╝..╔════╝..╔══..╗..║..╔══..╗╚══..╔══╝..╔════╝
--.......╗..╔..╗ ..║..║   ..║..║   ..║..║  ..║.......║.......╗    .....╗    .......╗..║     ......╔╝..║......╔╝   ..║   .......╗--
--╚════..║..║╚..╗..║..║   ..║..║   ..║..║  ..║..╔══..║╚════..║    ╚════╝    ╚════..║..║     ..╔══..╗..║..╔═══╝    ..║   ╚════..║--
--.......║..║ ╚....║╚......╔╝╚......╔╝......╔╝..║  ..║.......║              .......║╚......╗..║  ..║..║..║        ..║   .......║--
--╚══════╝╚═╝  ╚═══╝ ╚═════╝  ╚═════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝              ╚══════╝ ╚═════╝╚═╝  ╚═╝╚═╝╚═╝        ╚═╝   ╚══════╝--
                                                                                                                              
-----------------------------------------------------Snoodas - Scripts - Xenobot------------------Library-10-09-14----------------																									  
		
---------BACKPACKS------
local MainBP = "Purple Backpack"
local LootBackpack = "Demon Backpack"
local GoldBackpack = "Beach Backpack"
local SuppliesBackpack = "Golden Backpack" --Bolt/Arrow Backpack--

---------POTIONS--------
local ManaName = "Mana Potion"
local BuyMana = 125 -- how many mana potions to buy
local LeaveMana = 25 -- how many potions to leave the spawn
local ManaCost = 50 -- price?
--Mana potion=50gp, Strong Mana potion=80gp, Great mana potion=120gp

-----------------------------------------------------------------------
local HealthName = "Health potion"
local BuyHealth = 15 -- how many health potions to buy
local LeaveHealth = 5 -- how many potions to leave the spawn
local HealthCost = 45 --price?
--Health potion=45gp, Strong health potion=100gp, Great health potion=190gp, Ultimate health potion=310gp

-------Ammunition---------
local AmmoName = "Arrow" -- what ammunition/runes are you using?
local BuyAmmo = 700 -- how many ammunition to buy
local LeaveAmmo = 200 -- how much ammunition to leave the spawn
local AmmoCost = 4 -- price?

--Paladins: Royal Spear=15gp, Spear=9gp, Arrow=3gp, Bolt=4gp, Crystalline Arrow/Prismatic Bolt=20gp
--Mages: Great Fireball Rune=45gp, Avalanche Rune=45gp, Sudden Death Rune=108gp
--Knights: Explosion Rune=31gp, Great Fireball Rune=45gp, Heavy Magic Missile Rune=12gp

------------------------------OTHER OPTIONS-----------------------------------------
local MinCap = 0 -- Recommended 0, will hunt until your potions are finished.
local HideEquipment = true --- Do you want to minimize your equipment?
local LogoutStamina = true --- Do you want to logout at 16 hours? (Inside the depot)
local DropVials = true --- Dropping all Vials.






--                                             DO NOT EDIT BELOW!!        
------------------------......╗  ......╗ ...╗   ..╗........╗    .......╗......╗ ..╗........╗--------
------------------------..╔══..╗..╔═══..╗....╗  ..║╚══..╔══╝    ..╔════╝..╔══..╗..║╚══..╔══╝--------
------------------------..║  ..║..║   ..║..╔..╗ ..║   ..║       .....╗  ..║  ..║..║   ..║   --------
------------------------..║  ..║..║   ..║..║╚..╗..║   ..║       ..╔══╝  ..║  ..║..║   ..║   --------
------------------------......╔╝╚......╔╝..║ ╚....║   ..║       .......╗......╔╝..║   ..║   --------
------------------------╚═════╝  ╚═════╝ ╚═╝  ╚═══╝   ╚═╝       ╚══════╝╚═════╝ ╚═╝   ╚═╝   --------
                                                                    
            ---------------------......╗ .......╗..╗      ......╗ ..╗    ..╗----------------         
            ---------------------..╔══..╗..╔════╝..║     ..╔═══..╗..║    ..║----------------     
            ---------------------......╔╝.....╗  ..║     ..║   ..║..║ .╗ ..║----------------      
            ---------------------..╔══..╗..╔══╝  ..║     ..║   ..║..║...╗..║----------------        
            ---------------------......╔╝.......╗.......╗╚......╔╝╚...╔...╔╝----------------         
            ---------------------╚═════╝ ╚══════╝╚══════╝ ╚═════╝  ╚══╝╚══╝----------------         
 --                                            DO NOT EDIT BELOW!!                                      

----------------------------------------------------------------------------------------------------------------------
local ManaID = Item.GetID(ManaName)
local HealthID = Item.GetID(HealthName)
local AmmoID = Item.GetID(AmmoName)

--
local FlaskID = 283
local FlaskIDA = 284
local FlaskIDB = 285
local LeaveCap = 0 


registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
print("          ~~Snoodas Scripts~~              40+ Paladin Plains of Havoc Surface")

Targeting.Start()
Looter.Start()


function onWalkerSelectLabel(labelName)
	if (labelName == "Check") then
		print("Checking Supplies")
		Walker.ConditionalGoto((Self.ItemCount(ManaID) <= LeaveMana) or (Self.Cap() < LeaveCap) or (Self.ItemCount(HealthID) <= LeaveHealth) or (Self.ItemCount(AmmoID) <= LeaveAmmo), "Leave", "Continue")
	
	elseif (labelName == "CheckSupplies") then
	    print("Checking Supplies")
		wait(900)
		Walker.ConditionalGoto((Self.ItemCount(ManaID) <= LeaveMana) or (Self.Cap() < LeaveCap) or (Self.ItemCount(HealthID) <= LeaveHealth) or (Self.ItemCount(AmmoID) <= LeaveAmmo), "Tobank", "SkipSupplies")
		
		elseif (labelName == "SkipSupplies") then
		print("Enought Supplies")
		
		elseif (labelName == "Tobank") then
		print("To the bank! starting to re-fill")
		
		elseif (labelName == "Continue") then
		print("Enought Supplies, Continues.")
		
		elseif (labelName == "Leave") then
		print("Low Supplies, Leaving.")
		
	elseif (labelName == "BankNPC") then
		print("Depositing gold and withdraw money for supplies")
		Walker.Stop()
		Self.SayToNpc({"hi", "deposit all", "yes"}, 100)

		local withdrawManas = math.max(BuyMana - Self.ItemCount(ManaID), 0)*ManaCost
		local withdrawHealths = math.max(BuyHealth - Self.ItemCount(HealthID), 0)*HealthCost
		local withdrawAmmo = math.max(BuyAmmo - Self.ItemCount(AmmoID), 0)*AmmoCost
		local total = math.abs(withdrawManas + withdrawHealths + withdrawAmmo)

		if total >= 1 then
			Self.SayToNpc({"withdraw " .. total, "yes", "balance"}, 100)
		end
		Walker.Start()

	elseif (labelName == "Deposit") then
		print("Depositing the loot from hunt")
		Walker.Stop()
		Self.ReachDepot(5)
		Self.DepositItems({11467, 0}, {10291, 0}, {10283, 0}, {3112, 0}, {3028, 0}, {3027, 0}, {3033, 0}, {3415, 0}, {5909, 0}, {5914, 0}, {9641, 0}, {3032, 0}, {9685, 0}, {5905, 0}, {11449, 0}, {11457, 0}, {5877, 0}, {5920, 0}, {10320, 0}, {11475, 0}, {9631, 0}, {3035, 0}, {3026, 0}, {9057, 0}, {11456, 0}, {5910, 0}, {11512, 0}, {10280, 0}, {5925, 0}, {5930, 0}, {5893, 0}, {7368, 0}, {9647, 0})
		Self.DepositItems({3052, 1}, {3432, 1}, {3049, 1}, {10290, 1}, {3271, 1}, {3284, 1}, {3434, 1}, {3071, 1}, {3416, 1}, {3322, 1}, {7430, 1}, {3297, 1}, {3574, 1}, {3324, 1}, {3079, 1}, {8073, 1}, {7456, 1}, {830, 1}, {3098, 1}, {820, 1}, {3037, 1}, {3435, 1}, {3055, 1}, {3567, 1}, {12304, 1}, {12546, 1}, {3418, 1}, {10244, 1}, {3357, 1}, {3265, 1}, {7413, 1}, {3342, 1}, {7396, 1}, {3554, 1}, {3281, 1})
		Walker.Start()
		
	elseif (labelName == "Withdraw") then
		print("Withdraw Brown Mushrooms")
		Walker.Stop()
		Self.ReachDepot(5)
		Self.WithdrawItems(2,{3725, 0, 25})
		delayWalker(3000)
		Walker.Start()
		
		elseif (labelName == "WithdrawCoin") then
		print("Withdraw Scarabcoin")
		Walker.Stop()
		Self.ReachDepot(5)
		Self.WithdrawItems(2,{3042, 0, 1})
		delayWalker(3000)
		Walker.Start()

	elseif (labelName == "PotionsNPC") then
		print("Buying potions")
		Walker.Stop()
		if (Self.ItemCount(ManaID) < BuyMana) or (Self.ItemCount(HealthID) < BuyHealth) then
			print("Buying Potions")
			Self.SayToNpc({"hi", "flasks"}, 100)
			while (Self.ItemCount(FlaskID) >= 1) or (Self.ItemCount(FlaskIDA) >= 1) or (Self.ItemCount(FlaskIDB) >= 1) do
				Self.SayToNpc("yes", 100)
			end
			wait(2000)
			Self.SayToNpc("trade", 100)
			wait(2000)
			while (Self.ItemCount(ManaID) < BuyMana) do
				Self.ShopBuyItemsUpTo(ManaID, BuyMana)
				wait(500,800)
			end
			if (Self.ItemCount(HealthID) < BuyHealth) then
				Self.ShopBuyItemsUpTo(HealthID, BuyHealth)
				wait(500)
			end
			wait(200, 500)
		end
		Walker.Start()



	elseif (labelName == "AmmoNPC") then
		Walker.Stop()
		Self.SayToNpc({"hi", "trade"}, 100)
		while (Self.ItemCount(AmmoID) < BuyAmmo) do
			Self.ShopBuyItemsUpTo(AmmoID, BuyAmmo)
			wait(500)
		end
		Walker.Start()
		
		elseif (labelName == "Backpacks") then
		Unuke_Reset()
	end
end

Module.New("Drop vials", function(module)
if (DropVials) and Self.Cap() < MinCap then 
    Self.DropFlasks(Self.Position().x, Self.Position().y, Self.Position().z)
    end 
 module:Delay(10000, 15000)
end)
Module.New("Sort Supplies", function(module)
    local bp1 = Container(MainBP)
    for i = bp1:ItemCount() -1, 0, -1 do
     local id = bp1:GetItemData(i).id
        if  id == AmmoID then
            bp1:MoveItemToContainer(i, Container(SuppliesBackpack):Index())
            wait(600)
        end
    end
module:Delay(1000)
end)
Self.ReachDepot = function (tries)
	local tries = tries or 3
	Walker.Stop()
	local DepotIDs = {3497, 3498, 3499, 3500}
	local DepotPos = {}
	for i = 1, #DepotIDs do
		local dps = Map.GetUseItems(DepotIDs[i])
		for j = 1, #dps do
			table.insert(DepotPos, dps[j])
		end
	end
	local function gotoDepot()
		local pos = Self.Position()
		print("Depots found: " .. tostring(#DepotPos))
		for i = 1, #DepotPos do
			location = DepotPos[i]
			Self.UseItemFromGround(location.x, location.y, location.z)
			wait(1000, 2000)
			if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
				wait(5000, 6000)
				if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
					Walker.Start()
					return true
				end
			else
				print("Something is blocking the path. Trying next depot.")
			end
		end
		return false
	end
	
	repeat
		reachedDP = gotoDepot()
		if reachedDP then
			return true
		end
		tries = tries - 1
		sleep(100)
		print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
	until tries <= 0

	return false
end

Map.GetUseItems = function (id)
    if type(id) == "string" then
        id = Item.GetID(id)
    end
    local pos = Self.Position()
    local store = {}
    for x = -7, 7 do
        for y = -5, 5 do
            if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
                itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
                table.insert(store, itemPos)
            end
        end
    end
    return store
end
local Bps = {}
 
if GoldBackpack then
        table.insert(Bps,GoldBackpack)
end
if LootBackpack then
        table.insert(Bps,LootBackpack)
end
if SuppliesBackpack then
        table.insert(Bps,SuppliesBackpack)
end

function Unuke_Reset()
        Walker.Stop()
		Client.HideEquipment()
			print("Opening Backpacks")
        local tries = 3
        local n = #Bps
        Self.CloseContainers()
        local allgoodie = false
        wait(600,800)
        Self.OpenMainBackpack()
        wait(600,800)
        local main = Container(0)
        main:Minimize()
        wait(800,1000)
       
        while tries > 0 and (not allgoodie) do
                for i = 1, n do
                main:OpenChildren(Bps[i])
                wait(600,800)
                local cont = Container(Bps[i])
                cont:Minimize()
                        if cont:ID() ~= Item.GetID(Bps[i]) then
                                print("Could not find "..Bps[i]..', trying again. Tries left : '..tries)
                                allgoodie = false
                                break
                        else allgoodie = true
						print("Success!")
                        end
                end
                tries = tries-1
        end
 
        if allgoodie then Walker.Start()
        else print('Could not find all backpacks, stoping walker...')
        end
end
Opublikowano

Na 99% jestem pewien że naruszył komentarz przez co skrypt myśli że dalsza część komentarza to kod skryptu. [Mogę się mylić ale skoro wstawił CAŁY plik lua to raczej nie ma pojęcia o składni itp.]

spróbuj zamienić to w ten sposób :

---------POTIONS--------
local ManaName = "Mana Potion"
local BuyMana = 125
local LeaveMana = 25
local ManaCost = 50 
--Mana potion=50gp, Strong Mana potion=80gp, Great mana potion=120gp

-----------------------------------------------------------------------
local HealthName = "Health potion"
local BuyHealth = 15 
local LeaveHealth = 5 
local HealthCost = 45
--Health potion=45gp, Strong health potion=100gp, Great health potion=190gp, Ultimate health potion=310gp

Jeżeli to nie nic nie da to odpal ten skrypt w jakimś dobrym edytorze tekstowym i szykaj tzw. "whitesigns" [znaczniki końca linii itp. - bardzo częsty przypadek w skryptach]

Efekty jednego dnia wolnego od pracy :

lWxix4K.png

Chcesz wspomóc produkcję tego bota? Masz doświadczenie w programowaniu modułów, tworzeniu GUI czy skryptowaniu [C#]?

napisz na pw : http://www.mpcforum.pl/user/1285262-bleblable/

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...