Log in

View Full Version : please help with script



mario
06-02-2016, 04:09 AM
can anyony please help me with a script for paladin just with ammo refiler, pot refilier
item depositer and all that staff just so i can make hunt scripts with that lua :D

hackbit
08-30-2016, 02:42 PM
local ammo = 'crystalline ammo'
local maxammo = 300
local minammo = 100

local potions = 'mana potion'
local maxpotions = 500
local minpotions = 100


deposit items you can use build in depositor just add the depositor to a label

mickat
09-01-2016, 12:41 PM
NEED HELP WITH THIS SCRIPT WORK BUT DO NOTHING IN ANY LABEL

while (true) do

local MinStamina = 16
local MinManaPot = 10 -- MANA POTION TO LEAVE HUNT
local ManaPotID = 268 -- ID MANA POTION
local MaxManaPot = 300 -- MAXIMUN MANA POTION IN THE BACKPACK
local GoldBP = "Minotaur Backpack"
local LootBP = "Dragon Backpack"
local SupplyBP = "Deepling Backpack"
local FoodBP = "Backpack"
local Ccoin = 3043
local Pcoin = 3035
local ManaPot = 300
local IDPot = 268
local itemSort = 268 -- ID MANA POTION
local backpackSortFrom = 'jewelled backpack' -- MAIN BACKPACK
local backpackSortTo = 'deepling backpack' -- SUPPLY BACKPACK
local dLay = 500 -- TIME TO MOVE ITEM
local itemSorter = function(sortItem, from, to)
local fromBp = Container.New(from)
local toBp = Container.New(to)

Walker.Start()
Looter.Start()
Targeting.Start()

-- DROP POTIONS

Self.DropFlasks(Self.Position().x, Self.Position().y, Self.Position().z)

-- CHECK STAMINA

if (labelname == "Stamina") then
Walker.Stop()
local Stamina = (Self.Stamina() <= MinStamina)
Walker.ConditionalGoto(Stamina, "Logout", "CheckMana")
end

if (labelname == "Logout") then
Walker.Stop()
print("Logout Stamina Low")
os.exit()
else
Walker.Start()
end

-- CHECK MANA POTION

if (labelname == "CheckMana") then
Walker.Stop()
Self.ItemCount(ManaPotID)
local manapotion = (Self.ItemCount(ManaPotID) < MinManaPot)
Walker.ConditionalGoto(manapotion, "LeaveHuntRnd", "StartHuntRnd")
end

if (labelname == "StartHuntRnd") then
gotolabel("StartHuntRnd1")
wait(2000)
end
Walker.Start()

if (labelname == "LeaveHuntRnd") then
gotolabel("LeaveHuntRnd1")
elseif (labelname == "LeaveHuntRnd") then
gotolabel("LeaveHuntRnd2")
elseif (labelname == "LeaveHuntRnd") then
gotolabel("LeaveHuntRnd3")
end
Walker.Start()

-- RESET BACKPACKS

if (labelName == "ResetBps") then
Walker.Stop()
Self.CloseContainers()
Self.OpenMainBackpack(true):OpenChildren({GoldBP, true}, {LootBP, true}, {SupplyBP, true}, {FoodBP, true})
Container.GetFirst():Minimize()
end
Walker.Start()

-- WITHDRAW AND DEPOSIT GOLD

if (labelname == "Bank") then
Walker.Stop()
local npc = (Self.ItemCount(Ccoin) and (Self.ItemCount(Pcoin) == 0))
Walker.ConditionalGoto(npc, "Withdraw", "Deposit")
end

if (labelname == "Withdraw") then
Self.ItemCount(ManaPot)
if (Self.ItemCount(IDPot) < ManaPot) then
Self.SayToNpc("hi", "withdraw", "15000", "yes", 60)
else
gotolabel("Deposit")

if (labelname == "Deposit") then
Self.SayToNpc("hi", "Deposit all", "yes", 60)
end
end
end
Walker.Start()

-- BUY MANA POTIONS

