PDA

View Full Version : dont understand



llevell
09-28-2016, 08:01 AM
hey guys greetings, someone can tell me why not buy Rune?


local ManaMax = 150
local ManaMin = 50
local ManaPot = "strong mana potion"

local HpMax = 0
local HpMin = 0
local HpPot = "health potion"

local AmmoMax = 0
local AmmoMin = 0
local Ammo = "crystalline arrow"

local RuneMax = 100
local RuneMin = 10
local RuneName = "avalanche"

local ItemBP = "brocade backpack"
local StackBP = "beach backpack"
local GoldBP = "golden backpack"

local MinCap = 150
local hardcore = true
----------------------------------------------------------------
--- Walker and labels to set:
--- start at depo
--- 1. RestartBps
--- way to bank
--- 2. DepositGold
--- way to potion shop
--- 3. BuyPots
--- way to ammo
--- 4. BuyAmmo - if you need ammo
--- way to rune shop
--- 5. BuyRunes - if you need runes
--- way to depo
--- 6. CheckBefore
--- way to hunt place
--- 7. StartHunt
--- route around spawn
--- 8. Check
--- way to depo
--- built in reach depo function in client
--- built in deposit items function in client
----------------------------------------------------------------
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
print("Full afk script by Trykon")
print("Happy Hunting!")
Walker.Start()
Targeting.Start()
Looter.Start()
function onWalkerSelectLabel(labelName)
if(labelName == "DepositGold") then
Walker.Stop()
Self.SayToNpc("hi")
wait(200,1000)
Self.SayToNpc("deposit all")
wait(200, 1000)
Self.SayToNpc("yes")
wait(1000)
Walker.Start()
elseif(labelName == "Hardcore") then
if(hardcore == true) then
gotoLabel("SkipHardcore")
end
elseif(labelName == "BuyPots")then
Walker.Stop()
Self.SayToNpc("hi")
wait(200,1000)
Self.SayToNpc("vial")
wait(200,1000)
Self.SayToNpc("yes")
wait(200,1000)
Self.SayToNpc("yes")
wait(200,1000)
Self.SayToNpc("yes")
wait(200,1000)
Self.SayToNpc("trade")
wait(200, 1000)
Self.ShopBuyItemsUpTo(HpPot, HpMax)
wait(200, 1000)
Self.ShopBuyItemsUpTo(ManaPot, ManaMax)
wait(1000)
Walker.Start()
elseif(labelName == "BuyAmmo") then
Walker.Stop()
Self.SayToNpc("hi")
wait(200,1000)
Self.SayToNpc("trade")
wait(200, 1000)
Self.ShopBuyItemsUpTo(Ammo, AmmoMax)
wait(200, 1000)
wait(1000)
Walker.Start()
elseif(labelName == "BuyRunes") then
Walker.Stop()
Self.SayToNpc("hi")
wait(200,1000)
Self.SayToNpc("trade")
wait(200, 1000)
Self.ShopBuyItemsUpTo(RuneName, RuneMax)
wait(200, 1000)
wait(1000)
Walker.Start()
elseif(labelName == "CheckBefore") then
if(Self.Cap() < MinCap or Self.ItemCount(HpPot) < HpMax or Self.ItemCount(Ammo) < AmmoMax or Self.ItemCount(RuneName) < RuneMax or Self.ItemCount(ManaPot) < ManaMax-2) then
gotoLabel("RestartBps")
else
print("Check passed")
end
elseif(labelName == "RestartBps") then
Walker.Stop()
Self.CloseContainers()
wait(200)
Self.OpenMainBackpack(true)
Container.GetFirst():OpenChildren(ItemBP)
wait(1000)
Container.GetByName(ItemBP):Minimize()
wait(1000)
Container.GetFirst():OpenChildren(StackBP)
wait(1000)
Container.GetByName(StackBP):Minimize()
wait(1000)
Container.GetFirst():OpenChildren(GoldBP)
wait(1000)
Container.GetByName(GoldBP):Minimize()
wait(1000)
Walker.Start()
elseif(labelName == "Check") then
if(Self.Cap() >= MinCap and Self.ItemCount(Ammo) >= AmmoMin and Self.ItemCount(HpPot) >= HpMin and Self.ItemCount(RuneName) >= RuneMin and Self.ItemCount(ManaPot) >= ManaMin) then
gotoLabel("StartHunt")
else
gotoLabel("Leave")
end
elseif(labelName == "Check1") then
if(Self.Cap() >= MinCap and Self.ItemCount(Ammo) >= AmmoMin and Self.ItemCount(HpPot) >= HpMin and Self.ItemCount(RuneName) >= RuneMin and Self.ItemCount(ManaPot) >= ManaMin) then
print("Still hunting")
else
gotoLabel("Leave")
end
end
end

Oscagi
09-28-2016, 08:21 AM
hey guys greetings, someone can tell me why not buy Rune?


local ManaMax = 150
local ManaMin = 50
local ManaPot = "strong mana potion"

local HpMax = 0
local HpMin = 0
local HpPot = "health potion"

local AmmoMax = 0
local AmmoMin = 0
local Ammo = "crystalline arrow"

local RuneMax = 100
local RuneMin = 10
local RuneName = "avalanche"

local ItemBP = "brocade backpack"
local StackBP = "beach backpack"
local GoldBP = "golden backpack"

