XenoBot Forums - Powered by vBulletin

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: script to use special flask on ground

  1. #1

    Join Date
    May 2015
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    script to use special flask on ground

    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)

  2. #2

    Join Date
    May 2015
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

  3. #3

    Join Date
    May 2015
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    any help

  4. #4
    Senior Member maroxy's Avatar
    Join Date
    Apr 2014
    Location
    EUW
    Posts
    897
    Mentioned
    137 Post(s)
    Tagged
    0 Thread(s)
    The variable "FLASK" has to be an string value in order to use it in Item.GetID().

    Put FLASK = "strong mana potion" or so.


    Remember that the official XenoBot page is www.xenobot.net not xeno-bot.net or similar

  5. #5

    Join Date
    May 2015
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by maroxy View Post
    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]

  6. #6
    Lifetime Subscriber Stusse's Avatar
    Join Date
    Dec 2011
    Location
    solid-scripts.com
    Posts
    3,523
    Mentioned
    346 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by sholh View Post
    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

  7. #7

    Join Date
    May 2015
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stusse View Post
    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)

  8. #8

    Join Date
    May 2015
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    @eldera
    can u help please

  9. #9
    Monthly Subscriber
    Join Date
    Jun 2012
    Posts
    185
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sholh View Post
    @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.

  10. #10

    Join Date
    May 2015
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by eldera View Post
    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
    i wanna make all inq missions on a full afk script to make all my noob chars do it so i wanna this script to use special flaks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •