Beo
02-01-2013, 10:13 AM
This is going to be a real quick tutorial on how to create a refiller.
First you'll need the LUA code.
-------------------------------------------------
----------------Y2Quake--------------------
--------------TARANTULAS PH------------------
-----------------KNIGHT-----------------------
-------------------------------------------------
--Settings---------------------------------------
MPotID = 268 --- mana potion ID
MinMPots = 1 ---- if less then script will exit spawn
MPots = 5 ----- amount to refill
MPotprice = 50 ---- price of 1 single mana pot
HPotID = 266 ---- health potion ID
HPotprice = 45 ---- health potion price
HPots = 150 ---- health potions you want to buy
MinHPots = 30 ---- min of health potions to leave
MinCap = 50 ---- if less then script will exit spawn
-------------------------------------------------
--END OF SETTINGS--------------------------------
--- DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU'RE DOING ---
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
local info = [[
Free script made by:
Y2Quake]]
function NpcConv(...)
for _, str in ipairs(arg) do
wait((tostring(str):len() / 125) * 60000 * math.random(1.1, 1.8))
Self.SayToNpc(str)
end
end
dofile("Forgee.lua")
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
delayWalker(1000)
setWalkerEnabled(false)
if (Self.ItemCount(MPotID) <= MinMPots) or (Self.Cap() < MinCap) or (Self.ItemCount(HPotID) <= MinHPots) then
setWalkerEnabled(true)
gotoLabel("refill")
else
setWalkerEnabled(true)
gotoLabel("KeepHunting")
end
elseif (labelName == "KeepHunting") then
print(info)
elseif (labelName == "bank") then
setWalkerEnabled(false)
NpcConv("hi","deposit all","yes","balance")
wait(900, 1200)
Self.WithdrawMoney((MPotprice*(MPots-Self.ItemCount(MPotID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(900, 1200)
Self.WithdrawMoney((HPotprice*(HPots-Self.ItemCount(HPotID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(900, 1200)
Self.SayToNpc("withdraw 15")
wait(900, 1200)
Self.SayToNpc("yes")
wait(15000,19000)
setWalkerEnabled(true)
elseif (labelName == "deposit") then
setWalkerEnabled(false)
Self.DepositItems(10281, {3053, 1}, {5902, 1}, {3351, 1})
wait(1500,1900)
setWalkerEnabled(true)
elseif (labelName == "tradepots") then
setWalkerEnabled(false)
wait(900, 1200)
Self.SayToNpc({"Hi", "flasks", "yes", "yes", "yes", "Trade"}, 65)
sleep(math.random(2000, 2400))
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID , (MPots-Self.ItemCount(MPotID)))
sleep(math.random(2000, 2400))
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(HPotID , (HPots-Self.ItemCount(HPotID)))
sleep(math.random(2000, 2400))
setWalkerEnabled(true)
elseif (labelName == "resetbps") then
dofile("Forgee.lua")
delayWalker(15000)
resetBackpacks()
end
end
function buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(item, count)
count = tonumber(count) or 1
repeat
local amnt = math.min(count, 100)
if(Self.ShopBuyItem(item, amnt) == 0)then
return printf("ERROR: failed to buy item: %s", tostring(item))
end
wait(200,500)
count = (count - amnt)
until count <= 0
end
Here is one I have found by Y2Quake for Tarantulas. I have edited it a bit to remove some labels we won't use in this tutorial.
You can edit the top part, no problem. That is the settings.
Now copy and paste this into your Scripts folder located in "Documents".
Rename it to the waypoints you are going to make, for better organization.
E.G.
You want to make Thais Trolls with depositor. You rename this to ThaisTrolls-DepositandRefill.lua
Now we're going to make the waypoints and refiller.
You're going to start at the entrance of the spawn and make a label called "check".
You're now going to make at the exact same spot called "KeepHunting".
Make the waypoints around the cave using Node, until you're back at where you made the "check" label.
You will now make a label called "refill".
Make waypoints to the bank, when you are standing next to the banker make a "stand". Then create a label called "bank".
Then make waypoints to the depot and make a label called "deposit".
Time to buy some life. Make waypoints to the potion shop. Make a "stand" and make a label called "trade pots".
Now make a few nodes around the shop or go to PZ and make a label called "resetbps".
Now make waypoints back to the label "checker".
Save your settings by right clicking yourself, settings, new profile, save.
Now, edit your LUA settings and you are ready to start banking that cash.
NOTES
-- You will need to ensure the label names are exactly the same as the ones above. Otherwise it will not work.
-- You will need Forgee.Lua which a simple search can find.
Please report and problems and I will try to solve them for you :cool:
First you'll need the LUA code.
-------------------------------------------------
----------------Y2Quake--------------------
--------------TARANTULAS PH------------------
-----------------KNIGHT-----------------------
-------------------------------------------------
--Settings---------------------------------------
MPotID = 268 --- mana potion ID
MinMPots = 1 ---- if less then script will exit spawn
MPots = 5 ----- amount to refill
MPotprice = 50 ---- price of 1 single mana pot
HPotID = 266 ---- health potion ID
HPotprice = 45 ---- health potion price
HPots = 150 ---- health potions you want to buy
MinHPots = 30 ---- min of health potions to leave
MinCap = 50 ---- if less then script will exit spawn
-------------------------------------------------
--END OF SETTINGS--------------------------------
--- DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU'RE DOING ---
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
local info = [[
Free script made by:
Y2Quake]]
function NpcConv(...)
for _, str in ipairs(arg) do
wait((tostring(str):len() / 125) * 60000 * math.random(1.1, 1.8))
Self.SayToNpc(str)
end
end
dofile("Forgee.lua")
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
delayWalker(1000)
setWalkerEnabled(false)
if (Self.ItemCount(MPotID) <= MinMPots) or (Self.Cap() < MinCap) or (Self.ItemCount(HPotID) <= MinHPots) then
setWalkerEnabled(true)
gotoLabel("refill")
else
setWalkerEnabled(true)
gotoLabel("KeepHunting")
end
elseif (labelName == "KeepHunting") then
print(info)
elseif (labelName == "bank") then
setWalkerEnabled(false)
NpcConv("hi","deposit all","yes","balance")
wait(900, 1200)
Self.WithdrawMoney((MPotprice*(MPots-Self.ItemCount(MPotID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(900, 1200)
Self.WithdrawMoney((HPotprice*(HPots-Self.ItemCount(HPotID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(900, 1200)
Self.SayToNpc("withdraw 15")
wait(900, 1200)
Self.SayToNpc("yes")
wait(15000,19000)
setWalkerEnabled(true)
elseif (labelName == "deposit") then
setWalkerEnabled(false)
Self.DepositItems(10281, {3053, 1}, {5902, 1}, {3351, 1})
wait(1500,1900)
setWalkerEnabled(true)
elseif (labelName == "tradepots") then
setWalkerEnabled(false)
wait(900, 1200)
Self.SayToNpc({"Hi", "flasks", "yes", "yes", "yes", "Trade"}, 65)
sleep(math.random(2000, 2400))
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID , (MPots-Self.ItemCount(MPotID)))
sleep(math.random(2000, 2400))
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(HPotID , (HPots-Self.ItemCount(HPotID)))
sleep(math.random(2000, 2400))
setWalkerEnabled(true)
elseif (labelName == "resetbps") then
dofile("Forgee.lua")
delayWalker(15000)
resetBackpacks()
end
end
function buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(item, count)
count = tonumber(count) or 1
repeat
local amnt = math.min(count, 100)
if(Self.ShopBuyItem(item, amnt) == 0)then
return printf("ERROR: failed to buy item: %s", tostring(item))
end
wait(200,500)
count = (count - amnt)
until count <= 0
end
Here is one I have found by Y2Quake for Tarantulas. I have edited it a bit to remove some labels we won't use in this tutorial.
You can edit the top part, no problem. That is the settings.
Now copy and paste this into your Scripts folder located in "Documents".
Rename it to the waypoints you are going to make, for better organization.
E.G.
You want to make Thais Trolls with depositor. You rename this to ThaisTrolls-DepositandRefill.lua
Now we're going to make the waypoints and refiller.
You're going to start at the entrance of the spawn and make a label called "check".
You're now going to make at the exact same spot called "KeepHunting".
Make the waypoints around the cave using Node, until you're back at where you made the "check" label.
You will now make a label called "refill".
Make waypoints to the bank, when you are standing next to the banker make a "stand". Then create a label called "bank".
Then make waypoints to the depot and make a label called "deposit".
Time to buy some life. Make waypoints to the potion shop. Make a "stand" and make a label called "trade pots".
Now make a few nodes around the shop or go to PZ and make a label called "resetbps".
Now make waypoints back to the label "checker".
Save your settings by right clicking yourself, settings, new profile, save.
Now, edit your LUA settings and you are ready to start banking that cash.
NOTES
-- You will need to ensure the label names are exactly the same as the ones above. Otherwise it will not work.
-- You will need Forgee.Lua which a simple search can find.
Please report and problems and I will try to solve them for you :cool: