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

Problem ze skryptem


warrar

Rekomendowane odpowiedzi

Opublikowano

Witam, znalazlem ciekawego skrypta i chcialem do niego dorobic aby mi kupowal speary,

zrobilem to ale na tyle nieudolnie ze cos nie dziala. Wyskakuje taki błąd.

Prosiłbym o nakierowanie o co chodzi.

Do Walkera dodałem waypointy do sklepu, label BuySpear i waypointy spowrotem do dp.

 

 

 

a config przerobiłem tak:

-- Script by Rafek1241 specially for pandoriumx.com --

-- Firstly config the main settings before start script --
--Main settings--
local UseStrongPotions  = true     -- It will be start using strong health potion instead of health potions if you reach 50 level. --
local Deepling			= true    -- check 'true' if you want to go deepling scouts. Beware, hard monsters!  (but really good exp)
local MidLevel			= 30	   -- Write there the level after will be hunting on dwarf soldiers (25-30 lvl recommended). -- 
								   -- If you want to stay at dwarves/rotworms forever - set this to 999 --
local HighLevel         = 59       -- Write there the level after will be hunting on dwarf guards (50-60 lvl recommended). --
								   -- If you want to stay at dwarves soldiers forever - set this to 999 --
local PickupLoot		= true     -- It will be pickup Dwarven shield [3425]/Crossbows [3349]/Scale armors [3377]/steel helmets [3351]/battle axe [3266]/ double axe [3275] --
local ShroomLoot		= false    -- Will loot white mushrooms [3723] --
	  DwarfPickaxeLoot  = true     -- If true - will pickup from ground Dwarven Pickaxe [ID 4845] for profit. --
local TakeBpLevel		= false    -- NOT WORKING If character will reach enough level it will takes bp for gold/loot (it's for 100% afk because we --
								   -- can loss enough space for gold after reaching many lvls from 10 to xx (cap getting higher). That's why --
								   -- script will make it automatic. --
local Shops				= true   -- Do you want tu sell items which you loot? (set true if yes)
local Shortcut			= true	   -- Set true if you want to use shortcut-mechanism depositer

--- DON'T CHANGE IT ---	
if (ShroomLoot and PickupLoot) then
loadSettings("lootS", "Looter")
elseif (ShroomLoot == false and PickupLoot) then
loadSettings("lootN", "Looter")
elseif (ShroomLoot and PickupLoot == false) then
loadSettings("lootSF", "Looter")
elseif (ShroomLoot == false and PickupLoot == false) then
loadSettings("lootF", "Looter")
end

--- DON'T CHANGE IT ---

--Backpacks--

local MainBP					= "Backpack"
	  LootBP					= "Beach Backpack"
local GoldBP 					= "Blue Backpack"
--Config of mana potions--
local MaxManas					= 100 -- The amount of mana potions you want to bring
local MinManas 			     		= 20 -- The amount of mana potions you want to leave with
local ManaPrice 				= 50 -- The price of the mana potions
local ManaPot 					= "mana potion"
local MaxSpear					= 9 -- The amount of spear you want to bring					= "mana potion" -- name of potion
local MinSpear 					= 2	= "spear" -- name of ammo
local SpearPrice 				= 9 -- The price of the spear
local HealthPot					= "strong health potion"
local MinSHealth				= 10 -- Minimum strong HP
local MaxSHealth				= 20 -- Maximum strong HP
local HealthPrice				= 100
local MinHealth					= 10
local MaxHealth					= 20
--Cap--
local MinCap 					= 1 -- The amount of cap you'd like to leave at

-----------DO NOT CHANGE ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING--------------
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)		
if (labelName == "DepositingItem") then
		setWalkerEnabled(false)
		wait(1500,1900)
		local Deposit = 
						{
						 {3425, 1}, 
						 {3349, 1}, 
						 {3377, 1},
						 {3351, 1},
						 {3266, 1},						 
						 {3275, 1},
						 {9016, 1},
						 {5895, 1},
						 {3032, 0},
						 {3052, 0},
						 {12683, 1},
						 {12730, 0},
						 {9692, 0},
						 {5880, 0},
						 {3092, 1},
						 {3097, 1},
						 {3351, 1},
						 {3723, 3},
						 {4845, 1}
						 }
    if UseStrongPotions and Self.Level() > 50 then table.insert(Deposit, {266, 0}) end
	Self.DepositItems(unpack(Deposit))
		wait(1500,1900)
	if Deepling == true then
			if ((Self.ItemCount(3725)) < 100) then
                Self.WithdrawItems(3, {3725, 0, (100 - (Self.ItemCount(3725)))})
			wait(1500,1900)
			end
			if ((Self.ItemCount(3725)) < 100) then
                Self.WithdrawItems(3, {3725, 0, (100 - (Self.ItemCount(3725)))})
			wait(1500,1900)
			end
	end
		setWalkerEnabled(true)
		
	elseif (labelName == "Banker") then
    print("Withdrawing Cash")	
	Walker.Stop()
		Self.SayToNpc({"hi", "deposit all", "yes", "balance"}, 60, 5)
		local ManaSupply = (ManaPrice*(MaxManas-Self.ItemCount(ManaPot)))
		local SpearSupply = (SpearPrice*(MaxSpear-Self.ItemCount(3277)))
		local HealthSupply = (HealthPrice*(MaxHealth-Self.ItemCount(HealthPot)))
			wait(1000,3000)
			Self.WithdrawMoney((ManaSupply + HealthSupply + SpearSupply))
			wait(1000,3000)
			Self.SayToNpc("yes")