if (labelname == "Reffil") then
Walker.Stop()
local Buying = (Self.ItemCount(ManaPotID) < MinManaPot)
Walker.ConditionalGoto(Buying, "BuyMana", "NotBuy")
end

if (labelname == "BuyMana") then
Self.SayToNpc("hi", "trade", 20)
if (Self.ItemCount(ManaPotID) < MaxManaPot) then
Self.ShopBuyItem(ManaPotID, MaxManaPot - Self.ItemCount(manaID))
else
gotolabel("notbuy")
end
end
Walker.Start()

-- MOVER MANA POTION TO SUPPLY BACKPACK

-- Don't change code below.

if type(sortItem) == 'number' then
for spot, item in (fromBp:iItems()) do
if item.id == sortItem then
fromBp:MoveItemToContainer(spot, toBp:Index())
end
end
elseif type(sortItem) == 'string' then
for spot, item in (fromBp:iItems()) do
if item.name == sortItem then
fromBp:MoveItemToContainer(spot, toBp:Index())
end
end
end
end

Module.New('Sorter', function(this)
itemSorter(itemSort, backpackSortFrom, backpackSortTo)
this:Delay(dLay)
end)

-- DEPOT

if (labelname == "depot") then
Walker.Stop()
Self.OpenDepot()
end
Walker.Start()
end

AAscripts
09-01-2016, 09:45 PM
why in the hell there is a while loop at the begining of the script?

hackbit
09-04-2016, 11:42 PM
NEED HELP WITH THIS SCRIPT WORK BUT DO NOTHING IN ANY LABEL

while (true) do

local MinStamina = 16
local MinManaPot = 10 -- MANA POTION TO LEAVE HUNT
local ManaPotID = 268 -- ID MANA POTION
local MaxManaPot = 300 -- MAXIMUN MANA POTION IN THE BACKPACK
local GoldBP = "Minotaur Backpack"
local LootBP = "Dragon Backpack"
local SupplyBP = "Deepling Backpack"
local FoodBP = "Backpack"
local Ccoin = 3043
local Pcoin = 3035
local ManaPot = 300
local IDPot = 268
local itemSort = 268 -- ID MANA POTION
local backpackSortFrom = 'jewelled backpack' -- MAIN BACKPACK
local backpackSortTo = 'deepling backpack' -- SUPPLY BACKPACK
local dLay = 500 -- TIME TO MOVE ITEM
local itemSorter = function(sortItem, from, to)
local fromBp = Container.New(from)
local toBp = Container.New(to)

Walker.Start()
Looter.Start()
Targeting.Start()

-- DROP POTIONS

Self.DropFlasks(Self.Position().x, Self.Position().y, Self.Position().z)

-- CHECK STAMINA

if (labelname == "Stamina") then
Walker.Stop()
local Stamina = (Self.Stamina() <= MinStamina)
Walker.ConditionalGoto(Stamina, "Logout", "CheckMana")
end

if (labelname == "Logout") then
Walker.Stop()
print("Logout Stamina Low")
os.exit()
else
Walker.Start()
end

-- CHECK MANA POTION

if (labelname == "CheckMana") then
Walker.Stop()
Self.ItemCount(ManaPotID)
local manapotion = (Self.ItemCount(ManaPotID) < MinManaPot)
Walker.ConditionalGoto(manapotion, "LeaveHuntRnd", "StartHuntRnd")
end

if (labelname == "StartHuntRnd") then
gotolabel("StartHuntRnd1")
wait(2000)
end
Walker.Start()

if (labelname == "LeaveHuntRnd") then
gotolabel("LeaveHuntRnd1")
elseif (labelname == "LeaveHuntRnd") then
gotolabel("LeaveHuntRnd2")
elseif (labelname == "LeaveHuntRnd") then
gotolabel("LeaveHuntRnd3")
end
Walker.Start()

-- RESET BACKPACKS

if (labelName == "ResetBps") then
Walker.Stop()
Self.CloseContainers()
Self.OpenMainBackpack(true):OpenChildren({GoldBP, true}, {LootBP, true}, {SupplyBP, true}, {FoodBP, true})
Container.GetFirst():Minimize()
end
Walker.Start()

