i need script to use special flask like vial of oil on ground i have this but it doesnt work idk why_
elseif (labelName == "Flas") then
FLASK = "2874"
Self.UseItemWithGround(Item.GetID(FLASK), 32658, 31928, 1)
i need script to use special flask like vial of oil on ground i have this but it doesnt work idk why_
elseif (labelName == "Flas") then
FLASK = "2874"
Self.UseItemWithGround(Item.GetID(FLASK), 32658, 31928, 1)
any help
The variable "FLASK" has to be an string value in order to use it in Item.GetID().
Put FLASK = "strong mana potion" or so.
You currently making a string out of your ID.
Either choose name inside brackets like "special flask" or use ID without brackets just FLASK = 2874. Currently you have the ID number inside brackets so the bot tries to read a name called 2874 which doesn exist. An ID of that number exist, but not a name. Hope it makes sense. Good luck.
/Stusse
@eldera
can u help please
What kind of vial do you want to use? Because for example vial of blood have same id as vial of oil and only way to work around it is to put vial of blood in container x and vial of oil in container y.
Edit:
This should work as long as you use only 1 kind of vial. For example it won't work for poi DL's.
lua code:
function useVialOnGround(x, y, z)
local vialID = 2874
for index, container in Container.iContainers() do
for slot, item in container:iItems() do
if (item.id == vialID) then
local status = container:UseItemWithGround(slot, x, y, z)
wait(1000)
if (status) then
return container:MoveItemToGround(slot, Self.Position().x, Self.Position().y, Self.Position().z)
end
end
end
end
return false
end
registerNativeEventListener(WALKER_SELECTLABEL, 'onLabel')
function onLabel(name)
if (name == "useFlask") then
local position = {32370, 32235, 7}
useVialOnGround(unpack(position))
return
end
end
Last edited by eldera; 01-13-2016 at 01:23 PM.