local MinCap = 150
local hardcore = true
----------------------------------------------------------------
--- Walker and labels to set:
--- start at depo
--- 1. RestartBps
--- way to bank
--- 2. DepositGold
--- way to potion shop
--- 3. BuyPots
--- way to ammo
--- 4. BuyAmmo - if you need ammo
--- way to rune shop
--- 5. BuyRunes - if you need runes
--- way to depo
--- 6. CheckBefore
--- way to hunt place
--- 7. StartHunt
--- route around spawn
--- 8. Check
--- way to depo
--- built in reach depo function in client
--- built in deposit items function in client
----------------------------------------------------------------
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
print("Full afk script by Trykon")
print("Happy Hunting!")
Walker.Start()
Targeting.Start()
Looter.Start()
function onWalkerSelectLabel(labelName)
if(labelName == "DepositGold") then
Walker.Stop()
Self.SayToNpc("hi")
wait(200,1000)
Self.SayToNpc("deposit all")
wait(200, 1000)
Self.SayToNpc("yes")
wait(1000)
Walker.Start()
elseif(labelName == "Hardcore") then
if(hardcore == true) then
gotoLabel("SkipHardcore")
end
elseif(labelName == "BuyPots")then
Walker.Stop()
Self.SayToNpc("hi")
wait(200,1000)
Self.SayToNpc("vial")
wait(200,1000)
Self.SayToNpc("yes")
wait(200,1000)
Self.SayToNpc("yes")
wait(200,1000)
Self.SayToNpc("yes")
wait(200,1000)
Self.SayToNpc("trade")
wait(200, 1000)
Self.ShopBuyItemsUpTo(HpPot, HpMax)
wait(200, 1000)
Self.ShopBuyItemsUpTo(ManaPot, ManaMax)
wait(1000)
Walker.Start()
elseif(labelName == "BuyAmmo") then
Walker.Stop()
Self.SayToNpc("hi")
wait(200,1000)
Self.SayToNpc("trade")
wait(200, 1000)
Self.ShopBuyItemsUpTo(Ammo, AmmoMax)
wait(200, 1000)
wait(1000)
Walker.Start()
elseif(labelName == "BuyRunes") then
Walker.Stop()
Self.SayToNpc("hi")
wait(200,1000)
Self.SayToNpc("trade")
wait(200, 1000)
Self.ShopBuyItemsUpTo(RuneName, RuneMax)
wait(200, 1000)
wait(1000)
Walker.Start()
elseif(labelName == "CheckBefore") then
if(Self.Cap() < MinCap or Self.ItemCount(HpPot) < HpMax or Self.ItemCount(Ammo) < AmmoMax or Self.ItemCount(RuneName) < RuneMax or Self.ItemCount(ManaPot) < ManaMax-2) then
gotoLabel("RestartBps")
else
print("Check passed")
end
elseif(labelName == "RestartBps") then
Walker.Stop()
Self.CloseContainers()
wait(200)
Self.OpenMainBackpack(true)
Container.GetFirst():OpenChildren(ItemBP)
wait(1000)
Container.GetByName(ItemBP):Minimize()
wait(1000)
Container.GetFirst():OpenChildren(StackBP)
wait(1000)
Container.GetByName(StackBP):Minimize()
wait(1000)
Container.GetFirst():OpenChildren(GoldBP)
wait(1000)
Container.GetByName(GoldBP):Minimize()
wait(1000)
Walker.Start()
elseif(labelName == "Check") then
if(Self.Cap() >= MinCap and Self.ItemCount(Ammo) >= AmmoMin and Self.ItemCount(HpPot) >= HpMin and Self.ItemCount(RuneName) >= RuneMin and Self.ItemCount(ManaPot) >= ManaMin) then
gotoLabel("StartHunt")
else
gotoLabel("Leave")
end
elseif(labelName == "Check1") then
if(Self.Cap() >= MinCap and Self.ItemCount(Ammo) >= AmmoMin and Self.ItemCount(HpPot) >= HpMin and Self.ItemCount(RuneName) >= RuneMin and Self.ItemCount(ManaPot) >= ManaMin) then
print("Still hunting")
else
gotoLabel("Leave")
end
end
end


local RuneName = "avalanche" -- Change avalance for "Avalanche Rune"

Done. ; _ ;

Trykon
09-28-2016, 10:32 AM
Hah my old script... sorry, this one was used mostly on RP so I didn't bother and just put "avalanche" there xD just to let you know that this is the field you need to set runes... you need to put either "Avalanche Rune" or ID of avalanche which I use on my mage scripts

Xorleh
09-28-2016, 11:22 AM
I don't know if changin "avalance" to "Avalance Rune" it would be solved but I see another problem, the money.

Before buying runes you are depositing all the money, but you never withdraw nothing to buy potions, runes... I think you should define the prices and then withdraw the total which could be:


(HpPrice * HpMax) + (ManaPrice * ManaMax) + (RunePrice * RuneMax)

Correct me if I'm wrong. I try to help but I'm learning to code for just a few days ago... ^^'

llevell
09-28-2016, 12:09 PM
Guys Thanks for the explanation and for taking a moment to answer

Trykon
09-28-2016, 03:31 PM
This works on pacc as you dont need money on you, if you are facc then I would deposit first then use build in function to withdraw some money and after full refill deposit remaining money...

Trykon
09-28-2016, 03:33 PM
I don't know if changin "avalance" to "Avalance Rune" it would be solved but I see another problem, the money.

Before buying runes you are depositing all the money, but you never withdraw nothing to buy potions, runes... I think you should define the prices and then withdraw the total which could be:


(HpPrice * HpMax) + (ManaPrice * ManaMax) + (RunePrice * RuneMax)

Correct me if I'm wrong. I try to help but I'm learning to code for just a few days ago... ^^'

One... look on my previous answer
Two... AVALANCHE not avanalce