if (Shortcut == true) then
			wait(400,1000)
			Self.SayToNpc("ticket")
			wait(600,1200)
			Self.SayToNpc("yes")
end
			Walker.Start()
			
	elseif (labelName == "IfMidLevel") then
	if (Self.Level() >= MidLevel) then
			gotoLabel("Hunt2")
			else
			gotoLabel("GoLow")
	end
	elseif (labelName == "Refill") then
	if ((Self.Level() >= 50) and (UseStrongPotions == true)) then
		local MinHealth	= MinSHealth
		local MaxHealth = MaxSHealth
		local HealthPot = "strong health potion"
	end

	elseif (labelName == "IfDeepling") then
		if (Deepling == false) then
			gotoLabel("EndOfDeepling")
		end
		elseif (labelName == "CheckPos") then
		if not (Self.Position().x == 32572 and Self.Position().y == 32025 and Self.Position().z == 9) then
		Deepling = false
		print("Deepling isn't opened today so deepling will be shutdown - going to the dwarfs.")
		gotoLabel("nowclose")
		end
	elseif (labelName == "CheckIfShortcut1") then
		if (Shortcut == false) then
			gotoLabel("EndOfShortcut1")
		end
	elseif (labelName == "CheckIfShortcut2") then
		if (Shortcut == false) then
			gotoLabel("EndOfShortcut2")
		end
	elseif (labelName == "IfShops") then
		if (Shops == false) then
			gotoLabel("EndOfShops")
		end
	elseif (labelName == "InDepoBank") then
		gotoLabel("DepositerKazordoon")
	elseif (labelName == "GoToLabelBack") then
		gotoLabel("Back")
	elseif (labelName == "IfHighLevel") then
	if (Self.Level() >= HighLevel) then
			gotoLabel("Hunt3")
			else
			gotoLabel("GoMid")
	end
	elseif (labelName == "CheckerDeepling") then
	if ((Self.ItemCount(ManaPot) < MinManas) or ((Self.ItemCount(Spear) < MinSpear) or (Self.ItemCount(HealthPot) < MinHealth) or (Self.Cap() < MinCap)) then
				gotoLabel("backFromDeepling")
				else
				gotoLabel("Deepling_hunt")
	end
	elseif (labelName == "CheckerHighLevel") then
	if ((Self.ItemCount(ManaPot) < MinManas) or (Self.ItemCount(Spear) < MinSpear) or (Self.ItemCount(HealthPot) < MinHealth) or (Self.Cap() < MinCap)) then
				gotoLabel("Next3")
				else
				gotoLabel("Hunt3")
	end
	elseif (labelName == "CheckerMidLevel") then
	if ((Self.ItemCount(ManaPot) < MinManas) or (Self.ItemCount(Spear) < MinSpear) or (Self.ItemCount(HealthPot) < MinHealth) or (Self.Cap() < MinCap)) then
				gotoLabel("Next2")
				else
				gotoLabel("Hunt2")
	end
	elseif (labelName == "CheckerLow") then
	if ((Self.ItemCount(ManaPot) < MinManas) or (Self.ItemCount(Spear) < MinSpear) or (Self.ItemCount(HealthPot) < MinHealth) or (Self.Cap() < MinCap)) then
				gotoLabel("Refill")
				else
				gotoLabel("Hunt")
	end
	elseif (labelName == "EndOfDeepling") then
	if ((Self.ItemCount(ManaPot) < MinManas) or (Self.ItemCount(Spear) < MinSpear) or (Self.ItemCount(HealthPot) < MinHealth) or (Self.Cap() < MinCap)) then
				gotoLabel("GoLow")
	end
	
	elseif (labelName == "SearchSigurd") then
		setWalkerEnabled(false)
		print("Searching Sigurd")
		Self.ReachNpc("Sigurd", 2)
		wait(2000.3000)
		print("Talking with npc")
		Self.SayToNpc({"hi", "flask", "yes", "flask", "yes", "flaks", "yes", "trade"}, 65)
		wait(2210, 2800)
		Self.ShopBuyItemsUpTo(ManaPot, MaxManas)
		wait(800, 1100)
		Self.ShopBuyItemsUpTo(HealthPot, MaxHealth)
		wait(800, 1100)
		setWalkerEnabled(true)
	elseif (labelName == "SellItems") then
		setWalkerEnabled(false)
		print("Talking with npc")
		Self.SayToNpc({"hi", "trade"}, 65)
		wait(2210, 2800)
		Self.ShopSellAllItems(3425)
		wait(800, 1100)
		Self.ShopSellAllItems(3266)
		wait(800, 1100)
		Self.ShopSellAllItems(3275)
		wait(800, 1100)
		Self.ShopSellAllItems(3351)
		wait(800, 1100)
		setWalkerEnabled(true)

if (labelName == "BuySpear") then
		setWalkerEnabled(false)
		wait(1500,1900)
		Self.ShopBuyItemsUpTo(MinSpear, MaxSpear)
		setWalkerEnabled(true)
		
	elseif (labelName == "ResetBp") then
        print("Restarting backpacks")	
            setBotEnabled(false)
            Self.CloseContainers()
			wait(2000.3000)
            Self.OpenMainBackpack(true):OpenChildren({LootBP, true}, {GoldBP, true})
			wait(2000.3000)
			setBotEnabled(true)	
end
end

Self.ReachNpc = function(name, tries)
        local npc = Creature.GetByName(name)
        if (npc:DistanceFromSelf() > 3) then
                tries =  tries or 15
                repeat
                        local nposi = npc:Position()
                        Self.UseItemFromGround(nposi.x, nposi.y, nposi.z)
                        wait(1500)
                        tries = tries - 1
                until (npc:DistanceFromSelf() <= 3) or (tries == 0)
        end
end
-----------DO NOT CHANGE ANYTHING ABOVE UNLESS YOU KNOW WHAT YOU ARE DOING--------------

 Nie mam już pomysłu co zawiodło.

Skrypt zapisany w kodowaniu .lua przez notepad++

Opublikowano

po 1 

elseif (labelName == "BuySpear") then
		setWalkerEnabled(false)
		wait(1500,1900)
		Self.ShopBuyItemsUpTo(MinSpear, MaxSpear)
		setWalkerEnabled(true)

po 2 nwm czy Ci to zadziała bo nie widzę nigdzie spear id w tym labelu

 

a po 3 spróbuj z tym : 

elseif (labelName == "BuySpear") then
		setWalkerEnabled(false)
		delayWalker(10000) 
		Self.SayToNpc("hi")
		sleep(math.random(800, 1700)) 
		Self.SayToNpc({"Hi", "Trade"}, 65)
		sleep(math.random(2000, 2400)) 
        	Self.ShopBuyItem(SpearID, (MaxSpear-Self.ItemCount(SpearID)))
		sleep(math.random(800, 1700))
		setWalkerEnabled(true)

tu gdzie spear id zmień na Id speara albo dodaj locala (gdzieś pod/nad max albo min spear) nie musi być id może być nazwa ale dodaj "" np. 

local SpearID = "Spear"

)

local SpearID = xxx

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...