-- WITHDRAW AND DEPOSIT GOLD

if (labelname == "Bank") then
Walker.Stop()
local npc = (Self.ItemCount(Ccoin) and (Self.ItemCount(Pcoin) == 0))
Walker.ConditionalGoto(npc, "Withdraw", "Deposit")
end

if (labelname == "Withdraw") then
Self.ItemCount(ManaPot)
if (Self.ItemCount(IDPot) < ManaPot) then
Self.SayToNpc("hi", "withdraw", "15000", "yes", 60)
else
gotolabel("Deposit")

if (labelname == "Deposit") then
Self.SayToNpc("hi", "Deposit all", "yes", 60)
end
end
end
Walker.Start()

-- BUY MANA POTIONS

if (labelname == "Reffil") then
Walker.Stop()
local Buying = (Self.ItemCount(ManaPotID) < MinManaPot)
Walker.ConditionalGoto(Buying, "BuyMana", "NotBuy")
end

if (labelname == "BuyMana") then
Self.SayToNpc("hi", "trade", 20)
if (Self.ItemCount(ManaPotID) < MaxManaPot) then
Self.ShopBuyItem(ManaPotID, MaxManaPot - Self.ItemCount(manaID))
else
gotolabel("notbuy")
end
end
Walker.Start()

-- MOVER MANA POTION TO SUPPLY BACKPACK

-- Don't change code below.

if type(sortItem) == 'number' then
for spot, item in (fromBp:iItems()) do
if item.id == sortItem then
fromBp:MoveItemToContainer(spot, toBp:Index())
end
end
elseif type(sortItem) == 'string' then
for spot, item in (fromBp:iItems()) do
if item.name == sortItem then
fromBp:MoveItemToContainer(spot, toBp:Index())
end
end
end
end

Module.New('Sorter', function(this)
itemSorter(itemSort, backpackSortFrom, backpackSortTo)
this:Delay(dLay)
end)

-- DEPOT

if (labelname == "depot") then
Walker.Stop()
Self.OpenDepot()
end
Walker.Start()
end

Umm wow i have no idea if you just copy pasted from other scripts but you need to organize this better,
i see you dont have a:
registerEventListener(WALKER_SELECTLABEL, "onLabel")

i mean im a noob at scripting but i can make a fully afk script by looking up tutorials

fafatax
09-20-2016, 04:24 AM
Nice bro

mickat
10-06-2016, 03:56 PM
-- ABRIR BACKPACKS

Bp1 = "backpack"
Bp2 = "expedition backpack"


registerEventListener(WALKER_SELECTLABEL, "onWalkerbps")
function onWalkerbps(labelName)
if (labelName == "ResetBps") then
print([[Abriendo Backpacks...]])
setWalkerEnabled(false)
Client.HideEquipment()
Self.CloseContainers()
Self.OpenMainBackpack(true):OpenChildren({Bp1, true}, {Bp2, true})
Container.GetLast():Minimize()
end
setWalkerEnabled(true)
end

-- VERIFICAR CAPACIDAD, POCIONES Y BOLTS PARA IR A CAZAR

Bolt = 3450
MinBolt = 100
MinCap = 100
MinManaPot = 20
MaxManaPot = 100
ManaPotID = 237

registerEventListener(WALKER_SELECTLABEL, "onWalkerchecker")
function onWalkerchecker(labelName)
if (labelName == "Checker") then
print([[Verificando Pociones, Capacidad y Bolts...]])
if (Self.Cap() <= MinCap) or ((Self.ItemCount(ManaPotID) <= MinManaPot)) or ((Self.ItemCount(Bolt) <= MinBolt)) then
gotoLabel("Leave")
else
gotoLabel("KeepHunting")
end
end
end

-- VERIFICAR STAMINA PARA IR A CAZAR

LogoutStamina = true
StaminaHours = 16

