View Full Version : script to use special flask on ground
sholh
01-09-2016, 04:28 PM
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)
sholh
01-09-2016, 05:40 PM
help shadowart maroxy Rif soul4soul fioletowya anoyn
sholh
01-10-2016, 11:18 AM
any help
maroxy
01-10-2016, 06:33 PM
The variable "FLASK" has to be an string value in order to use it in Item.GetID().
Put FLASK = "strong mana potion" or so.
sholh
01-10-2016, 10:40 PM
The variable "FLASK" has to be an string value in order to use it in Item.GetID().
Put FLASK = "strong mana potion" or so.
i wanna make the script use this
00:39 You see special flask. It contains holy water from the white raven monastery. It weights 2.80 oz. [ID 2874]
Stusse
01-10-2016, 11:00 PM
i wanna make the script use this
00:39 You see special flask. It contains holy water from the white raven monastery. It weights 2.80 oz. [ID 2874]
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
sholh
01-11-2016, 11:12 AM
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
doesnt work too bro
elseif (labelName == "Flas") then
FLASK= 2874 --variable name encase they are using a tool
Self.UseItemWithGround(Item.GetID(FLASK), 33170, 31812, 7)
sholh
01-13-2016, 10:50 AM
eldera
can u help please
eldera
01-13-2016, 01:02 PM
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.
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
sholh
01-13-2016, 02:25 PM
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.
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
i wanna make all inq missions on a full afk script to make all my noob chars do it :D so i wanna this script to use special flaks
sholh
01-13-2016, 04:06 PM
its waorks Eldera thanks agine :)
eldera
01-13-2016, 06:10 PM
Better version
function Container:UseVialOnGround(x, y, z)
self = type(self) == 'table' and self or Container.New(self)
return (function(container, x, y, z)
local vialID = 2874
local container = type(container) == 'table' and container or Container.New(container)
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
return false
end)(self._index, x, y, z)
end
--[[ USAGE ]]--
local position = {32370, 32235, 7}
local containerWithBlood = Container.New("Crystal Backpack")
containerWithBlood:UseVialOnGround(unpack(position ))
local containerWithOil = Container.New("Zaoan Chess Box")
containerWithOil:UseVialOnGround(unpack(position))
sholh
01-14-2016, 09:03 AM
thx for the better virsion
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.