XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 2 of 2

Thread: Drop Assassin stars when more than X

  1. #1

    Join Date
    Apr 2016
    Posts
    2
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Drop Assassin stars when more than X

    Hi guys!
    I am playing on OT Server and i need simply script to drop assassin stars when got more than X.
    (I go hunt with 100 stars, when i got more than 120 stars bot should drop 20)
    If possible to do something like that?

  2. #2
    Senior Member
    Join Date
    Sep 2012
    Posts
    1,070
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    @smoq
    Code:
    itemId = 3578	-- Item Id that you want to drop
    dropMin = 9	-- Which ammount (minimum) do you want to drop?
    dropMax = 15	-- Which ammount (maximum) do you want to drop?
    
    function dropItem(id, cnt) 
        local cont = Container.GetFirst() 
    
        while (cont:isOpen()) do 
            for spot = 0, cont:ItemCount() do 
                local item = cont:GetItemData(spot) 
                if (item.id == id and item.count >= cnt) then 
                        cont:MoveItemToGround(spot, Self.Position().x, Self.Position().y, Self.Position().z) 
                        return true 
                end 
            end 
    
            cont = cont:GetNext() 
        end 
         
        return false 
    end 
    
    
    while (true) do 
        if (dropItem(itemId,math.random(dropMin,dropMax))) then
            wait(30000, 45000)
        else
            wait(2000)
        end
    
    I'm using this, it randomizes the count for more randomness, you can just set both values to 20 if you play OT.

Posting Permissions

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