registerEventListener(WALKER_SELECTLABEL, "onWalkerStamina")
function onWalkerStamina(labelName)
if (labelName == "Stamina") then
print([[Verificando Stamina...]])
if LogoutStamina == true then
if Self.Stamina() <= (StaminaHours*60) then
setWalkerEnabled(false)
print([[Low Stamina Auto Logout]])
wait(3000)
Self.Logout()
end
end
end
end

-- COMPRAR POCIONES

IDMana = 237
ManaCost = 80
MaxMana = 100

registerEventListener(WALKER_SELECTLABEL, "onWalkerPots")
function onWalkerPots(labelName)


if (labelName == "Pots") then
setWalkerEnabled(false)
print([[Comprando...]])
if (Self.ItemCount(IDMana) < MaxMana) then
Self.SayToNpc({"hi", "trade"}, 65)
wait(2000)
if (Self.ItemCount(IDMana) < MaxMana) then
Self.ShopBuyItem(IDMana, (MaxMana-Self.ItemCount(IDMana)))
wait(500)
end
wait(200, 500)
end
end
setWalkerEnabled(true)
end

-- DEPOSITAR DINERO

registerEventListener(WALKER_SELECTLABEL, "onWalkerAtBank1")
function onWalkerAtBank1(labelName)
if (labelName == "AtBank1") then
print([[Depositando...]])
setWalkerEnabled(false)
Self.SayToNpc({"hi", "deposit all", "yes"}, 50)
Self.SayToNpc({"balance"}, 50)
Self.SayToNpc({"bye"}, 50)
setWalkerEnabled(true)
end
end

-- SACAR DINERO PARA POCIONES

ID = 237
Cost = 80
Max = 100


registerEventListener(WALKER_SELECTLABEL, "onWalkerAtBank2")
function onWalkerAtBank2(labelName)
if (labelName == "AtBank2") then
print([[Retirando...]])
setWalkerEnabled(false)
if (Self.ItemCount(ID) < Max) then
Self.SayToNpc({"hi"}, 50)
Withdraw = (Max - Self.ItemCount(ID)) * Cost
Self.WithdrawMoney(Withdraw)
Self.SayToNpc({"bye"}, 50)
setWalkerEnabled(true)
end
end
end

-- DEPOSITAR

registerEventListener(WALKER_SELECTLABEL, "onWalkerDepositer")
function onWalkerDepositer(labelName)
if (labelName == "Deposit") then
setWalkerEnabled(false)
print([[Guardando Botin...]])
Client.HideEquipment()
Self.DepositItems({3071, 16},{3416, 16},{7430, 16},{3297, 16},{3322, 16},{11457, 16},{5877, 16})
end
setWalkerEnabled(true)
end

-- REFFIL BOLTS

AmmoMax = 600
AmmoUse = 3450
DP = 15

registerEventListener(WALKER_SELECTLABEL, "onWalkerReffil")
function onWalkerReffil(labelName)
if (labelName == "Reffil") then
setWalkerEnabled(false)
print([[Refileando Bolts...]])
if (Self.ItemCount(AmmoUse) < AmmoMax) then
AmmoToWithdraw = (AmmoMax - Self.ItemCount(AmmoUse))
Self.WithdrawItems(DP, {AmmoUse, 0, AmmoToWithdraw})
print([[Bolts Cargadas 600...]])
else
setWalkerEnabled(false)
Self.Logout()
end
end
dofile ("move bolts mickat.lua")
setWalkerEnabled(true)
end

mickat
10-06-2016, 03:56 PM
ESTE SCRIPT ES PARA PALADIN PERO NECESITAS MIDIFICAR BPS-IDS-ETC EN EL ARCHIVO .LUA Y AHCER EL RECORRIDO A TU GUSTO CON LAS ETIQUETAS MARCADAS EN EL ARCHIVO .LUA PARA QUE TE FUNCIONE CORRECTAMENTE

kulinia
10-20-2016, 12:57 AM
Bro.. u can use a item on other item on the backpack?

just like use obsidian knife on marmol..